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

/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9fb;
  --bg-tertiary: #f1f3f5;
  
  --text-primary: #111115;
  --text-secondary: #575765;
  --text-muted: #8d8d9d;
  
  --accent: #4f46e5; /* Vibrant Electric Indigo */
  --accent-light: #818cf8;
  --accent-hover: #3730a3;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.05);
  
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 8px 30px rgba(79, 70, 229, 0.15);
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Layout */
  --max-width: 1400px;
  --header-height: 80px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   CSS RESET & BASICS
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-gold {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   GLOBAL COMPONENTS & STYLES
   ========================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-2px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background-color: rgba(214, 175, 87, 0.15);
  color: var(--accent);
  border: 1px solid rgba(214, 175, 87, 0.3);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-danger {
  background-color: rgba(239, 68, 110, 0.15);
  color: var(--danger);
}

/* Container */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Status Messages (Toast) */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  padding: 16px 24px;
  background-color: var(--bg-tertiary);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  animation: slideIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================
   GLOBAL MODALS OVERLAY & LAYOUT (SHARED)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-height));
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: var(--transition-normal);
}

/* Custom scrollbar to prevent sharp track corners and match theme */
.modal-container::-webkit-scrollbar {
  width: 8px;
}

.modal-container::-webkit-scrollbar-track {
  background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: var(--radius-full);
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-secondary);
  border-top-left-radius: calc(var(--radius-md) - 1px);
  border-top-right-radius: calc(var(--radius-md) - 1px);
}

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-close {
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 32px;
}

.modal-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  background-color: var(--bg-secondary);
  border-bottom-left-radius: calc(var(--radius-md) - 1px);
  border-bottom-right-radius: calc(var(--radius-md) - 1px);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================
   MULTI-LANGUAGE SELECTOR DROPDOWN & WELCOME MODAL
   ========================================== */
.lang-selector-wrapper {
  position: relative;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  min-width: 150px;
  z-index: 1000;
  overflow: hidden;
}

.lang-dropdown.active {
  display: flex;
}

.lang-option-btn {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
}

.lang-option-btn:last-child {
  border-bottom: none;
}

.lang-option-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent);
}

.lang-option-btn.active {
  color: var(--accent);
  font-weight: 600;
  background-color: rgba(214, 175, 55, 0.03);
}

.welcome-lang-btn {
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

/* Mobile responsive adjustments for shared style elements */
@media (max-width: 768px) {
  :root {
    --header-height: 64px; /* Mobile navbar is shorter */
  }
}

@media (max-width: 576px) {
  .modal-container {
    width: calc(100% - 24px);
    max-height: 92vh;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px 16px;
  }
  
  .modal-footer {
    padding: 16px 20px;
  }
  
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  
  .toast {
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* Quick View: full-screen on mobile, aligned to top */
  #quickViewModal {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

/* ==========================================
   UTILITY ANIMATIONS
   ========================================== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Focus visible ring for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
