/* =============================================
   COTRAI - Corporate IT Workshop Platform
   Custom Styles & Aesthetic Layer
   ============================================= */

/* === TYPOGRAPHY === */
/* Inter Font - Local */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
}

/* === CSS VARIABLES === */
:root {
  /* Corporate Green/Teal Palette - Deep & Sophisticated */
  --primary-deep: #0E1F1A;
  --primary-dark: #14332B;
  --primary-base: #1B4D3F;
  --primary-mid: #23705B;
  --primary-light: #3FAE90;
  --primary-accent: #5FD6B3;

  /* Accent & Contrast */
  --accent-warm: #F59E0B;
  --accent-warm-light: #FCD34D;
  --neutral-100: #F8FAFC;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-700: #334155;
  --neutral-900: #0F172A;

  /* Typography */
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing & Rhythm */
  --section-spacing: 8rem;
  --content-max: 1400px;

  /* Motion */
  --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.6s;
}

/* === GLOBAL RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--neutral-700);
  background: linear-gradient(135deg, #F8FAFC 0%, #E8EEF5 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

p {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.7;
}

/* === ATMOSPHERIC BACKGROUND === */
.page-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(95, 214, 179, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(27, 77, 63, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #F8FAFC 0%, #E8EEF5 100%);
}

/* Noise texture overlay */
.page-atmosphere::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

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

.display-xl {
  font-size: clamp(3rem, 6vw + 1rem, 6.5rem);
  font-weight: 800;
  line-height: 1.1;
}

.display-lg {
  font-size: clamp(2.5rem, 4vw + 0.5rem, 4.5rem);
  font-weight: 700;
}

.heading-xl {
  font-size: clamp(2rem, 3vw + 0.5rem, 3.5rem);
}

.heading-lg {
  font-size: clamp(1.75rem, 2.5vw + 0.25rem, 2.75rem);
}

.heading-md {
  font-size: clamp(1.5rem, 2vw + 0.25rem, 2.25rem);
}

/* === NAVIGATION === */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
  will-change: background, box-shadow;
  overflow-x: hidden;
}

.nav-container.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 24px rgba(10, 22, 40, 0.08);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--primary-base);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color var(--duration-fast) var(--ease-smooth);
  white-space: nowrap;
}

.nav-logo:hover {
  color: var(--primary-accent);
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--neutral-700);
  text-decoration: none;
  padding: 0.5rem 1rem;
  position: relative;
  transition: color var(--duration-fast) var(--ease-smooth);
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--primary-accent);
  transition: transform var(--duration-normal) var(--ease-smooth);
  will-change: transform;
}

.nav-link:hover {
  color: var(--primary-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* === BUTTONS === */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-block;
  transition: all var(--duration-normal) var(--ease-smooth);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-base) 0%, var(--primary-mid) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(27, 77, 63, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27, 77, 63, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-warm-light) 100%);
  color: var(--primary-deep);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary-base);
  border: 2px solid var(--primary-base);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-base);
  color: white;
  transform: translateY(-2px);
}

/* === CARDS === */
.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-accent) 0%, var(--primary-mid) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(10, 22, 40, 0.15);
  border-color: var(--primary-light);
}

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

/* === HERO SECTION === */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 8rem;
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(95, 214, 179, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 8s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary-light);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  animation: arrow-bounce 2s ease-in-out infinite;
}

.hero-scroll-arrow:hover {
  color: var(--primary-accent);
  transform: translateX(-50%) translateY(4px);
}

.hero-scroll-arrow svg {
  display: block;
}

@keyframes arrow-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* === ANIMATIONS === */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Optimized animations for performance */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
}

.animate-on-scroll {
  animation: fade-in-up 0.6s var(--ease-smooth) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* Remove animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1 !important;
  }
}

/* === SECTION STYLES === */
.section-tag {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-accent);
  margin-bottom: 1rem;
  display: inline-block;
}

/* === FOOTER === */
.footer {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-dark) 100%);
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-accent), transparent);
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

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

/* === FORM STYLES === */
.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border: 2px solid var(--neutral-200);
  background: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-accent);
  background: white;
  box-shadow: 0 4px 16px rgba(95, 214, 179, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 0.5rem;
  display: block;
}

/* === COURSE BADGE === */
.course-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-accent), var(--primary-light));
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === RESPONSIVE === */

/* Large Screens - Better space utilization */
@media (min-width: 1440px) {
  :root {
    --content-max: 1600px;
  }

  .card {
    padding: 2.5rem;
  }

  .btn {
    padding: 1.125rem 2.25rem;
    font-size: 1.0625rem;
  }
}

/* Extra Large Screens - Full-width layout on 1920px+ */
@media (min-width: 1920px) {
  :root {
    --content-max: none;
  }

  /* Remove max-width constraints for full-width layout */
  .max-w-7xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl {
    max-width: none !important;
    padding-left: 4rem;
    padding-right: 4rem;
  }

  body {
    font-size: 1.25rem;
  }

  p {
    font-size: 1.25rem;
    line-height: 1.8;
  }

  .card {
    padding: 3rem;
  }

  .btn {
    padding: 1.5rem 3rem;
    font-size: 1.25rem;
  }

  .nav-link {
    font-size: 1.125rem;
    padding: 0.75rem 1.25rem;
  }

  .form-input,
  .form-textarea {
    padding: 1.25rem 1.75rem;
    font-size: 1.125rem;
  }

  .form-label {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }

  /* Increase heading sizes for large screens */
  .display-xl {
    font-size: clamp(5rem, 8vw, 8.5rem);
  }

  .display-lg {
    font-size: clamp(3.5rem, 6vw, 6rem);
  }

  .heading-xl {
    font-size: clamp(2.75rem, 4.5vw, 4.5rem);
  }

  .heading-lg {
    font-size: clamp(2.25rem, 3.5vw, 3.5rem);
  }

  .heading-md {
    font-size: clamp(2rem, 3vw, 3rem);
  }

  /* Hero section specific - larger text */
  .hero-section h1 {
    font-size: clamp(5.5rem, 9vw, 9rem);
    line-height: 1.05;
  }

  .hero-section p {
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.6;
  }

  /* Larger text elements */
  .text-xl {
    font-size: 1.5rem;
  }

  .text-lg {
    font-size: 1.375rem;
  }

  /* Card headings */
  .card h3 {
    font-size: clamp(1.5rem, 2vw, 2rem);
  }

  .card h2 {
    font-size: clamp(2rem, 3vw, 3rem);
  }

  /* Better spacing for full-width layout */
  section {
    padding-left: 4rem;
    padding-right: 4rem;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .hero-section {
    padding-top: 10rem;
    min-height: 100vh;
  }

  /* Course cards - better sizing */
  .card {
    padding: 3.5rem;
  }

  /* Footer improvements */
  .footer {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .footer h4 {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
  }

  .footer li,
  .footer p {
    font-size: 1.125rem;
  }
}

/* Ultra Wide Screens - Full-width on 2560px+ */
@media (min-width: 2560px) {
  :root {
    --content-max: none;
  }

  /* Full-width with more padding on ultra-wide */
  .max-w-7xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl {
    max-width: none !important;
    padding-left: 6rem;
    padding-right: 6rem;
  }

  body {
    font-size: 1.375rem;
  }

  p {
    font-size: 1.375rem;
    line-height: 1.8;
  }

  .card {
    padding: 4rem;
  }

  .btn {
    padding: 1.75rem 3.5rem;
    font-size: 1.375rem;
  }

  .nav-link {
    font-size: 1.25rem;
    padding: 0.875rem 1.5rem;
  }

  .form-input,
  .form-textarea {
    padding: 1.5rem 2rem;
    font-size: 1.25rem;
  }

  .form-label {
    font-size: 1.25rem;
  }

  /* Larger headings for ultra-wide */
  .display-xl {
    font-size: clamp(6rem, 9vw, 10rem);
  }

  .display-lg {
    font-size: clamp(4rem, 7vw, 7rem);
  }

  .heading-xl {
    font-size: clamp(3.5rem, 5.5vw, 5.5rem);
  }

  .heading-lg {
    font-size: clamp(3rem, 4.5vw, 4.5rem);
  }

  .heading-md {
    font-size: clamp(2.5rem, 3.5vw, 3.5rem);
  }

  /* Hero section for ultra-wide */
  .hero-section h1 {
    font-size: clamp(7rem, 10vw, 11rem);
    line-height: 1.05;
  }

  .hero-section p {
    font-size: clamp(1.75rem, 2.5vw, 2.5rem);
    line-height: 1.6;
  }

  /* Larger text elements */
  .text-xl {
    font-size: 1.75rem;
  }

  .text-lg {
    font-size: 1.5rem;
  }

  /* Card headings */
  .card h3 {
    font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  }

  .card h2 {
    font-size: clamp(2.5rem, 3.5vw, 3.5rem);
  }

  section {
    padding-left: 6rem;
    padding-right: 6rem;
    padding-top: 7rem;
    padding-bottom: 7rem;
  }

  .hero-section {
    padding-top: 12rem;
  }

  .card {
    padding: 4.5rem;
  }

  .footer {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .footer h4 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  .footer li,
  .footer p {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-spacing: 4rem;
  }

  .hero-section {
    min-height: 80vh;
    padding-top: 7rem;
  }

  .hero-scroll-arrow {
    bottom: 2rem;
  }

  .hero-scroll-arrow svg {
    width: 20px;
    height: 20px;
  }

  .card {
    padding: 1.5rem;
  }

  /* Mobile Navigation Fixes */
  .nav-container {
    width: 100%;
    left: 0;
    right: 0;
  }

  .nav-container .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
  }

  .nav-container .flex {
    gap: 0.5rem;
  }

  .nav-logo {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-right: auto;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.625rem 1.25rem;
  }

  /* Optimize animations on mobile */
  .animate-on-scroll {
    animation-duration: 0.4s;
  }

  /* Reduce motion on mobile for better performance */
  .card:hover {
    transform: translateY(-4px);
  }

  @keyframes glow-pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.05); }
  }
}

@media (max-width: 480px) {
  .nav-container .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav-logo {
    font-size: 1.125rem;
  }

  .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}

/* Small mobile screens (375×667 and similar) - Arrow positioned lower */
@media (max-width: 400px) and (max-height: 700px) {
  .hero-scroll-arrow {
    bottom: 1rem;
  }

  .hero-section {
    padding-bottom: 4rem;
  }
}

/* Landscape tablets and small laptops (1440×720 and similar) - Prevent overlap */
@media (min-width: 1400px) and (max-width: 1500px) and (max-height: 800px) {
  .hero-section h1 {
    font-size: clamp(3.5rem, 6vw, 6rem) !important;
    line-height: 1.1;
  }

  .hero-section p {
    font-size: clamp(1.125rem, 1.5vw, 1.5rem) !important;
    line-height: 1.6;
  }

  .hero-section {
    padding-top: 7rem;
    padding-bottom: 3rem;
  }

  .hero-scroll-arrow {
    bottom: 1.5rem;
  }
}
