/* main.css - Custom styles for Achilles website */

/* ============================================
   1. CSS CUSTOM PROPERTIES (Variables)
   ============================================ */
:root {
    /* Colors - Primary Palette */
    --color-primary-dark: #0f172a;
    --color-secondary-dark: #1e293b;
    --color-tertiary-dark: #334155;
    --color-border-dark: #475569;
    
    /* Colors - Yellow Accents */
    --color-accent-yellow: #fbbf24;
    --color-accent-yellow-dark: #f59e0b;
    --color-accent-yellow-light: #fcd34d;
    
    /* Colors - Text */
    --color-text-primary: #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted: #9ca3af;
    --color-text-light: #f9fafb;
    
    /* Colors - Backgrounds */
    --color-bg-light: #ffffff;
    --color-bg-gray: #f3f4f6;
    --color-bg-slate: #f8fafc;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ============================================
   2. GLOBAL STYLES & RESETS
   ============================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem; /* Account for fixed navbar */
}

/* Body base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default margins from headings */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.2;
}

/* Improve link underline rendering */
a {
    text-decoration-skip-ink: auto;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   3. UTILITY CLASSES
   ============================================ */

/* Glass effect (glassmorphism) */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-secondary-dark) 100%);
}

.gradient-yellow {
    background: linear-gradient(135deg, var(--color-accent-yellow) 0%, var(--color-accent-yellow-dark) 100%);
}

.gradient-slate {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Text gradients */
.text-gradient-yellow {
    background: linear-gradient(135deg, var(--color-accent-yellow) 0%, var(--color-accent-yellow-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hide Alpine.js content before initialization */
[x-cloak] {
    display: none !important;
}

/* ============================================
   4. ANIMATIONS
   ============================================ */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.bounce {
    animation: bounce 1s infinite;
}

/* Delayed animations for staggered effects */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================
   5. COMPONENT-SPECIFIC STYLES
   ============================================ */

/* Hero section */
.hero-section {
    min-height: calc(100vh - 5rem);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    z-index: 1;
}

.hero-section > * {
    position: relative;
    z-index: 2;
}

/* Section spacing */
.section {
    padding: var(--spacing-3xl) 0;
}

.section-sm {
    padding: var(--spacing-2xl) 0;
}

.section-lg {
    padding: 5rem 0;
}

/* Card hover effects */
.card-hover {
    transition: all var(--transition-slow);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

/* Image overlay */
.image-overlay {
    position: relative;
}

.image-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.image-overlay:hover::after {
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-dark);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-yellow);
}

/* Focus visible styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-accent-yellow);
    outline-offset: 2px;
}

/* Skip to content link */
.sr-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ============================================
   6. RESPONSIVE UTILITIES
   ============================================ */

/* Container with max-width */
.container-custom {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

@media (min-width: 640px) {
    .container-custom {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding-left: var(--spacing-xl);
        padding-right: var(--spacing-xl);
    }
}

/* ============================================
   7. PRINT STYLES
   ============================================ */

@media print {
    /* Hide navigation, footer, and interactive elements */
    nav, footer, .no-print {
        display: none !important;
    }
    
    /* Reset colors for better printing */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Add page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   8. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Use GPU acceleration for transforms */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Will-change hint for frequently animated elements */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* ============================================
   9. IMAGE GALLERY STYLES
   ============================================ */

/* Hide scrollbar but allow scrolling */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

/* Gallery container hover state */
.gallery-container {
    position: relative;
}

/* Smooth image transitions */
.gallery-container img {
    transition: opacity 0.3s ease;
}

/* Thumbnail active state pulse animation */
.gallery-thumb.border-yellow-400 {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0);
    }
}

/* Touch-friendly thumbnail sizing on mobile */
@media (max-width: 640px) {
    .gallery-thumb {
        width: 3.5rem;
        height: 3.5rem;
    }
}
