/* Blue sidebar layout with responsive design */
:root {
  --blue-900: #0d47a1;
  --blue-800: #1565c0;
  --blue-700: #1976d2;
  --blue-600: #1e88e5;
  --blue-500: #2196f3;
  --blue-100: #e3f2fd;
}

body {
  background: #f4f6f8;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

.topbar {
  height: 56px;
  background: var(--blue-800);
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 1rem;
}

.topbar a {
  color: #fff;
  text-decoration: none;
}

.topbar .mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
}

.layout {
  display: flex;
  min-height: calc(100vh - 56px);
  position: relative;
}

.sidebar {
  width: 250px;
  background: var(--blue-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: calc(100vh - 56px);
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 999;
  left: 0;
  top: 56px;
}

.sidebar.mobile-hidden {
  transform: translateX(-100%);
}

/* Desktop: show sidebar by default */
@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0) !important;
    display: flex !important;
  }
  
  .sidebar.mobile-hidden {
    transform: translateX(0) !important;
    display: flex !important;
  }
  
  .content {
    margin-left: 250px;
  }
}

.sidebar .brand {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav {
  padding: 8px 6px;
  display: block;
  flex: 1;
}

.sidebar .nav .section-label {
  padding: 6px 12px;
  margin: 8px 0 4px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar .nav a {
  display: block;
  color: #e3f2fd;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.2;
  margin: 2px 0;
  transition: all 0.2s ease;
}

.sidebar .nav a i {
  width: 18px;
  margin-right: 8px;
  text-align: center;
}

.sidebar .nav a:hover,
.sidebar .nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 20px;
  margin-left: 250px;
  transition: margin-left 0.3s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  height: calc(100vh - 56px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.card {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.btn-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
}

.btn-outline-primary {
  color: var(--blue-600);
  border-color: var(--blue-600);
}

.badge.bg-primary {
  background: var(--blue-600) !important;
}

/* Dashboard tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Clickable tile styles */
.clickable-tile {
  cursor: pointer;
  position: relative;
}

.clickable-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.clickable-tile:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Action hint arrow */
.tile-action-hint {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--blue-600);
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 14px;
}

.clickable-tile:hover .tile-action-hint {
  opacity: 1;
  right: 8px;
}

/* Revenue tile (non-clickable) styling */
.revenue-tile {
  background: linear-gradient(135deg, var(--blue-100) 0%, #fff 100%);
  border: 2px solid var(--blue-200);
}

.revenue-tile .icon {
  background: var(--blue-600);
  color: #fff;
}

/* Pulse animation for today ribbon */
.tile .ribbon {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--blue-600);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px 4px 12px;
  border-bottom-left-radius: 12px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.tile .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-100);
  color: var(--blue-700);
}

.tile .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 10px;
  line-height: 1;
}

.tile .label {
  color: #6b7a90;
  font-size: 13px;
  margin-top: 4px;
}

.tile .ribbon {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--blue-600);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px 4px 12px;
  border-bottom-left-radius: 12px;
  animation: pulse 2s infinite;
}

/* Tables responsive */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table th {
  background: #f8f9fa;
  border-top: none;
  font-weight: 600;
  padding: 12px;
}

.table td {
  padding: 12px;
  vertical-align: middle;
}

/* Form controls */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #e0e6ed;
  padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

/* Responsive Design */
@media (max-width: 1199.98px) {
  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .tile .value {
    font-size: 24px;
  }
  
  /* Hide action hints on smaller screens */
  .tile-action-hint {
    display: none;
  }
  
  /* Improve dashboard layout on medium screens */
  .content {
    padding: 15px;
  }
  
  .tiles {
    gap: 12px;
  }
}

@media (max-width: 991.98px) {
  .topbar .mobile-menu-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-visible {
    transform: translateX(0);
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .content {
    margin-left: 0;
  }
  
  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  
  .tile {
    padding: 12px;
  }
  
  .tile .value {
    font-size: 20px;
  }
  
  .topbar .container {
    padding: 0 0.5rem;
  }
  
  /* Simplify quick actions on mobile */
  .card .card-body .d-flex.flex-wrap {
    flex-direction: column;
    gap: 8px;
  }
  
  .card .card-body .d-flex.flex-wrap .btn {
    margin-bottom: 4px;
  }
  
  /* Improve table responsiveness */
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .table th,
  .table td {
    padding: 8px;
  }
}

/* Medium screen improvements (12.5 inch screens) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .content {
    padding: 15px;
  }
  
  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
  }
  
  .tile {
    padding: 12px;
  }
  
  .tile .value {
    font-size: 22px;
  }
  
  .tile .icon {
    width: 40px;
    height: 40px;
  }
  
  /* Improve form layouts */
  .row .col-md-6,
  .row .col-md-4,
  .row .col-md-8,
  .row .col-md-12 {
    margin-bottom: 10px;
  }
  
  /* Adjust card spacing */
  .card {
    margin-bottom: 15px;
  }
  
  .card-body {
    padding: 15px;
  }
}

@media (max-width: 767.98px) {
  .content {
    padding: 15px;
  }
  
  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .tile {
    padding: 10px;
  }
  
  .tile .icon {
    width: 36px;
    height: 36px;
  }
  
  .tile .value {
    font-size: 18px;
    margin-top: 8px;
  }
  
  .tile .label {
    font-size: 12px;
  }
  
  .topbar {
    height: 48px;
  }
  
  .layout {
    min-height: calc(100vh - 48px);
  }
  
  .sidebar {
    height: calc(100vh - 48px);
  }
  
  .sidebar-overlay {
    top: 48px;
    height: calc(100vh - 48px);
  }
  
  /* Improve mobile navigation */
  .topbar .container {
    flex-wrap: nowrap;
  }
  
  .topbar .container > div:last-child {
    display: flex;
    gap: 10px;
  }
  
  .topbar .container > div:last-child > a {
    padding: 0 8px;
    font-size: 0.9rem;
  }
  
  /* Improve mobile forms */
  .form-control,
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
  
  .content {
    padding: 10px;
  }
  
  .topbar .container {
    flex-wrap: wrap;
  }
  
  .topbar .container > div:last-child {
    display: none;
  }
  
  /* Improve mobile card layouts */
  .card-body {
    padding: 12px;
  }
  
  .d-flex.flex-wrap {
    flex-direction: column;
    gap: 8px;
  }
  
  .d-flex.flex-wrap .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tiles {
    grid-template-columns: 1fr;
  }
  
  .tile {
    text-align: center;
  }
  
  .tile .d-flex {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  /* Improve very small screen layouts */
  .content {
    padding: 8px;
  }
  
  .card {
    margin-bottom: 10px;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .topbar,
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  
  .tile {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Logo Enhancement Styles */
.navbar-brand img,
.topbar img,
.sidebar img,
.footer img {
  min-height: 48px !important;
  max-height: 72px !important;
  width: auto !important;
  transition: all 0.3s ease;
}

/* Main navigation logo - larger for prominence */
.navbar-brand img {
  height: 65px !important;
}

/* Topbar logo for authenticated users */
.topbar img {
  height: 48px !important;
}

/* Footer logo */
.footer img {
  height: 42px !important;
}

/* Admin sidebar logo */
.sidebar .brand img {
  height: 50px !important;
}

/* Login/Register page logos - keep them larger for branding */
.login-header img,
.card-body img[alt*="logo"],
.text-center img[alt*="logo"] {
  height: 90px !important;
  max-height: 100px !important;
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
  .navbar-brand img {
    height: 55px !important;
  }
  
  .topbar img {
    height: 42px !important;
  }
  
  .login-header img,
  .card-body img[alt*="logo"],
  .text-center img[alt*="logo"] {
    height: 75px !important;
  }
}

@media (max-width: 480px) {
  .navbar-brand img {
    height: 48px !important;
  }
  
  .topbar img {
    height: 38px !important;
  }
}

/* Enhanced Logo Styling */
.logo-enhanced {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.logo-enhanced:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15)) brightness(1.05);
}

/* Logo container improvements */
.navbar-brand {
  padding: 0.25rem 0;
}

.navbar-brand .logo-enhanced {
  margin-right: 8px;
}

/* Ensure logos are crisp on retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-enhanced {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Activity Page Specific Styles */
.activity-type-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.activity-details {
  max-width: 300px;
  word-wrap: break-word;
}

.activity-timestamp {
  font-size: 0.85rem;
  color: #6c757d;
}

.activity-row:hover {
  background-color: #f8f9fa !important;
  transition: background-color 0.2s ease;
}

.badge-activity {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Activity meta data formatting */
.activity-meta {
  font-size: 0.8rem;
  line-height: 1.3;
}

.activity-meta div {
  margin-bottom: 2px;
}

.activity-meta strong {
  color: #495057;
  font-weight: 600;
}

/* Client cards payment status */
.card.border-success {
  border-width: 2px !important;
  border-color: #198754 !important;
}

.payment-status-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* Modal improvements */
.modal-header.bg-success .btn-close-white {
  filter: brightness(0) invert(1);
}

.modal-body .alert {
  margin-bottom: 1rem;
}

.upgrade-info {
  background-color: #f8f9fa;
  border-left: 4px solid #0d6efd;
  padding: 1rem;
  margin: 1rem 0;
}

/* Payment verification styles */
.payment-verified {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid #28a745;
}

.payment-pending {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 1px solid #ffc107;
}

/* Vendor dashboard specific improvements */
.vendor-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 1199.98px) {
  .vendor-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 991.98px) {
  .vendor-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 767.98px) {
  .vendor-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .vendor-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Improve product listing on vendor dashboard */
.product-listing-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.product-listing-item:last-child {
  border-bottom: none;
}

.product-listing-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 15px;
}

.product-listing-info {
  flex: 1;
}

.product-listing-actions {
  display: flex;
  gap: 5px;
}

@media (max-width: 767.98px) {
  .product-listing-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .product-listing-image {
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .product-listing-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Improve order listing on vendor dashboard */
.order-listing-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.order-listing-item:last-child {
  border-bottom: none;
}

.order-listing-info {
  flex: 1;
}

.order-listing-status {
  min-width: 100px;
  text-align: right;
}

@media (max-width: 767.98px) {
  .order-listing-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .order-listing-status {
    width: 100%;
    text-align: left;
    margin-top: 10px;
  }
}