@import "@fontsource/open-sans/400.css";
@import "@fontsource/open-sans/500.css";
@import "@fontsource/open-sans/600.css";
@import "@fontsource/open-sans/700.css";
@import "@fontsource/open-sans/800.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 220 20% 97%;
    --foreground: 213 70% 14%;

    --card: 0 0% 100%;
    --card-foreground: 213 70% 14%;

    --popover: 0 0% 100%;
    --popover-foreground: 213 70% 14%;

    --primary: 213 70% 14%;
    --primary-foreground: 0 0% 100%;

    --secondary: 220 14% 92%;
    --secondary-foreground: 213 70% 14%;

    --muted: 220 14% 95%;
    --muted-foreground: 215 16% 47%;

    --accent: 44 100% 48%;
    --accent-foreground: 213 70% 14%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 220 13% 89%;
    --input: 220 13% 89%;
    --ring: 213 70% 14%;

    --radius: 0.75rem;

    --navy: 213 70% 14%;
    --gold: 44 100% 48%;
    --hero-gradient: linear-gradient(135deg, hsl(213 70% 14%) 0%, hsl(213 70% 22%) 100%);
    --card-shadow: 0 4px 24px -4px hsl(213 70% 14% / 0.08);
    --card-shadow-hover: 0 12px 32px -8px hsl(213 70% 14% / 0.15);
    --glass-bg: hsl(0 0% 100% / 0.85);
    --text-gradient: linear-gradient(135deg, hsl(213 70% 14%) 0%, hsl(44 100% 48%) 100%);

    --sidebar-background: 188 82% 22%;
    --sidebar-foreground: 0 0% 95%;
    --sidebar-primary: 44 100% 48%;
    --sidebar-primary-foreground: 188 82% 18%;
    --sidebar-accent: 188 70% 28%;
    --sidebar-accent-foreground: 0 0% 95%;
    --sidebar-border: 188 62% 20%;
    --sidebar-ring: 44 100% 48%;

    --font-size-page-title: 1.25rem;
    --font-size-section-title: 1rem;
    --font-size-table-header: 0.8125rem;
    --font-size-body: 0.75rem;
    --font-size-label: 0.75rem;
    --font-size-input: 0.8125rem;
    --font-size-sidebar: 0.8125rem;
    --font-size-button: 0.75rem;
    --font-size-helper: 0.6875rem;
  }

  .dark {
    --background: 213 70% 6%;
    --foreground: 220 20% 95%;

    --card: 213 70% 9%;
    --card-foreground: 220 20% 95%;

    --popover: 213 70% 9%;
    --popover-foreground: 220 20% 95%;

    --primary: 44 100% 48%;
    --primary-foreground: 213 70% 14%;

    --secondary: 213 50% 17%;
    --secondary-foreground: 220 20% 95%;

    --muted: 213 50% 17%;
    --muted-foreground: 215 20% 65%;

    --accent: 44 100% 48%;
    --accent-foreground: 213 70% 14%;

    --destructive: 0 63% 31%;
    --destructive-foreground: 220 20% 95%;

    --border: 213 50% 17%;
    --input: 213 50% 17%;
    --ring: 44 100% 48%;

    --sidebar-background: 188 82% 18%;
    --sidebar-foreground: 220 14% 92%;
    --sidebar-primary: 44 100% 48%;
    --sidebar-primary-foreground: 188 82% 18%;
    --sidebar-accent: 188 70% 24%;
    --sidebar-accent-foreground: 220 14% 92%;
    --sidebar-border: 188 62% 18%;
    --sidebar-ring: 44 100% 48%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground antialiased;
    font-family: "Open Sans", sans-serif;
    line-height: 1.5;
  }

  html {
    font-size: 14px;
    scroll-behavior: smooth;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: "Open Sans", sans-serif;
  }
}

@layer components {
  .admin-panel-surface {
    color: hsl(var(--foreground));
  }

  .admin-panel-surface > :not([data-dialog-header]):not([data-dialog-footer]):not([data-dialog-close])
    [data-dialog-header],
  .admin-panel-surface > :not([data-sheet-header]):not([data-sheet-footer]):not([data-sheet-close])
    [data-sheet-header] {
    margin: -1.25rem -1.5rem 1.25rem;
  }

  .admin-panel-surface > :not([data-dialog-header]):not([data-dialog-footer]):not([data-dialog-close])
    [data-dialog-footer],
  .admin-panel-surface > :not([data-sheet-header]):not([data-sheet-footer]):not([data-sheet-close])
    [data-sheet-footer] {
    margin: 1.25rem -1.5rem -1.25rem;
  }

  .admin-panel-surface :is(label, legend) {
    color: hsl(var(--sidebar-background));
    font-weight: 700;
  }

  .admin-panel-surface label:has(+ input[required])::after,
  .admin-panel-surface label:has(+ textarea[required])::after,
  .admin-panel-surface label:has(+ select[required])::after,
  .admin-panel-surface label:has(+ [aria-required="true"])::after,
  .admin-panel-surface label:has(input[required])::after,
  .admin-panel-surface label:has(textarea[required])::after,
  .admin-panel-surface label:has(select[required])::after {
    content: " *";
    color: hsl(var(--sidebar-primary));
    font-weight: 800;
  }

  .admin-panel-surface :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    border-radius: calc(var(--radius) - 2px);
  }

  .admin-panel-surface :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select):focus {
    border-color: hsl(var(--sidebar-ring));
    box-shadow: 0 0 0 3px hsl(var(--sidebar-ring) / 0.18);
    outline: none;
  }

  .admin-panel-surface :is(h2, h3, h4, [data-section-title]) {
    color: hsl(var(--sidebar-background));
    font-weight: 700;
  }

  :where(.relative):has(> :where(svg, span, button, div)[class*="absolute"][class*="left-"]) > input:not([type="checkbox"]):not([type="radio"]) {
    padding-left: 2.75rem !important;
  }

  :where(.relative):has(> :where(svg, span, button, div)[class*="absolute"][class*="left-4"]) > input:not([type="checkbox"]):not([type="radio"]) {
    padding-left: 3rem !important;
  }

  :where(.relative):has(> :where(svg, span, button, div)[class*="absolute"][class*="right-"]) > input:not([type="checkbox"]):not([type="radio"]) {
    padding-right: 2.75rem !important;
  }
}

@layer utilities {
  .text-gradient {
    background: var(--text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .hero-gradient {
    background: var(--hero-gradient);
  }

  .gold-gradient {
    background: linear-gradient(135deg, hsl(44 100% 48%) 0%, hsl(38 100% 42%) 100%);
  }

  .glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
  }

  .scrollbar-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .scrollbar-hidden::-webkit-scrollbar {
    display: none;
  }

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

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

  .animate-float {
    animation: float 6s ease-in-out infinite;
  }

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

  @keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
  }

  .animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
  }

  .animate-course-page-enter {
    animation: coursePageEnter 0.82s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: opacity, transform;
  }

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

  @keyframes coursePageEnter {
    from {
      opacity: 0;
      transform: translateY(18px) scale(0.992);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes megaMenuEnter {
    from {
      opacity: 0;
      transform: translateY(-14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-mega-menu-enter {
    animation: megaMenuEnter 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes accordionSlideDown {
    from {
      opacity: 0;
      max-height: 0;
    }
    to {
      opacity: 1;
      max-height: 500px;
    }
  }

  .animate-accordion-down {
    animation: accordionSlideDown 0.25s ease-out forwards;
  }

  @media (prefers-reduced-motion: reduce) {
    .animate-fade-up,
    .animate-course-page-enter {
      animation: none !important;
      transform: none !important;
    }
  }

  .animate-marquee {
    animation: marquee 60s linear infinite;
  }

  .animate-marquee2 {
    animation: marquee2 60s linear infinite;
  }

  .footer-partner-ticker {
    position: relative;
    overflow: hidden;
  }

  .footer-partner-track {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: max-content;
    padding: 0.5rem 0;
  }

  .ticker-left {
    animation: footerTickerLeft 62s linear infinite;
  }

  .ticker-right {
    animation: footerTickerRight 72s linear infinite;
  }

  .footer-partner-item {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  }

  .footer-partner-item:hover {
    transform: translate3d(0, 0, 0) scale(1.04);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
  }

  .footer-partner-name {
    font-size: 0.925rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: hsl(var(--foreground) / 0.9);
    white-space: nowrap;
  }

  .footer-partner-ticker:hover .ticker-left {
    animation-duration: 110s;
  }

  .footer-partner-ticker:hover .ticker-right {
    animation-duration: 128s;
  }

  @keyframes footerTickerLeft {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
  }

  @keyframes footerTickerRight {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(50%, 0, 0); }
  }

  .operations-corporate button:not(:disabled),
  .operations-corporate [role="button"]:not([aria-disabled="true"]) {
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  }

  .operations-corporate button:not(:disabled):hover,
  .operations-corporate [role="button"]:not([aria-disabled="true"]):hover {
    box-shadow: 0 6px 16px -14px hsl(var(--primary) / 0.35);
  }

  .operations-corporate,
  .admin-panel-surface {
    font-size: 0.78125rem;
    line-height: 1.35;
  }

  .operations-corporate :is(h1, .text-4xl, .text-5xl),
  .admin-panel-surface :is(h1, .text-4xl, .text-5xl) {
    font-size: 1.375rem;
    line-height: 1.85rem;
    font-weight: 700;
    letter-spacing: 0;
  }

  .operations-corporate :is(h2, .text-3xl),
  .admin-panel-surface :is(h2, .text-3xl) {
    font-size: 1.0625rem;
    line-height: 1.45rem;
    font-weight: 650;
    letter-spacing: 0;
  }

  .operations-corporate :is(h3, .text-2xl),
  .admin-panel-surface :is(h3, .text-2xl) {
    font-size: 0.96875rem;
    line-height: 1.35rem;
    font-weight: 650;
    letter-spacing: 0;
  }

  .operations-corporate :is(h4, .text-xl),
  .admin-panel-surface :is(h4, .text-xl) {
    font-size: 0.9375rem;
    line-height: 1.35rem;
    font-weight: 650;
    letter-spacing: 0;
  }

  .operations-corporate :is(.text-lg, .text-base),
  .admin-panel-surface :is(.text-lg, .text-base) {
    font-size: 0.875rem;
    line-height: 1.35rem;
    letter-spacing: 0;
  }

  .operations-corporate :is(.text-sm, p, li, td, button, input, textarea, select),
  .admin-panel-surface :is(.text-sm, p, li, td, button, input, textarea, select) {
    font-size: 0.78125rem;
    line-height: 1.25rem;
    letter-spacing: 0;
  }

  .operations-corporate :is(.text-xs, small),
  .admin-panel-surface :is(.text-xs, small) {
    font-size: 0.71875rem;
    line-height: 1.05rem;
    letter-spacing: 0;
  }

  .operations-corporate :is([class*="text-"][class*="font-bold"], .font-bold),
  .admin-panel-surface :is([class*="text-"][class*="font-bold"], .font-bold) {
    letter-spacing: 0;
  }

  .operations-corporate [class*="text-3xl"].font-bold,
  .operations-corporate [class*="text-2xl"].font-bold,
  .admin-panel-surface [class*="text-3xl"].font-bold,
  .admin-panel-surface [class*="text-2xl"].font-bold {
    font-size: 1.25rem;
    line-height: 1.65rem;
  }

  .operations-corporate aside {
    font-size: 0.8125rem;
  }

  .operations-corporate aside button,
  .operations-corporate aside [role="button"] {
    min-height: 2rem;
    font-size: 0.8125rem;
    line-height: 1.15rem;
  }

  .operations-corporate [role="tab"],
  .admin-panel-surface [role="tab"] {
    min-height: 2rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.78125rem;
    line-height: 1rem;
  }

  .operations-corporate table {
    font-size: 0.78125rem;
  }

  .operations-corporate thead th {
    height: 2rem;
    padding: 0.425rem 0.65rem;
    font-size: 0.71875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: hsl(var(--foreground) / 0.85);
    text-transform: none;
  }

  .operations-corporate tbody td {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    line-height: 1.1rem;
  }

  .operations-corporate tr {
    min-height: 2.5rem;
  }

  .operations-corporate :is(.rounded-lg.border.bg-card, [class*="rounded-lg"][class*="bg-card"]) {
    border-radius: 0.5rem;
  }

  .operations-corporate :is(.rounded-lg.border.bg-card, [class*="rounded-lg"][class*="bg-card"]) > :is(div):first-child:not(.p-0) {
    padding: 0.8rem 0.85rem 0.5rem;
  }

  .operations-corporate :is(.rounded-lg.border.bg-card, [class*="rounded-lg"][class*="bg-card"]) > :is(div):last-child:not(.p-0) {
    padding: 0.65rem 0.85rem 0.8rem;
  }

  .operations-corporate :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select),
  .admin-panel-surface :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    min-height: 2.25rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
    line-height: 1.2rem;
  }

  .operations-corporate :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select, [role="combobox"]),
  .admin-panel-surface :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select, [role="combobox"]) {
    color: hsl(var(--foreground));
    caret-color: hsl(var(--foreground));
    -webkit-text-fill-color: hsl(var(--foreground));
  }

  .operations-corporate :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select, [role="combobox"]):is(:hover, :focus, :focus-visible, [data-state="open"]),
  .admin-panel-surface :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select, [role="combobox"]):is(:hover, :focus, :focus-visible, [data-state="open"]) {
    color: hsl(var(--foreground));
    -webkit-text-fill-color: hsl(var(--foreground));
  }

  .operations-corporate textarea,
  .admin-panel-surface textarea {
    min-height: 4.5rem;
  }

  .operations-corporate label,
  .admin-panel-surface label {
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 650;
  }

  .operations-corporate button,
  .admin-panel-surface button {
    min-height: 2.125rem;
    font-size: 0.8125rem;
    line-height: 1rem;
  }

  .operations-corporate button[size="icon"],
  .operations-corporate .h-9.w-9,
  .admin-panel-surface button[size="icon"],
  .admin-panel-surface .h-9.w-9 {
    width: 2.125rem;
    height: 2.125rem;
    min-height: 2.125rem;
  }

  .admin-panel-surface [data-dialog-header],
  .admin-panel-surface [data-sheet-header] {
    min-height: 4rem;
    padding: 1rem 1.25rem;
  }

  .admin-panel-surface [data-dialog-footer],
  .admin-panel-surface [data-sheet-footer] {
    padding: 0.875rem 1.25rem;
  }

  .admin-panel-surface [data-dialog-header] [role="heading"],
  .admin-panel-surface [data-sheet-header] [role="heading"] {
    font-size: 1rem;
    line-height: 1.35rem;
  }

  .admin-panel-surface > :not([data-dialog-header]):not([data-dialog-footer]):not([data-dialog-close]) {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .operations-corporate .space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
  }

  .operations-corporate .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem;
  }

  .operations-corporate .gap-4 {
    gap: 0.75rem;
  }

  .operations-corporate .gap-3 {
    gap: 0.625rem;
  }

  .hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }

  .operations-corporate .text-muted-foreground {
    color: hsl(var(--muted-foreground) / 0.96);
  }

  .accreditation-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
    width: 100%;
  }

  .accreditation-row {
    display: flex;
    overflow: hidden;
    width: 100%;
    position: relative;
  }

  .accreditation-row::before,
  .accreditation-row::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
  }

  .accreditation-row::before {
    left: 0;
    background: linear-gradient(to right, #0f172a 0%, transparent 100%);
  }

  .accreditation-row::after {
    right: 0;
    background: linear-gradient(to left, #0f172a 0%, transparent 100%);
  }

  .accreditation-track {
    display: flex;
    gap: 1.25rem;
    flex-shrink: 0;
    min-width: max-content;
    padding: 0.5rem 0;
  }

  .accreditation-track-left {
    animation: accreditationScrollLeft 40s linear infinite;
  }

  .accreditation-track-right {
    animation: accreditationScrollRight 40s linear infinite;
  }

  .accreditation-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, opacity 0.35s ease;
    cursor: default;
    opacity: 0.95;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    will-change: transform;
    backface-visibility: hidden;
    min-width: 12rem;
  }

  .accreditation-item:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10), 0 4px 10px rgba(0, 0, 0, 0.06);
    opacity: 1;
  }

  .accreditation-item img,
  .accreditation-item svg {
    height: 3.25rem;
    width: auto;
    max-width: 11.5rem;
    object-fit: contain;
    display: block;
    pointer-events: none;
  }

  .accreditation-item img.partner-logo-wide {
    max-width: 12rem;
  }

  .accreditation-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7rem;
    height: 3.25rem;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
  }

  .accreditation-fallback[hidden] {
    display: none;
  }

  .accreditation-row:hover .accreditation-track {
    animation-play-state: paused;
  }

  @keyframes accreditationScrollLeft {
    0% {
      transform: translateX(0%);
    }
    100% {
      transform: translateX(-50%);
    }
  }

  @keyframes accreditationScrollRight {
    0% {
      transform: translateX(-50%);
    }
    100% {
      transform: translateX(0%);
    }
  }

  @media (max-width: 767px) {
    .accreditation-item {
      padding: 0.625rem 0.875rem;
      min-width: 9.75rem;
    }
    .accreditation-item img,
    .accreditation-item svg {
      height: 2.5rem;
      max-width: 9rem;
    }
    .accreditation-item img.partner-logo-wide {
      max-width: 9.5rem;
    }
    .accreditation-fallback {
      height: 2.5rem;
      min-width: 6rem;
      font-size: 0.78rem;
    }
    .accreditation-track {
      gap: 0.875rem;
    }
    .accreditation-row::before,
    .accreditation-row::after {
      width: 40px;
    }
  }

  .btn-sm {
    height: 2rem;
    min-height: 2rem;
    padding: 0 0.75rem;
    font-size: var(--font-size-button);
    line-height: 1.25;
  }

  .btn-sm-icon {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
  }

  .admin-preloader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: hsl(var(--background));
    z-index: 9999;
  }

  .admin-preloader-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid hsl(var(--muted) / 0.3);
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

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

  .admin-preloader-text {
    margin-top: 0.75rem;
    font-size: var(--font-size-helper);
    color: hsl(var(--muted-foreground));
  }
}
