@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-color: #87CEEB; /* Sky Blue */
    --text-color: #002F6C; /* Dark Blue from Finland Flag */
    --text-muted: #004080;
    --accent-color: #002F6C; /* Dark Blue */
    --yellow-color: #FFD700; /* Yellow Accent Color */
    --glass-bg: rgba(0, 47, 108, 0.85); /* Dark Blue Glassy */
    --glass-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 8px 32px 0 rgba(0, 47, 108, 0.4);
    --nav-width: 80px;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.dark-mode {
    --bg-color: #001530;
    --text-color: #e0f0ff;
    --text-muted: #80b0d0;
    --accent-color: #FFD700;
    --glass-bg: rgba(0, 30, 70, 0.8);
    --glass-border: rgba(135, 206, 235, 0.3);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Ensure dynamic themes match the flag requirement */
body.theme-lapland, body.theme-helsinki, body.theme-turku, body.theme-lakeland, body.theme-arctic {
    --bg-color: #87CEEB !important;
    --text-color: #002F6C !important;
    --accent-color: #002F6C !important;
    --yellow-color: #FFD700 !important;
    --glass-bg: rgba(0, 47, 108, 0.85) !important;
    --glass-border: rgba(255, 255, 255, 0.3) !important;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.8s ease, color 0.8s ease;
    overflow-x: hidden;
    padding-left: var(--nav-width); /* Sidebar offset */
    padding-right: var(--nav-width); /* Right Sidebar offset */
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 1rem;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5 {
    color: var(--yellow-color);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    color: #ffffff; /* Contrast text against dark blue glass */
}

/* Force text inside glass to be visible and headings to be yellow */
.glass h1, .glass h2, .glass h3, .glass h4, .glass h5 {
    color: var(--yellow-color) !important;
}
.glass p, .glass li, .glass label, .glass strong {
    color: #ffffff !important;
}

.section-header h2 {
    color: var(--accent-color);
}
.section-header p {
    color: var(--text-color);
    font-weight: 600;
}

/* Sidebar Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    z-index: 1000;
    background: rgba(0, 47, 108, 0.98);
    backdrop-filter: blur(15px);
    transition: var(--transition);
}

.navbar-left {
    left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
}

.navbar-right {
    right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
}

.brand {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--yellow-color) !important;
    text-align: center;
}

.top-brand {
    position: absolute;
    top: 30px;
    left: calc(var(--nav-width) + 40px);
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--yellow-color);
    z-index: 990;
    text-decoration: none;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links li a {
    color: #ffffff;
    font-size: 1.6rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    transition: var(--transition);
    line-height: 1;
}

.nav-links li a:hover, .nav-links li a.active {
    background: var(--yellow-color);
    color: #002F6C;
    transform: scale(1.1);
}

.top-actions {
    position: absolute;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff !important;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--yellow-color) !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: #ffffff !important;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--yellow-color);
    color: #002F6C;
    border-radius: 30px;
    font-weight: 600;
    border: 2px solid var(--yellow-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: #002F6C;
    color: var(--yellow-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--yellow-color);
    color: var(--yellow-color);
}

body:not(.dark-mode) .section:not(.glass) .btn-outline {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

body:not(.dark-mode) .section:not(.glass) .btn-outline:hover {
    background: var(--accent-color);
    color: #ffffff;
}

/* Glass Buttons */
.glass .btn {
    background: var(--yellow-color);
    color: #002F6C !important;
    border-color: var(--yellow-color);
}
.glass .btn:hover {
    background: transparent;
    color: var(--yellow-color) !important;
}
.glass .btn-outline {
    background: transparent;
    color: var(--yellow-color) !important;
    border-color: var(--yellow-color);
}
.glass .btn-outline:hover {
    background: var(--yellow-color);
    color: #002F6C !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.7);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,47,108,0.3), rgba(0,47,108,0.8));
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: fadeUp 1s ease forwards;
    color: var(--yellow-color);
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeUp 1.2s ease forwards;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeUp 1.4s ease forwards;
}

/* Sections */
.section {
    padding: 6rem 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* Grid Layouts - Forced 2 in a row */
.grid, .grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Cards */
.card {
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 47, 108, 0.5);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: 1.5rem;
}

/* Forms & Planner */
.planner-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.9);
    color: #000;
    font-family: var(--font-sans);
}

.form-control::placeholder {
    color: #555;
}

.planner-result {
    margin-top: 2rem;
    padding: 2rem;
    display: none;
}

/* Footer */
footer {
    background: #001f3f;
    color: #fff;
    padding: 4rem 5% 2rem;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

footer .brand {
    color: var(--yellow-color) !important;
}

.footer-links a {
    display: block;
    color: #87CEEB;
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--yellow-color);
}

.copyright {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 2rem;
    font-size: 0.9rem;
    color: #b0d0e0;
}

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

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Assistant */
.floating-assistant {
    position: fixed;
    bottom: 30px;
    right: calc(var(--nav-width) + 30px);
    width: 60px;
    height: 60px;
    background: var(--yellow-color);
    border: 2px solid var(--yellow-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002F6C;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
}

.floating-assistant:hover {
    transform: scale(1.1);
    background: #002F6C;
    color: var(--yellow-color);
}

.assistant-tooltip {
    position: absolute;
    right: 80px;
    background: var(--glass-bg);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.floating-assistant:hover .assistant-tooltip {
    opacity: 1;
}

/* Destination Pages Specific */
.destination-hero {
    height: 60vh;
    display: flex;
    align-items: flex-end;
    padding: 4rem 5%;
    position: relative;
    color: #fff;
}
.dest-content {
    padding: 4rem 5%;
    z-index: 2;
}
.dest-content h1 {
    color: var(--yellow-color);
}

/* Gallery Hover Zoom & Lightbox */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important; /* Keep gallery flexible */
    gap: 15px;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
}
.gallery-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.gallery-item:hover .gallery-img {
    transform: scale(1.1) rotate(2deg);
}

/* Responsive Sidebar & Mobile layout */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    body {
        padding-left: 0;
        padding-right: 0;
        padding-top: 70px;
    }
    .grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
    
    .top-brand {
        position: fixed;
        top: 15px;
        left: 24px;
        font-size: 2.2rem;
        z-index: 1001;
        text-shadow: none;
    }
    
    .navbar-left {
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: flex-start;
        padding: 0 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .navbar-right {
        width: 0;
        height: 0;
        border: none;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
        z-index: 1001;
    }
    
    .top-actions {
        position: fixed;
        top: 15px;
        right: 1.5rem;
        flex-direction: row;
    }
    
    .mobile-menu-btn { display: block; }
    
    .nav-links {
        position: fixed;
        width: 100%;
        left: -100%;
        background: rgba(0, 47, 108, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        transition: var(--transition);
        overflow-y: auto;
    }

    .navbar-left .nav-links {
        top: 70px;
        height: calc(50vh - 35px);
        padding: 1rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-right .nav-links {
        top: calc(50vh + 35px);
        height: calc(50vh - 35px);
        padding: 1rem 0;
    }
    
    .nav-links.active { left: 0; }
    
    .floating-assistant {
        right: 20px;
    }
    
    .footer-grid { grid-template-columns: 1fr !important; text-align: center; }
}