/* CSS Variables - Glassmorphism Design System */
:root {
    /* Color System */
    --primary-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-bg-hover: rgba(255, 255, 255, 0.12);
    --accent-color: #ef4444;
    --accent-hover: #dc2626;
    --hover-color: #3b82f6;
    --text-color: #f8fafc;
    --muted-text: #94a3b8;
    --subtle-text: #64748b;
    
    /* Glass Effects */
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-shadow-hover: 0 16px 48px 0 rgba(59, 130, 246, 0.3);
    --backdrop-blur: blur(12px);
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    /* Light Theme Colors */
    --primary-bg: linear-gradient(135deg, #ffffff 0%, #f1f5f9 50%, #ffffff 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --hover-color: #2563eb;
    --text-color: #0f172a;
    --muted-text: #475569;
    --subtle-text: #64748b;
    
    /* Light Theme Glass Effects */
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --glass-shadow-hover: 0 16px 48px 0 rgba(37, 99, 235, 0.15);
    background-color: var(--primary-bg);
    color: var(--text-color);
}

/* Global Styles */
html {
    scroll-behavior: smooth;
}

body {
    background: var(--primary-bg);
    background-size: cover;
    background-attachment: fixed;
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text-color);
    padding-top: 76px; /* Space for fixed navbar */
    min-height: 100vh;
    line-height: 1.6;
}

/* Navbar Styles - Enhanced Glassmorphism */
.navbar {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--glass-shadow);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-base);
}

.navbar-scrolled {
    background: var(--card-bg-hover);
    box-shadow: var(--glass-shadow-hover);
    border-bottom-color: var(--hover-color);
}

.navbar-brand {
    color: var(--text-color) !important;
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 40px;
    margin-right: 10px;
}

.nav-link {
    color: var(--text-color) !important;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    color: var(--hover-color) !important;
    transform: scale(1.05);
}

.nav-link.active {
    color: var(--hover-color) !important;
}

#themeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-color);
    border-color: var(--text-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
}

#themeToggle:hover {
    color: #ffffff;
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

body.light-theme #themeToggle:hover {
    color: #ffffff;
}

/* Hero Section */
.hero-section {
    color: var(--text-color);
    padding: 100px 0;
    text-align: center;
    margin-bottom: 50px;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 30px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: var(--font-weight-extrabold);
    margin-bottom: 20px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    transition: all var(--transition-base);
    letter-spacing: -0.02em;
}

@keyframes heroTitleAnimation {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(4px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-10px) scale(1.02);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.hero-title:hover {
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.6), 
                 0 0 30px rgba(0, 191, 255, 0.4), 
                 0 0 40px rgba(0, 191, 255, 0.3),
                 0 0 60px rgba(0, 191, 255, 0.2);
}

.lastname {
    color: var(--accent-color);
    display: inline-block;
    position: relative;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes lastnameAnimation {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.85);
        filter: blur(3px);
    }
    60% {
        opacity: 0.7;
        transform: translateX(8px) scale(1.05);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

.hero-title:hover .lastname,
.lastname:hover {
    text-shadow: 0 0 20px rgba(216, 0, 45, 0.7), 
                 0 0 30px rgba(216, 0, 45, 0.5), 
                 0 0 40px rgba(216, 0, 45, 0.4),
                 0 0 60px rgba(216, 0, 45, 0.3);
}

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2xl);
    color: var(--text-color);
    text-align: center;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    border-radius: 2px;
    animation: titleUnderline 1s ease-in-out infinite alternate;
}

@keyframes titleUnderline {
    0% { width: 40px; opacity: 0.6; }
    100% { width: 80px; opacity: 1; }
}

section {
    margin-bottom: 6rem;
    scroll-margin-top: 100px; /* Offset for fixed navbar */
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card animations - handled by JavaScript now */
.card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}



/* Card Styles - Glassmorphism */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 450px;
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--card-bg-hover);
    box-shadow: var(--glass-shadow-hover);
    border-color: var(--hover-color);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

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

.card p {
    flex: 1;
    overflow: visible;
    display: block;
}

.card-title {
    color: var(--hover-color);
    margin-bottom: var(--space-sm);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition-fast);
}

.card:hover .card-title {
    color: var(--text-color);
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.card .btn {
    margin-top: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.card-text {
    color: var(--muted-text);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.card-img-top {
    height: 180px;
    width: 100%;
    object-fit: contain;
    background-color: rgba(128, 128, 128, 0.05);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: var(--space-sm);
    transition: opacity var(--transition-base);
}



.placeholder-image {
    height: 180px;
    width: 100%;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 8px 8px 0 0;
    border: 2px dashed rgba(128, 128, 128, 0.3);
}

/* Map Styles */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--card-shadow);
    background-color: var(--card-bg);
    padding: 5px;
}

.map-frame {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
}

/* Contact Links */
.contact-link {
    color: var(--text-color);
    transition: all 0.3s ease-in-out;
    display: inline-block;
}

.contact-link:hover {
    color: var(--hover-color);
    transform: scale(1.2);
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--hover-color));
    border-radius: 0 2px 2px 0;
    transition: width 0.2s ease-in-out;
    z-index: 1001;
    width: 0%;
}

/* Back to Top Button - Enhanced */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
    z-index: 1000;
}

.back-to-top:hover {
    background: var(--card-bg-hover);
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--glass-shadow-hover);
    border-color: var(--hover-color);
}

.back-to-top.show {
    display: flex;
}

/* Footer */
.footer {
    background-color: var(--primary-bg);
    color: var(--text-color);
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Touch targets optimization */
.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: var(--backdrop-blur);
}

.contact-link:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -0.01em;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
        line-height: 1.7;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-title::after {
        width: 40px;
        bottom: -8px;
    }
    
    .card {
        min-height: 400px;
        margin-bottom: var(--space-lg);
    }
    
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 24px;
        right: 24px;
        font-size: 1.2rem;
    }
    
    .contact-link {
        font-size: 1.4rem;
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }
    
    /* Improved mobile navigation */
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        padding: var(--space-md) var(--space-lg);
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Touch-friendly button sizes */
    .btn {
        min-height: 44px;
        padding: var(--space-sm) var(--space-lg);
        font-size: 1rem;
    }
    
    .card .btn {
        min-height: 40px;
        padding: var(--space-xs) var(--space-md);
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .navbar-logo {
        height: 32px;
    }
    
    .card {
        min-height: 380px;
        margin-bottom: var(--space-md);
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-text {
        font-size: 0.8rem;
    }
    
    .contact-link {
        font-size: 1.2rem;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    
    .hero-section {
        padding: 60px 0;
        min-height: 50vh;
    }
    
    .container {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }
    
    /* Extra touch optimizations */
    .row {
        margin-left: -var(--space-sm);
        margin-right: -var(--space-sm);
    }
    
    .col {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
        min-height: 40vh;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    section {
        margin-bottom: var(--space-xl);
    }
}

/* Smooth scroll offset for anchor links */
:target {
    scroll-margin-top: 100px;
}
