@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --background: 0, 0%, 100%;
    --foreground: 216, 60%, 12%;
    --card: 0, 0%, 100%;
    --card-foreground: 216, 60%, 12%;
    --popover: 0, 0%, 100%;
    --popover-foreground: 216, 60%, 12%;
    --primary: 216, 61%, 20%; /* Navy #142d52 */
    --primary-foreground: 0, 0%, 100%; /* White */
    --secondary: 216, 20%, 95%;
    --secondary-foreground: 216, 61%, 20%;
    --muted: 216, 15%, 96%;
    --muted-foreground: 216, 15%, 45%;
    --accent: 44, 94%, 55%; /* Gold #f8c020 */
    --accent-foreground: 216, 61%, 20%;
    --destructive: 0, 84.2%, 60.2%;
    --destructive-foreground: 0, 0%, 98%;
    --border: 216, 20%, 90%;
    --input: 216, 20%, 90%;
    --ring: 216, 61%, 20%;
    --radius: 0.5rem;
}

.dark {
    --background: 216, 55%, 6%; /* Deep Dark Navy brand #091220 */
    --foreground: 216, 20%, 98%;
    --card: 216, 45%, 9%; /* Brand card navy #0e1b2f */
    --card-foreground: 216, 20%, 98%;
    --popover: 216, 45%, 9%;
    --popover-foreground: 216, 20%, 98%;
    --primary: 44, 94%, 55%; /* Gold #f8c020 as primary focus in dark mode */
    --primary-foreground: 216, 60%, 10%; /* Dark navy text for readability */
    --secondary: 216, 35%, 15%;
    --secondary-foreground: 216, 20%, 98%;
    --muted: 216, 35%, 13%;
    --muted-foreground: 216, 20%, 65%;
    --accent: 216, 35%, 15%;
    --accent-foreground: 216, 20%, 98%;
    --destructive: 0, 62.8%, 30.6%;
    --destructive-foreground: 0, 0%, 98%;
    --border: 216, 35%, 16%;
    --input: 216, 35%, 16%;
    --ring: 44, 94%, 55%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: hsl(var(--background));
}
::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.5);
}

/* Back to top button styling */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 40;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: hsl(var(--primary) / 0.9);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Search dropdown style */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background-color: hsl(var(--popover));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-item {
    padding: 12px 16px;
    border-bottom: 1px solid hsl(var(--border));
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: hsl(var(--accent));
}

/* Welcome loader screen styling */
.loader {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Keyframe animations for micro-interactions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Skeleton Loading */
.loading-skeleton {
    background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--accent)) 50%, hsl(var(--muted)) 75%);
    background-size: 200% 100%;
    animation: loading-skeleton-animation 1.5s infinite;
}

@keyframes loading-skeleton-animation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal animation overrides for clean transitions */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
  transform: scale(1);
}
