/* ================================
   Modern Personal Website Styles
   Apple + Google Aesthetic
   ================================ */

/* ===== CSS Variables ===== */
:root {
    /* Light Mode Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-elevated: #ffffff;
    --color-text-primary: #000000;
    --color-text-secondary: #1a202c;
    --color-text-tertiary: #64748b;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Royal Color Palette */
    --color-royal-blue: #002D72;
    --color-forest-green: #0B4619;

    /* Glass effects */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Animation duration */
    --animation-duration: 0.8s;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --color-bg-primary: #0f0f0f;
    --color-bg-secondary: #1a1a1a;
    --color-bg-elevated: #262626;
    --color-text-primary: #ffffff;
    --color-text-secondary: #e2e8f0;
    --color-text-tertiary: #94a3b8;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.5);

    --glass-bg: rgba(26, 26, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ===== Base Styles ===== */
body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* ===== Navigation ===== */
.nav-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.nav-link {
    position: relative;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--color-bg-secondary);
    transform: scale(1.1);
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    padding-top: 4rem;
    box-shadow: -4px 0 20px var(--color-shadow);
}

.mobile-menu.active {
    right: 0;
}

/* ===== Buttons ===== */
.btn-gradient {
    position: relative;
    padding: 14px 32px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
    color: white;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-forest-green) 0%, var(--color-royal-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 45, 114, 0.4);
}

.btn-gradient:hover::before {
    opacity: 1;
}

.btn-gradient span {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    padding: 14px 32px;
    font-weight: 600;
    border-radius: 12px;
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--color-shadow);
    border-color: var(--color-text-tertiary);
}

/* ===== Animations ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--animation-duration) cubic-bezier(0.16, 1, 0.3, 1),
                transform var(--animation-duration) cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Floating animations for hero orbs */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-30px, 30px) scale(1.1);
    }
}

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

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

/* Animated gradient background */
.gradient-animated {
    background: linear-gradient(-45deg, var(--color-royal-blue), var(--color-forest-green), var(--color-royal-blue), var(--color-forest-green));
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== Photo Cards ===== */
.photo-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--color-bg-elevated);
}

.photo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--color-shadow);
}

.photo-card:hover::before {
    opacity: 1;
}

.photo-card img {
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-card:hover img {
    transform: scale(1.05);
}

/* ===== Glass Cards ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--color-shadow);
}

/* ===== Lightbox ===== */
#lightbox {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(40px);
    cursor: pointer;
}

#lightbox img {
    cursor: default;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

#lightbox button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#lightbox button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== Timeline (Resume) ===== */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -52px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
    box-shadow: 0 0 0 4px var(--color-bg-primary);
}

/* ===== Focus Styles (Accessibility) ===== */
:focus-visible {
    outline: 2px solid var(--color-royal-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===== Print Styles ===== */
@media print {
    nav, footer, .theme-toggle-btn, .hamburger, .mobile-menu {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }

    a {
        color: black;
        text-decoration: none;
    }

    .shadow-lg, .glass-card {
        box-shadow: none;
        background: white;
        border: 1px solid #e5e7eb;
    }

    .animate-on-scroll, .animate-scale {
        opacity: 1;
        transform: none;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 3rem;
    }

    .gradient-text {
        font-size: 3rem;
    }

    .photo-card::before {
        height: 3px;
    }
}

/* ===== Loading Animation ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* ===== Utility Classes ===== */
.text-balance {
    text-wrap: balance;
}

/* Gradient backgrounds for Tailwind */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--color-forest-green) 0%, var(--color-royal-blue) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-forest-green) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--color-forest-green) 0%, var(--color-royal-blue) 100%);
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-on-scroll,
    .animate-scale {
        opacity: 1;
        transform: none;
    }
}
