/* ===================================
   ReferView - Main Stylesheet
   =================================== */

/* CSS Variables */
:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #818CF8;
  --primary-bg: #EEF2FF;
  --accent: #10B981;
  --accent-dark: #059669;
  --accent-light: #6EE7B7;
  --accent-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-dark: #D97706;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --dark: #0F172A;
  --dark-2: #1E293B;
  --dark-3: #334155;
  --gray-500: #64748B;
  --gray-400: #94A3B8;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50: #F8FAFC;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
  --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.15);
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { color: var(--gray-500); }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  color: var(--dark-3);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark-3);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  z-index: 999;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  color: var(--dark-3);
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}

.mobile-nav a:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.mobile-nav .mobile-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: var(--warning-dark);
  transform: translateY(-1px);
}

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

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--gray-500);
  background: transparent;
  border: 1px solid var(--gray-300);
}

.btn-ghost:hover {
  color: var(--dark);
  border-color: var(--gray-400);
  background: var(--gray-50);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-xl {
  padding: 1.125rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 14px;
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-full { width: 100%; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-verified {
  background: var(--accent-bg);
  color: var(--accent-dark);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-primary {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-dark);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-dark {
  background: var(--dark-3);
  color: white;
}

/* Reputation badges */
.rep-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.rep-bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.rep-silver { background: linear-gradient(135deg, #C0C0C0, #A8A9AD); color: white; }
.rep-gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #5C4000; }
.rep-platinum { background: linear-gradient(135deg, #E5E4E2, #BCC6CC); color: #333; }

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}

/* ===== STATS ===== */
.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* ===== STAR RATING ===== */
.stars {
  display: inline-flex;
  gap: 2px;
}

.stars i {
  color: var(--warning);
  font-size: 0.875rem;
}

.stars i.empty {
  color: var(--gray-300);
}

/* ===== TIMER ===== */
.timer-component {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timer-digits {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-number {
  background: var(--dark);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 1.25rem;
  min-width: 2.5rem;
  text-align: center;
}

.timer-label {
  font-size: 0.6rem;
  color: var(--gray-500);
  margin-top: 0.1rem;
}

.timer-colon {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.progress-fill.warning {
  background: linear-gradient(90deg, var(--warning), #FCD34D);
}

/* ===== STATUS INDICATORS ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--accent); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3); }
.status-dot.pending { background: var(--warning); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.danger { background: var(--danger); }

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--dark-3);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--dark);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-control.error {
  border-color: var(--danger);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), var(--shadow-lg);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  color: var(--dark);
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--gray-400);
}

.search-bar .search-btn {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  margin: 0.375rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-bar .search-btn:hover {
  background: var(--primary-dark);
}

/* ===== EMPLOYEE CARD ===== */
.employee-card {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.employee-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.employee-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.employee-card:hover::before {
  transform: scaleX(1);
}

.employee-card .avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-xl {
  width: 100px;
  height: 100px;
}

.avatar-verified {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-verified i {
  font-size: 8px;
  color: white;
}

.company-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.625rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dark-3);
}

.company-badge img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 0.35rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-title {
  color: var(--dark);
  margin-bottom: 1rem;
}

.section-title span {
  color: var(--primary);
  position: relative;
}

.section-desc {
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  color: var(--gray-500);
}

/* ===== STEP INDICATOR ===== */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--gray-300);
  color: var(--gray-400);
  background: white;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.step.completed .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
  margin-top: 0.5rem;
  text-align: center;
}

.step.active .step-label {
  color: var(--primary);
}

.step.completed .step-label {
  color: var(--accent);
}

.step-line {
  height: 2px;
  flex: 1;
  background: var(--gray-300);
  margin: 0 -1px;
  position: relative;
  top: -10px;
}

.step-line.completed {
  background: var(--accent);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark);
  color: var(--gray-400);
  padding: 4rem 0 2rem;
}

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

.footer-brand .logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--gray-400);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: var(--transition);
  font-size: 0.9rem;
}

.footer-social a:hover {
  background: var(--primary);
  color: white;
}

.footer-col h5 {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--gray-400);
  font-size: 0.875rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 3px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 11000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--primary);
  min-width: 300px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

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

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--accent-bg); color: var(--accent); }
.toast.warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast.error .toast-icon { background: var(--danger-bg); color: var(--danger); }

.toast-content .toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark);
}

.toast-content .toast-msg {
  font-size: 0.8rem;
  color: var(--gray-500);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

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

.modal-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1.2rem; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-100);
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--dark);
}

.modal-body {
  padding: 1.5rem;
}

/* ===== UTILITY ===== */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-gray { color: var(--gray-500) !important; }
.text-dark { color: var(--dark) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.hidden { display: none; }

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

.animate-fadeInUp { animation: fadeInUp 0.6s ease both; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
  .btn-xl { padding: 1rem 1.75rem; font-size: 1rem; }
  .section { padding: 2.75rem 0; }
  .modal { width: 94%; }
  .modal-header { padding: 1.25rem 1.25rem 0; }
  .modal-body { padding: 1.25rem; }
}

/* ===== MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
  /* Collapse equal-column inline grids that stylesheets cannot otherwise reach */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce oversized gaps on inline grids for narrow screens */
  [style*="gap:4rem"], [style*="gap: 4rem"],
  [style*="gap:5rem"], [style*="gap: 5rem"] {
    gap: 2rem !important;
  }

  /* Modals never exceed the viewport */
  .modal { max-height: 90vh; overflow-y: auto; }

  /* Comfortable touch targets */
  .btn, .nav-actions .btn, .search-btn { min-height: 44px; }
}

@media (max-width: 600px) {
  /* On phones the header relies on the hamburger menu; hide the
     duplicate action buttons but keep the hamburger itself visible. */
  .nav-actions .btn { display: none; }
  .nav-inner { gap: 1rem; }
  .nav-logo { font-size: 1.2rem; }

  /* Stack the hero / inline search bar so the button isn't squeezed */
  .hero-search .search-bar,
  .search-bar { flex-wrap: wrap; border-radius: 16px; }
  .search-bar input { flex: 1 0 100%; padding: 0.875rem 1.25rem; }
  .search-bar .search-btn { flex: 1 0 100%; margin: 0 0.375rem 0.375rem; justify-content: center; }

  /* Tame heavy section / hero padding */
  .hero-inner, .hero { padding-top: 3.5rem !important; padding-bottom: 2.5rem !important; }
}

/* Let any wide table scroll horizontally instead of breaking the layout */
@media (max-width: 768px) {
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
