:root {
  /* Color Palette (Premium Dark Theme) */
  --bg-color: #020617; /* Slate 950 (Plus sombre pour le fond) */
  --bg-surface: #1E293B; /* Slate 800 (Zone de travail) */
  --bg-surface-glass: rgba(30, 41, 59, 0.85); /* Plus opaque pour mieux ressortir */
  
  --primary: #8B5CF6; /* Violet 500 */
  --primary-hover: #7C3AED;
  --primary-light: rgba(139, 92, 246, 0.15);
  
  --secondary: #EC4899; /* Pink 500 */
  --accent: #F59E0B; /* Amber 500 */
  --success: #10B981; /* Emerald 500 */
  --danger: #EF4444; /* Red 500 */
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
  
  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  
  /* Effects */
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --blur-glass: blur(12px);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

[data-theme="light"] {
  --bg-color: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-glass: rgba(255, 255, 255, 0.8);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
}

button {
  font-family: var(--font-body);
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
}

/* Utilities */
.hidden { display: none !important; }
.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
}
.glass-panel-lg {
  border-radius: var(--radius-lg);
}
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* App Container */
#app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 80px; /* Space for bottom nav */
}

/* Global Background Decoration */
#app-container::before {
  content: '';
  position: fixed;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--primary);
  filter: blur(100px);
  opacity: 0.2;
  z-index: -1;
}
#app-container::after {
  content: '';
  position: fixed;
  bottom: -100px;
  left: -50px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--secondary);
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
}

/* View Container */
.view-container {
  flex: 1;
  width: 100%;
  max-width: 600px; /* Mobile optimal width constraints */
  margin: 0 auto;
  padding: 20px;
  animation: fadeIn 0.4s ease forwards;
}

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

/* Loader */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.loader {
  text-align: center;
  color: var(--primary);
}
.loader span.material-symbols-rounded {
  font-size: 48px;
  animation: pulse 1.5s infinite;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.loader p {
  margin-top: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(15, 23, 42, 0.85); /* Slightly darker for contrast */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 600px) {
  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 4px;
  padding: 8px;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
  width: 64px;
}

.nav-item span.material-symbols-rounded {
  font-size: 24px;
  transition: var(--transition-fast);
}

.nav-item span:not(.material-symbols-rounded) {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active span.material-symbols-rounded {
  font-variation-settings: 'FILL' 1;
  transform: translateY(-2px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Bottom sheet on mobile */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

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

.modal-content {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-fast);
  width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-secondary {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Form Elements */
.input-group {
  margin-bottom: 20px;
}
.input-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}
.input-field {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: var(--transition-fast);
}
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0,0,0,0.3);
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-express {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.badge-grand {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

/* Sections */
.section-title {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .material-symbols-rounded {
  color: var(--primary);
}

/* Text Center Utility */
.text-center {
  text-align: center;
}

/* Disabled Button */
.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Select Styling */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2394A3B8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* "More" popup menu */
.more-menu {
  position: absolute;
  bottom: 78px;
  right: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
  padding: 8px;
  min-width: 200px;
  z-index: 200;
  animation: slideUpMenu 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.more-menu-item:hover,
.more-menu-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.more-menu-item .material-symbols-rounded {
  font-size: 20px;
  color: var(--text-secondary);
}

/* Action Cards (Dashboard) */
.action-card:hover {
  transform: translateY(-2px);
}
.action-card:active {
  transform: scale(0.97);
}

/* Vendor Action Button */
.vendor-action-btn:hover {
  background: rgba(16, 185, 129, 0.2) !important;
}

/* Guest item hover */
.guest-item:hover,
.task-item:hover,
.expense-item:hover,
.vendor-card:hover {
  border-color: var(--primary);
}

/* Fade in animation class */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Textarea resize */
textarea.input-field {
  resize: vertical;
  min-height: 60px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Touch ripple effect (subtle) */
@keyframes ripple {
  from { transform: scale(0); opacity: 0.4; }
  to { transform: scale(4); opacity: 0; }
}
