/* ============================================
   GLOBAL CSS - Shared across all pages
   ============================================ */

/* CSS VARIABLES */
:root {
    --primary-color: #ffffff;
    --secondary-color: #f8fafc;
    --accent-color: #FF4F49;
    --accent-light: #FFE8E7;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --gradient-start: #FF4F49;
    --gradient-end: #FF6B66;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --negative-red: #ef4444;
    --negative-bg: #fef2f2;
    --negative-border: #fecaca;
    --positive-green: #22c55e;
    --positive-bg: #f0fdf4;
    --positive-border: #bbf7d0;
}

/* RESET STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BASE STYLES */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* CONTAINERS */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* LINK STYLES */
a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* GRADIENT TEXT UTILITY */
.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   VIEW TRANSITION API - Premium Page Transitions
   Smooth slide + fade for premium app-like feel
   ============================================ */

/* Enable view transitions for the entire document */
@view-transition {
    navigation: auto;
}

/* Fallback for browsers without View Transition API */
html {
    scroll-behavior: smooth;
}

/* Performance optimization - hint browser about upcoming changes */
html.view-transition-active {
    will-change: opacity, transform;
}

/* Hide reading progress bar during transition to prevent jitter */
html.view-transition-active .reading-progress-container {
    opacity: 0 !important;
    transition: opacity 150ms ease !important;
}

/* 
   SIMPLE FULL-PAGE FADE TRANSITION
   - Clean fade only (no slide)
   - Elegant and smooth
   - Clean and reliable
*/

/* The entire page (root) - simple fade */
::view-transition-old(root) {
    animation: page-fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity;
}

::view-transition-new(root) {
    animation: page-fade-in 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity;
}

/* Fade out animation */
@keyframes page-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* Ensure smooth snapshot capture */
::view-transition-image-pair(root) {
    isolation: isolate;
}

/* Disable transitions on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}
