/* ==========================================================================
   CAREER 720 - Institute Review Platform Stylesheet & Design Tokens
   Tailwind CSS is loaded via CDN; this file provides enhanced glassmorphism,
   animations, floating compare docks, and modal transitions.
   ========================================================================== */

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --secondary: #ea580c;
  --accent: #059669;
  --dark: #0f172a;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

/* Hero Gradient & Patterns */
.hero-gradient {
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 50%),
              radial-gradient(circle at 90% 80%, rgba(234, 88, 12, 0.06) 0%, rgba(248, 250, 252, 0) 50%);
}

.badge-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.badge-featured {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Floating Compare Dock */
#compare-dock {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

#compare-dock.hidden-dock {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

#compare-dock.visible-dock {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Pulse Animation for Live Leads / Consultations */
@keyframes soft-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

.pulse-soft {
  animation: soft-pulse 3s infinite ease-in-out;
}

/* Differences Highlight in Compare Matrix */
.diff-highlight {
  background-color: #fef3c7 !important;
  border-left: 3px solid #f59e0b !important;
}

/* Star Rating Hover Effects */
.star-rating label {
  cursor: pointer;
  transition: color 0.15s ease;
}
.star-rating:hover label {
  color: #fbbf24;
}
.star-rating label:hover ~ label {
  color: #d1d5db;
}

/* Smooth Tab Underline */
.tab-active {
  color: #1d4ed8 !important;
  border-bottom: 2px solid #1d4ed8 !important;
  font-weight: 600 !important;
}

/* Modal Transitions */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-enter {
  animation: modalEnter 0.25s ease-out forwards;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Horizontal Touch Momentum Scrolling */
.touch-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

/* ==========================================================================
   Comprehensive Mobile & Touch Optimizations (All Viewports: 320px - 768px)
   ========================================================================== */

/* Prevent iOS Safari Automatic Zoom on Focus */
@media screen and (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important; /* Critical: Prevents iOS auto-zoom */
    line-height: 1.4 !important;
  }
}

/* Global Responsive Base */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}

/* Touch Targets: minimum 44px for primary interactive elements */
.tap-target {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Sticky Comparison Column */
.compare-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

@media (max-width: 768px) {
  .compare-sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 20 !important;
    background-color: #ffffff !important;
    box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.08) !important;
  }
  
  .compare-sticky-header {
    position: sticky !important;
    left: 0 !important;
    z-index: 25 !important;
    background-color: #f8fafc !important;
    box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.08) !important;
  }
}

/* Mobile Floating Compare Dock */
@media (max-width: 640px) {
  #compare-dock {
    width: calc(100% - 1rem) !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    border-radius: 1rem !important;
    padding: 0.75rem !important;
  }
  
  #compare-dock.hidden-dock {
    transform: translateY(160%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #compare-dock.visible-dock {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Compact Hero Spacing */
  .hero-compact {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
  }

  /* Compact Institute Card Action Bar */
  .inst-card-actions {
    grid-template-columns: 1fr 1.2fr !important;
    gap: 0.375rem !important;
  }
}

/* Drawer Backdrop Overlay */
#mobile-drawer-backdrop {
  transition: opacity 0.25s ease-in-out;
}

/* Safe Area Inset Support for Modern iOS / Android Devices */
.safe-pb {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* Compact UI & Enhanced Mobile Polish */
.compact-card {
  padding: 1rem !important;
  border-radius: 1rem !important;
}

@media (max-width: 768px) {
  .compact-card {
    padding: 0.875rem !important;
  }
}

.tight-leading {
  line-height: 1.25 !important;
}

.compact-badge {
  padding: 0.125rem 0.5rem !important;
  font-size: 0.65rem !important;
}

/* Mobile Friendly Table Wrappers */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: 1rem;
}

/* Print optimizations for comparison matrix */
@media print {
  header, footer, #compare-dock, .no-print, #mobile-drawer, #mobile-drawer-backdrop {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .print-full-width {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

