@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700;800&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --royal-blue: #4c63d2;
  --royal-purple: #7c3aed;
  --royal-gold: #f59e0b;
  --royal-silver: #6b7280;
  --sidebar-width: 320px;
  --header-height: 80px;
}

* {
  font-family: 'Alexandria', sans-serif;
  box-sizing: border-box;
  font-size: 15px;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  font-size: 15px;
}

/* Font Size Standardization */
p, span, div, a, button, input, textarea, select, label, td, th, li {
  font-size: 15px !important;
}

h1 {
  font-size: 15px !important;
  font-weight: bold;
}

h2 {
  font-size: 15px !important;
  font-weight: bold;
}

h3 {
  font-size: 15px !important;
  font-weight: bold;
}

h4 {
  font-size: 15px !important;
  font-weight: bold;
}

h5 {
  font-size: 15px !important;
  font-weight: bold;
}

h6 {
  font-size: 15px !important;
  font-weight: bold;
}

/* Icon sizes to match text */
i {
  font-size: 15px !important;
}

/* Specific overrides for larger elements that need to stay 15px */
.text-xs {
  font-size: 15px !important;
}

.text-sm {
  font-size: 15px !important;
}

.text-base {
  font-size: 15px !important;
}

.text-lg {
  font-size: 15px !important;
}

.text-xl {
  font-size: 15px !important;
}

.text-2xl {
  font-size: 15px !important;
}

.text-3xl {
  font-size: 15px !important;
}

.text-4xl {
  font-size: 15px !important;
}

/* RTL Specific Styles */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
  margin-right: calc(1rem * var(--tw-space-x-reverse));
  margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]) {
  margin-right: calc(0.75rem * var(--tw-space-x-reverse));
  margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) {
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-6 > :not([hidden]) ~ :not([hidden]) {
  margin-right: calc(1.5rem * var(--tw-space-x-reverse));
  margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Royal Card Styles */
.royal-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.royal-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 35px 70px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Gradient Buttons */
.btn-royal-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-royal-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn-royal-secondary {
  background: var(--secondary-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(240, 147, 251, 0.3);
}

.btn-royal-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(240, 147, 251, 0.4);
}

/* Sidebar Styles */
.royal-sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: right 0.5s;
}

.sidebar-link:hover::before {
  right: 100%;
}

.sidebar-link:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  transform: translateX(-8px);
  border-right: 4px solid var(--royal-gold);
}

/* Stats Cards */
.stats-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.stats-card:hover {
  transform: translateY(-10px) rotateX(5deg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Table Styles */
.royal-table {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.royal-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  padding: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.royal-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease;
}

.royal-table tr:hover td {
  background-color: rgba(102, 126, 234, 0.05);
}

/* Header Styles */
.royal-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

/* Header Mobile Responsive */
@media (max-width: 768px) {
  .royal-header {
    padding: 0 0.75rem;
    height: 70px;
  }
  
  .royal-header .flex {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Logo section mobile */
  .royal-header .logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }
  
  .royal-header .logo-section h1 {
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .royal-header .logo-section p {
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .royal-header .logo-section .w-12 {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
  }
  
  /* User section mobile */
  .royal-header .user-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  
  .royal-header .user-section .hidden.md\\:block {
    display: none !important;
  }
  
  .royal-header .user-section button {
    padding: 0.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
  }
  
  .royal-header .user-section .notification-badge {
    width: 16px;
    height: 16px;
    font-size: 10px !important;
    top: -6px;
    right: -6px;
  }
  
  /* Menu toggle button */
  .royal-header #menuToggle {
    padding: 0.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    margin-left: 0;
    margin-right: 0.5rem;
  }
  
    
  /* User profile compact */
  .royal-header .user-profile {
    padding: 0.25rem;
    gap: 0.5rem;
  }
  
  .royal-header .user-profile .w-10 {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }
}

@media (max-width: 480px) {
  .royal-header {
    padding: 0 0.5rem;
    height: 65px;
  }
  
  .royal-header .logo-section h1 {
    font-size: 12px !important;
  }
  
  .royal-header .logo-section p {
    display: none;
  }
  
  .royal-header .user-section {
    gap: 0.25rem;
  }
  
  .royal-header .user-section button {
    padding: 0.375rem;
    min-width: 2.25rem;
    height: 2.25rem;
  }
  
  .royal-header .user-profile {
    padding: 0.125rem;
  }
  
  .royal-header .user-profile .w-10 {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
  }
}

/* Login Page Styles */
.login-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,0 1000,300 1000,1000 0,700"/></svg>');
  background-size: cover;
}

.login-form {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Input Styles */
.royal-input {
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.royal-input:focus {
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
  background: white;
}

/* Notification Badge */
.notification-badge {
  background: var(--secondary-gradient);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px !important;
  font-weight: 700;
  position: absolute;
  top: -8px;
  right: -8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Chart Container */
.chart-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* WhatsApp Professional Button */
.whatsapp-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.whatsapp-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.whatsapp-btn:hover::before {
  opacity: 1;
}

.whatsapp-btn:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 25px 50px rgba(37, 211, 102, 0.6);
}

.whatsapp-btn:active {
  transform: scale(1.05);
}

.whatsapp-btn i {
  font-size: 28px !important;
  color: white;
  z-index: 2;
  position: relative;
  transition: transform 0.3s ease;
}

.whatsapp-btn:hover i {
  transform: scale(1.1);
}

/* WhatsApp Pulse Animation */
.whatsapp-btn::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid rgba(37, 211, 102, 0.6);
  border-radius: 50%;
  animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* WhatsApp Tooltip */
.whatsapp-tooltip {
  position: absolute;
  right: 85px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px !important;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.whatsapp-tooltip::before {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.9);
}

.whatsapp-btn:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-10px);
}

/* WhatsApp Stats Card Enhancement */
.whatsapp-stats-card {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.whatsapp-stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transform: rotate(45deg);
}

.whatsapp-stats-card i {
  position: relative;
  z-index: 2;
}

/* WhatsApp Quick Action Button */
.whatsapp-quick-action {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 16px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
  position: relative;
  overflow: hidden;
}

.whatsapp-quick-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.whatsapp-quick-action:hover::before {
  left: 100%;
}

.whatsapp-quick-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
}

/* WhatsApp Sidebar Link Enhancement */
.whatsapp-sidebar-link {
  position: relative;
}

.whatsapp-sidebar-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: #25D366;
  border-radius: 2px;
  transition: height 0.3s ease;
}

.whatsapp-sidebar-link:hover::after {
  height: 60%;
}

/* Mobile Responsive WhatsApp Button */
@media (max-width: 768px) {
  .whatsapp-btn {
    width: 60px;
    height: 60px;
    bottom: 20px;
    left: 20px;
  }
  
  .whatsapp-btn i {
    font-size: 24px !important;
  }
  
  .whatsapp-tooltip {
    display: none;
  }
}

/* WhatsApp Notification Dot */
.whatsapp-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px !important;
  font-weight: 700;
  color: white;
  border: 3px solid white;
  animation: notification-bounce 2s infinite;
}

@keyframes notification-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}


/* Loading Animation */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top: 4px solid var(--royal-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Layout Fixes */
.main-container {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  margin-left: 0;
  transition: margin-left 0.3s ease;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }
  
  .main-container {
    padding-top: 70px;
  }
  
  .royal-sidebar {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 65px;
  }
  
  .main-container {
    padding-top: 65px;
  }
  
  .royal-sidebar {
    top: 65px !important;
    height: calc(100vh - 65px) !important;
  }
}

/* Desktop Layout - RTL */
@media (min-width: 1024px) {
  .main-content {
    margin-right: var(--sidebar-width);
    margin-left: 0;
  }
  
  .royal-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: auto;
    height: calc(100vh - var(--header-height));
    transform: translateX(0);
    z-index: 30;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }
}

/* Mobile and Tablet Layout - RTL */
@media (max-width: 1023px) {
  .royal-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: auto;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 40;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  }
  
  .royal-sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-right: 0;
    margin-left: 0;
    padding: 1rem;
  }
  
  .stats-card:hover {
    transform: translateY(-5px);
  }
  
  /* Header adjustments for mobile */
  .royal-header {
    padding: 0.75rem 1rem;
  }
  
  .royal-header .hidden.md\\:block {
    display: none !important;
  }
  
  /* Table responsive */
  .royal-table {
    overflow-x: auto;
  }
  
  .royal-table table {
    min-width: 600px;
  }
  
  /* Cards grid responsive */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  @media (min-width: 640px) {
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem;
  }
  
  .royal-sidebar {
    width: 280px;
  }
  
  .royal-card {
    padding: 1rem;
  }
  
  .stats-card {
    padding: 1rem;
  }
  
  .chart-container {
    padding: 1rem;
  }
  
  /* Button adjustments - keep 15px font size */
  .btn-royal-primary,
  .btn-royal-secondary {
    padding: 10px 16px;
    font-size: 15px !important;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 35;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Header height fix */
.royal-header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

/* Sidebar scrolling */
.royal-sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

.royal-sidebar::-webkit-scrollbar {
  width: 4px;
}

.royal-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.royal-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* Fix for sidebar links on mobile */
@media (max-width: 1023px) {
  .sidebar-link:hover {
    transform: translateX(4px);
  }
}

/* Ensure proper spacing */
.page-content {
  padding-top: 1rem;
}

/* Fix for dropdown menus on mobile */
@media (max-width: 768px) {
  .group:hover .group-hover\\:opacity-100 {
    opacity: 1;
    visibility: visible;
  }
  
  .group:hover .group-hover\\:visible {
    visibility: visible;
  }
}

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/* Glass Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Royal Footer */
.royal-footer {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 24px 0;
  margin-top: auto;
}

/* Recent Orders Section - Modern Design */
.recent-orders-section {
  margin-bottom: 2rem;
}

.orders-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.3);
}

.orders-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="70" r="1.2" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 100px 100px;
  animation: float-pattern 20s linear infinite;
}

@keyframes float-pattern {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-100px) translateY(-100px); }
}

.orders-controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.filter-btn {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 15px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.1), transparent);
  transition: left 0.5s;
}

.filter-btn:hover::before {
  left: 100%;
}

.filter-btn:hover {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.filter-btn.active:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(79, 70, 229, 0.5);
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.order-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.order-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.order-card:hover::before {
  opacity: 1;
}

.order-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border-color: rgba(79, 70, 229, 0.3);
}

.order-card .card-header {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 1rem;
}

.order-card[data-status="processing"] .card-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.order-card[data-status="cancelled"] .card-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.order-card .card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="20" r="0.8" fill="rgba(255,255,255,0.1)"/><circle cx="20" cy="40" r="0.6" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: 50px 50px;
  animation: header-pattern 15s linear infinite;
}

@keyframes header-pattern {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-50px) translateY(-50px); }
}

.status-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 12px !important;
  font-weight: 600;
  color: white;
}

.order-card .card-body {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.order-card .customer-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px !important;
  color: white;
  margin-left: 0.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.order-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.order-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.order-detail-item:last-child {
  border-bottom: none;
}

.order-detail-label {
  display: flex;
  align-items: center;
  color: #6b7280;
  font-size: 15px !important;
  gap: 0.5rem;
}

.order-detail-value {
  font-weight: 600;
  color: #1f2937;
  font-size: 15px !important;
}

.order-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.order-actions button {
  border: none;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 15px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.order-actions button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.order-actions button:hover::before {
  left: 100%;
}

.order-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.order-actions button:active {
  transform: translateY(0);
}

.load-more-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 15px !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
  position: relative;
  overflow: hidden;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.load-more-btn:hover::before {
  left: 100%;
}

.load-more-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(79, 70, 229, 0.4);
}

.load-more-btn:active {
  transform: translateY(-1px) scale(1.02);
}

/* Progress Bar Animation */
.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  height: 0.5rem;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-fill {
  background: white;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive Design for Orders Section */
@media (max-width: 1200px) {
  .orders-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .orders-header {
    padding: 1.5rem;
    text-align: center;
  }
  
  .orders-header .hidden.lg\\:flex {
    display: none !important;
  }
  
  .orders-controls {
    padding: 1rem;
  }
  
  .orders-controls .flex.flex-col.lg\\:flex-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 14px !important;
  }
  
  .orders-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .order-card {
    margin: 0;
  }
  
  .order-card .card-header {
    padding: 0.75rem;
  }
  
  .order-card .card-body {
    padding: 1rem;
  }
  
  .order-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .order-actions button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .orders-header {
    padding: 1rem;
  }
  
  .orders-header h3 {
    font-size: 15px !important;
  }
  
  .orders-controls {
    padding: 0.75rem;
  }
  
  .filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 13px !important;
  }
  
  .order-card .customer-avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 14px !important;
  }
  
  .load-more-btn {
    padding: 0.5rem 1.5rem;
    font-size: 14px !important;
  }
}

/* Search Input Styling */
#ordersSearch {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 15px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  max-width: 24rem;
}

#ordersSearch:focus {
  outline: none;
  border-color: #4f46e5;
  background: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

#ordersSearch::placeholder {
  color: #9ca3af;
  font-size: 15px !important;
}

/* Animation for order cards on load */
.order-card {
  animation: slideInUp 0.6s ease-out;
}

.order-card:nth-child(1) { animation-delay: 0.1s; }
.order-card:nth-child(2) { animation-delay: 0.2s; }
.order-card:nth-child(3) { animation-delay: 0.3s; }
.order-card:nth-child(4) { animation-delay: 0.4s; }
.order-card:nth-child(5) { animation-delay: 0.5s; }
.order-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Status-specific styling */
.order-card[data-status="completed"] .order-detail-value.amount {
  color: #10b981;
}

.order-card[data-status="processing"] .order-detail-value.amount {
  color: #f59e0b;
}

.order-card[data-status="cancelled"] .order-detail-value.amount {
  color: #ef4444;
  text-decoration: line-through;
}

/* Hover effects for interactive elements */
.order-card .customer-info:hover .customer-avatar {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.order-detail-item:hover {
  background: rgba(79, 70, 229, 0.05);
  border-radius: 0.5rem;
  margin: 0 -0.5rem;
  padding: 0.5rem;
}

/* Loading state for orders */
.orders-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.orders-loading .loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(79, 70, 229, 0.2);
  border-top: 4px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Empty state */
.orders-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.orders-empty i {
  font-size: 4rem !important;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.orders-empty h3 {
  font-size: 15px !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.orders-empty p {
  font-size: 15px !important;
  color: #6b7280;
}