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

/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-tertiary: #F1F4F9;
  --bg-card: #FFFFFF;
  
  --text-primary: #1A1D20;
  --text-secondary: #333333;
  --text-muted: #64748B;
  
  --accent-primary: #0066CC;
  --accent-hover: #0052A3;
  --accent-light: #EBF4FC;
  --accent-dark: #0B3B60;
  
  --border: #E5E7EB;
  --border-focus: #0066CC;
  --border-card: #EAEFF5;
  
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #DC2626;
  --error-light: #FEE2E2;

  /* Typography */
  --font-primary: 'Poppins', sans-serif;

  /* Radius Scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 16px rgba(11, 59, 96, 0.06), 0 1px 3px rgba(11, 59, 96, 0.04);
  --shadow-hover: 0 12px 30px rgba(0, 102, 204, 0.12), 0 4px 10px rgba(0, 102, 204, 0.06);
  --shadow-modal: 0 20px 45px rgba(11, 59, 96, 0.2);

  /* Layout Spacing */
  --max-width: 1200px;
  --header-height: 76px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* Strict Poppins Enforcement */
h1, h2, h3, h4, h5, h6,
p, span, a, button, input, select, textarea, label {
  font-family: var(--font-primary) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.18;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
}

h3 {
  font-size: 1.35rem;
  font-weight: 600;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

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

a:hover {
  color: var(--accent-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   LAYOUT CONTAINERS & HELPERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.section-secondary {
  background-color: var(--bg-secondary);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  background-color: var(--accent-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  user-select: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #FFFFFF !important;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.28);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--accent-primary) !important;
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  background-color: var(--accent-light);
  color: var(--accent-primary) !important;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary);
}

.btn-outline:hover {
  background-color: var(--accent-light);
  color: var(--accent-hover) !important;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 10px 16px;
}

.btn-ghost:hover {
  background-color: var(--bg-secondary);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   GLOBAL NAVBAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: box-shadow var(--transition-fast);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo img,
.brand-logo svg {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: 6px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.fav-link:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.fav-badge {
  background-color: var(--accent-primary);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(-120%);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 999;
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer .nav-link {
  font-size: 1.05rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  background-color: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background-color: #FFFFFF;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border);
  font-size: 0.925rem;
  font-weight: 500;
  max-width: 380px;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

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

.toast-info .toast-icon {
  color: var(--accent-primary);
}

.toast-error .toast-icon {
  color: var(--error);
}

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

.toast.hiding {
  opacity: 0;
  transform: translateY(10px);
}

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 59, 96, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

.modal-box {
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-icon-danger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--error-light);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background-color: #FFFFFF;
  border-top: 1px solid var(--border);
  padding-top: 64px;
  padding-bottom: 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
  margin-top: 16px;
  max-width: 320px;
}

.footer-column h4 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
