/* Modern Design System Tokens - Professional Educational Theme */
:root {
  /* Brand Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #475569;
  --accent: #0ea5e9;

  /* Backgrounds */
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #ffffff;

  /* Functional */
  --success: #10b981;
  --error: #ef4444;

  /* Shadows - Optimized */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  --shadow-3d:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 2rem;

  /* Performance-optimized transitions */
  --transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s linear,
    background-color 0.2s linear,
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-size: 16px;
  position: relative;
}

/* Optimization: Fixed background on pseudo-element prevents repaints on scroll */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(37, 99, 235, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(14, 165, 233, 0.03) 0%,
      transparent 50%
    );
  pointer-events: none;
  /* Use transform3d to force GPU acceleration */
  transform: translate3d(0, 0, 0);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 2rem;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.w-full {
  width: 100% !important;
}
.max-w-2xl {
  max-width: 42rem !important;
}
.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}
.text-center {
  text-align: center !important;
}
.hidden {
  display: none !important;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-4 {
  gap: 1rem !important;
}
.gap-6 {
  gap: 1.5rem !important;
}
.gap-8 {
  gap: 2rem !important;
}
.gap-10 {
  gap: 3rem !important;
}
.gap-12 {
  gap: 4rem !important;
}
.gap-16 {
  gap: 6rem !important;
}

.mb-8 {
  margin-bottom: 2rem !important;
}
.mb-10 {
  margin-bottom: 2.5rem !important;
}
.mb-12 {
  margin-bottom: 3.5rem !important;
}
.mb-16 {
  margin-bottom: 5rem !important;
}
.mb-20 {
  margin-bottom: 7rem !important;
}

/* Vertical Spacing Utilities */
.space-y-4 > * + * {
  margin-top: 1rem !important;
}
.space-y-6 > * + * {
  margin-top: 1.5rem !important;
}
.space-y-8 > * + * {
  margin-top: 2rem !important;
}
.space-y-10 > * + * {
  margin-top: 2.5rem !important;
}
.space-y-12 > * + * {
  margin-top: 3rem !important;
}

.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.py-8 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.p-6 {
  padding: 1.5rem !important;
}
.mt-4 {
  margin-top: 1rem !important;
}
.my-4 {
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}
.mr-2 {
  margin-right: 0.5rem !important;
}
.pl-5 {
  padding-left: 1.25rem !important;
}
.font-bold {
  font-weight: 700 !important;
}
.text-4xl {
  font-size: 2.25rem !important;
  line-height: 2.5rem !important;
}
.list-disc {
  list-style-type: disc !important;
}

.mobile-break {
  display: none;
}

.heading-top-padding {
  padding-top: 1rem !important;
}

.heading-y-padding {
  padding: 0.75rem 0 !important;
}

@media (max-width: 768px) {
  .mobile-break {
    display: block;
  }
  .heading-top-padding {
    padding-top: 2.5rem !important;
  }
  .heading-y-padding {
    padding: 2rem 0 !important;
  }
}

/* Typography - Polished */
h1,
h2,
h3 {
  color: var(--text-main);
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-outline:hover {
  background: var(--primary);
  color: white !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Premium Cards */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05); /* Softer border */
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.card:hover::after {
  opacity: 1;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

.shadow-xl {
  box-shadow: var(--shadow-3d) !important;
}

.p-8 {
  padding: 2rem !important;
}
.p-10 {
  padding: 2.5rem !important;
}

.hover-3d:hover,
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.85); /* Slightly more opaque */
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  /* Force hardware acceleration */
  transform: translate3d(0, 0, 0);
}

@supports (backdrop-filter: blur(8px)) {
  /* Disable blur on mobile/low-power devices if possible or just reduce it */
  .glass {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* Forms */
.input-group {
  margin-bottom: 1.25rem;
}
label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}
input,
textarea,
select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--bg-surface);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.file-drop-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.file-drop-area:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.file-drop-area input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0; /* Slightly increased vertical padding for better spacing */
  background: rgba(255, 255, 255, 0.95); /* More opaque */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  /* Use contain to limit browser work */
  contain: layout style;
}

.nav-logo img {
  height: 32px; /* Further reduced logo for compact header */
  width: auto;
  object-fit: contain;
  display: block;
}

.navbar.glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  display: flex;
  align-items: center;
  transition: var(--transition);
}

/* Duplicate .nav-logo img block removed; size defined earlier */

/* Animated text logo */
.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #2563eb);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

/* Gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
    .nav-logo img {
      height: 26px; /* Smaller logo for compact mobile header */
    }
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a:not(.btn) {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
}
.nav-links a:not(.btn):hover {
  color: var(--primary);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.25rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Scale down base size slightly */
  html {
    font-size: 15px;
  }

  /* Typography Scaling */
  h1 {
    font-size: 1.35rem !important;
  }
  h2 {
    font-size: 1.2rem !important;
  }
  h3 {
    font-size: 1.1rem !important;
  }

  .container {
    padding: 0 1rem;
  }

  /* Side Drawer Mobile Nav */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 260px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 5rem 1.5rem 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.85, 0, 0.15, 1);
    align-items: flex-start !important;
    gap: 0.5rem;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-close-btn {
    display: block !important;
  }

  .nav-links a {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    width: 100%;
    text-align: left; /* Left align text in drawer */
    background: transparent;
    margin-bottom: 0;
    color: var(--text-main);
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.03);
  }

  .nav-links a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
  }

  .nav-links a.btn {
    text-align: center;
    background: var(--primary);
    color: white !important;
    justify-content: center;
    margin-top: 1rem;
    border-bottom: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  /* Components */
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
  }

  .btn-sm {
    width: auto !important;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  /* Mobile Grid: Add bottom spacing to cards */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .card {
    margin-bottom: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); /* Simpler shadow for mobile */
  }

  /* Mobile Hero Buttons - Side by Side but responsive */
  .w-full-mobile {
    flex-wrap: wrap; /* Allow wrap if screen is VERY small */
    gap: 1rem; /* Adjust gap */
  }

  .hero-btn {
    padding: 0.8rem 1.5rem; /* Slightly smaller padding */
    flex: 1; /* Equal width */
    white-space: nowrap;
    min-width: 120px;
  }

  /* Resume Builder Sticky Buttons Mobile */
  .sticky-action-btn {
    min-width: auto !important;
    flex: 1;
    padding: 0.6rem 0.5rem !important;
    font-size: 0.85rem !important;
  }
  /* Mobile Button Grid Improvement */
  .mobile-btn-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  .mobile-btn-group .btn {
    width: 100%;
    margin: 0;
  }

  /* Back Button Optimization */
  .back-btn-mobile {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.8rem !important;
    width: auto !important; /* Don't stretch */
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
  }

  /* Disable hover effects */
  .hover-3d:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }
}

/* Visibility & Layout Utilities */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-column {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .mobile-text-center {
    text-align: center !important;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.float-animation {
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-text {
  animation: fadeIn 0.8s ease-out forwards;
}
.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.6s ease-out forwards;
}
.animate-pop-in {
  opacity: 0;
  animation: popIn 0.5s ease-out forwards;
}

/* Delays for staggered animations */
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}
.delay-3 {
  animation-delay: 0.3s;
}

.pulse-btn {
  position: relative;
  z-index: 1;
}
.pulse-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: var(--primary);
  opacity: 0.4;
  z-index: -1;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Footer & Extras */
.stat-card {
  text-align: center;
  padding: 2rem;
  background: white;
}
.stat-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 600;
}

footer {
  margin-top: auto;
  background: white;
  padding: 2rem 0;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-text {
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .footer-text {
    font-size: 0.85rem;
    white-space: normal; /* allow wrap if really small */
  }
}

.social-link {
  color: var(--text-muted);
  transition: var(--transition);
}

.social-link:hover {
  color: var(--primary); /* Blue color on hover */
  transform: translateY(-2px);
}

/* Search Components - Forced Compactness */
.search-container {
  width: 90% !important;
  max-width: 400px !important;
  margin: 0 auto 2.5rem auto !important;
  position: relative;
  z-index: 10;
  display: block !important;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper i {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: var(--transition);
  opacity: 0.6;
  z-index: 2;
}

.search-input-wrapper .search-input {
  width: 100% !important;
  padding-left: 2.8rem !important;
  height: 2.8rem !important;
  border-radius: 12px !important;
  background: white !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
  font-size: 0.95rem !important;
  transition: all 0.3s ease;
}

.search-input-wrapper .search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08);
  outline: none;
}

.search-input-wrapper .search-input:focus + i {
  color: var(--primary);
  opacity: 1;
}

.no-results-message {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(0, 0, 0, 0.05);
  margin: 2rem auto;
  max-width: 450px;
}

.no-results-message i {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: block;
}

.no-results-message h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.no-results-message p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .search-container {
    max-width: 320px; /* Even smaller on mobile */
    margin-bottom: 2rem;
  }
  .search-input-wrapper .search-input {
    height: 2.6rem;
    font-size: 0.9rem;
    padding-left: 2.5rem;
  }
  .search-input-wrapper i {
    left: 0.9rem;
    font-size: 0.85rem;
  }
}
