/*
 * Anzhelika Korobeynyk - Campaign Website
 * Modern Finnish Design with Kokoomus Branding
 */

:root {
    /* Kokoomus Colors */
    --kokoomus-blue: #003DA5;
    --kokoomus-dark-blue: #00205A;
    --kokoomus-gold: #FFD100;

    /* Finnish Design Palette */
    --finnish-white: #FFFFFF;
    --finnish-light: #F5F7FA;
    --finnish-gray: #E9ECEF;

    /* Text Colors */
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;

    /* Spacing & Sizing */
    --section-spacing: 5rem;
    --border-radius: 8px;

    /* Transitions */
    --transition-fast: 0.3s;
    --transition-medium: 0.5s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--finnish-light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--kokoomus-blue);
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--kokoomus-blue);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
}

a:hover {
    color: var(--kokoomus-dark-blue);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: var(--section-spacing) 0;
    position: relative;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--kokoomus-blue);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Background */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../images/photo.jpg') center/cover no-repeat;
    opacity: 0.07;
    z-index: -1;
}

/* Navbar */
.navbar {
    padding: 1rem 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all var(--transition-fast) ease;
}

.navbar.navbar-scrolled {
    padding: 0.7rem 0;
}

.navbar-brand .logo-img {
    height: 40px;
    transition: transform var(--transition-fast) ease;
}

.navbar-brand:hover .logo-img {
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    padding: 0.5rem 0.8rem !important;
    position: relative;
    transition: all var(--transition-fast) ease;
    font-size: 0.95rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--kokoomus-blue);
    transition: width var(--transition-fast) ease;
}

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

.nav-link.active {
    color: var(--kokoomus-blue) !important;
    font-weight: 700;
}

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

.nav-link.active::after {
    width: 100%;
    height: 3px;
    background-color: var(--kokoomus-gold);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    min-height: 700px;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
    background: linear-gradient(135deg, rgba(0, 61, 165, 0.85), rgba(0, 32, 90, 0.9));
    overflow: hidden;
}

/* Hide hero elements by default to prevent flash before JS loads */
.hero-content h1,
.hero-content h2,
.hero-content .intro,
.hero-content .cta-buttons,
.badge-kokoomus,
.scroll-indicator {
    opacity: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../images/photo.jpg') center/cover no-repeat;
    z-index: -2;
    opacity: 0;
    transform-origin: center center;
    will-change: transform;
    overflow: hidden;
    transition: opacity 2s ease-in-out;
    box-shadow: inset 0 0 100px rgba(0, 32, 90, 0.3);
    filter: contrast(1.1);
}

.hero-background.loaded {
    opacity: 1.0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 32, 90, 0.3);
    opacity: 0.4;
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 0;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
    opacity: 0.9;
}

.hero-content .intro {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.badges-container {
    position: relative;
    display: inline-block;
}

.badge-kokoomus {
    position: absolute;
    top: -65px;
    right: -130px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background-color: var(--kokoomus-gold);
    color: var(--kokoomus-dark-blue);
    font-weight: 900;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: rotate(15deg);
    animation: floating 3s ease-in-out infinite;
    z-index: -1;
}

.btn {
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-fast) ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.8s ease;
    z-index: -1;
}

.btn:hover::after {
    left: 100%;
}

.btn-primary {
    background-color: var(--kokoomus-blue);
    border: 2px solid var(--kokoomus-blue);
}

.btn-primary:hover {
    background-color: var(--kokoomus-dark-blue);
    border-color: var(--kokoomus-dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--kokoomus-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 3;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 25px;
    position: relative;
    margin: 0 auto 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: white;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
    animation: scrollWheel 2s infinite;
}

.animated-arrow {
    display: inline-block;
    animation: bounce 2s infinite;
    font-size: 1.2rem;
}

.scroll-text {
    font-size: 12px;
    margin-top: 5px;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Section Styles */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-weight: 800;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--kokoomus-gold);
}

/* About Section */
#about {
    background-color: var(--finnish-light);
}

.about-content {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    position: relative;
    /* Paper texture style for about section */
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 25px 25px;
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent #f0f0f0 transparent transparent;
}

.about-image {
    position: relative;
    padding: 16px;
    background-color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    transform: rotate(-2deg);
    transition: transform var(--transition-medium) ease, box-shadow var(--transition-medium) ease;
    overflow: hidden;
    /* Kokoomus-themed border */
    border: 2px solid var(--kokoomus-blue);
}

/* Permanent shine element - always visible */
.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.7) 0%,
        transparent 50%,
        rgba(0,0,0,0.05) 100%);
    z-index: 3;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity var(--transition-medium) ease;
}

/* Moving shine animation effect */
.about-image::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.7) 50%,
        rgba(255,209,0,0.2) 51%,
        rgba(255,255,255,0) 100%);
    transform: rotate(45deg);
    z-index: 4;
    pointer-events: none;
    opacity: 0.3;
    animation: photoShine 5s ease-in-out infinite;
}

/* Add an additional shine element for extra gleam */
.about-image .shine-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 70% 20%,
        rgba(255,255,255,0.8) 0%,
        rgba(255,255,255,0.3) 10%,
        transparent 60%);
    z-index: 5;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes photoShine {
    0% {
        opacity: 0;
        transform: translateX(-100%) rotate(45deg);
    }
    15% {
        opacity: 0.2;
    }
    25% {
        opacity: 0.9;
    }
    35% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateX(100%) rotate(45deg);
    }
}

.about-image:hover {
    transform: rotate(0deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 61, 165, 0.2);
}

.about-image:hover::before {
    opacity: 0.5;
}

.about-image:hover::after {
    animation-duration: 3s;
    opacity: 0.5;
}

.about-image img {
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-medium) ease, filter var(--transition-medium) ease;
    filter: contrast(1.05) brightness(1.02);
    position: relative;
    z-index: 1;
}

.about-image:hover img {
    transform: scale(1.02);
    filter: contrast(1.08) brightness(1.04);
}

/* Inner border for photo edge - Kokoomus themed */
.about-image .photo-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 3;
    border: 3px solid var(--kokoomus-blue);
    border-bottom-color: var(--kokoomus-gold);
    border-right-color: var(--kokoomus-gold);
}

/* Add taped photo elements using additional divs */
.about-image .tape-top,
.about-image .tape-bottom {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 4;
    pointer-events: none;
    /* Add subtle Kokoomus gold accent */
    border-left: 2px solid var(--kokoomus-gold);
}

.about-image .tape-top {
    width: 100px;
    height: 25px;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    opacity: 0.9;
}

.about-image .tape-bottom {
    width: 70px;
    height: 20px;
    bottom: -5px;
    right: 30px;
    transform: rotate(-3deg);
    opacity: 0.8;
}

.about-text {
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-text .highlight {
    color: var(--kokoomus-blue);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.about-text .highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: rgba(255, 209, 0, 0.3);
    z-index: -1;
}

.theme-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-medium) ease;
    position: relative;
    border-left: 4px solid var(--kokoomus-blue);
}

.theme-card:nth-child(even) {
    border-left-color: var(--kokoomus-gold);
}

.theme-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.highlight-title {
    color: var(--kokoomus-blue);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    font-family: 'Indie Flower', cursive;
}

.highlight-title::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 7px;
    background-color: rgba(255, 209, 0, 0.3);
    z-index: -1;
}

/* Policies Section */
#policies {
    background-color: var(--finnish-gray);
}

.policy-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-medium) ease;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.policy-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.policy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--kokoomus-blue), var(--kokoomus-dark-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-medium) ease;
}

.policy-card:hover::before {
    transform: scaleX(1);
}

.policy-card .icon {
    font-size: 3rem;
    color: var(--kokoomus-blue);
    margin-bottom: 1.5rem;
    transition: transform var(--transition-fast) ease;
}

.policy-card:hover .icon {
    transform: scale(1.1);
}

.policy-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.policy-card p {
    color: var(--text-medium);
    margin-bottom: 0;
}

/* Achievements Section */
#achievements {
    background-color: var(--finnish-white);
}

.timeline {
    position: relative;
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--kokoomus-blue);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    margin-bottom: 2.5rem;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border: 4px solid var(--kokoomus-blue);
    border-radius: 50%;
    top: 15px;
    z-index: 1;
    transition: all var(--transition-fast) ease;
}

.timeline-item.left::after {
    right: -10px;
}

.timeline-item.right::after {
    left: -10px;
}

.timeline-item:hover::after {
    background-color: var(--kokoomus-gold);
    transform: scale(1.2);
}

.timeline-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all var(--transition-medium) ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.timeline-content::before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 10px;
    top: 15px;
}

.timeline-item.left .timeline-content::before {
    border-color: transparent white transparent transparent;
    right: -20px;
}

.timeline-item.right .timeline-content::before {
    border-color: transparent transparent transparent white;
    left: -20px;
}

.timeline-content h3 {
    color: var(--kokoomus-blue);
    margin-bottom: 0.5rem;
}

.timeline-content .date {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-content p {
    margin-bottom: 0;
}

/* Contact Section */
#contact {
    background-color: var(--finnish-light);
}

.info-item {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: all var(--transition-medium) ease;
}

.info-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.info-item .icon {
    font-size: 3rem;
    color: var(--kokoomus-blue);
    margin-bottom: 1.5rem;
}

.info-item p {
    margin-bottom: 0;
    color: var(--text-medium);
}

.protected-email,
.protected-phone {
    cursor: pointer;
    transition: color var(--transition-fast) ease;
    position: relative;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: rgba(0, 61, 165, 0.05);
    display: inline-block;
}

.protected-email:hover,
.protected-phone:hover {
    color: var(--kokoomus-blue);
    background-color: rgba(0, 61, 165, 0.1);
}

.protected-email[data-protected="true"]::before,
.protected-phone[data-protected="true"]::before {
    content: "\f023";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
    color: var(--kokoomus-blue);
}

.protected-email[data-protected="false"]::before,
.protected-phone[data-protected="false"]::before {
    content: "\f13e";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
    color: var(--kokoomus-gold);
}

/* Footer */
.footer {
    background-color: var(--kokoomus-dark-blue);
    color: white;
    padding: 3rem 0;
}

.footer-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav li {
    margin: 0.5rem 1rem;
}

.footer-nav a {
    color: white;
    opacity: 0.8;
    transition: opacity var(--transition-fast) ease;
    font-size: 0.95rem;
    white-space: nowrap;
}

.footer-nav a:hover {
    opacity: 1;
    color: white;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--kokoomus-blue);
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: var(--kokoomus-dark-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Animation Keyframes */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        top: 8px;
    }
    100% {
        opacity: 0;
        top: 30px;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes floating {
    0% {
        transform: translateY(0) rotate(15deg);
    }
    50% {
        transform: translateY(-10px) rotate(15deg);
    }
    100% {
        transform: translateY(0) rotate(15deg);
    }
}

/* AOS library customizations */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Media Queries */
@media (max-width: 991px) {
    section {
        padding: 4rem 0;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content h2 {
        font-size: 1.6rem;
    }

    .hero-content .intro {
        font-size: 1.2rem;
    }

    .badge-kokoomus {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        top: -10px;
        right: -100px;
    }

    /* Timeline adjustments for tablet */
    .timeline::before {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item.right {
        left: 0;
    }

    .timeline-item::after {
        left: 21px;
    }

    .timeline-item.left::after {
        right: auto;
        left: 21px;
    }

    .timeline-item.left .timeline-content::before {
        border-color: transparent transparent transparent white;
        right: auto;
        left: -20px;
        transform: rotate(180deg);
    }

    .navbar-collapse {
        background-color: white;
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }

    .navbar-nav {
        text-align: center;
    }

    .nav-item {
        margin: 0.25rem 0;
    }

    .nav-link {
        display: inline-block;
    }

    .navbar .container {
        padding-right: 5px;
    }

    .navbar-toggler {
        margin-left: 5px;
    }
}

@media (max-width: 767px) {
    section {
        padding: 3rem 0;
    }

    .hero-section {
        min-height: 600px;
    }

    .hero-content h1 {
        font-size: 2.4rem;
    }

    .hero-content h2 {
        font-size: 1.4rem;
    }

    .hero-content .intro {
        font-size: 1.1rem;
    }

    .badge-kokoomus {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        top: -5px;
        right: -80px;
    }

    .about-content {
        padding: 2rem;
    }

    .theme-card,
    .policy-card,
    .info-item {
        margin-bottom: 1.5rem;
    }

    .footer {
        padding: 2rem 0;
    }

    .footer-nav {
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .footer-nav li {
        margin: 0.5rem;
    }

    .navbar-brand .logo-img {
        height: 35px;
    }
}

@media (max-width: 575px) {
    section {
        padding: 2.5rem 0;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content h2 {
        font-size: 1.2rem;
    }

    .hero-content .intro {
        font-size: 1rem;
    }

    .badge-kokoomus {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        top: -5px;
        right: -60px;
    }

    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Fix timeline alignment on small mobile screens */
    .timeline::before {
        left: 20px; /* Adjust the vertical line position */
    }

    .timeline-item {
        padding-left: 50px; /* Reduce left padding */
        padding-right: 10px; /* Reduce right padding */
    }

    .timeline-item::after {
        left: 10px; /* Adjust the circle position to align with line */
        width: 16px; /* Make circles slightly smaller */
        height: 16px; /* Make circles slightly smaller */
    }

    .timeline-item.left::after {
        left: 10px; /* Ensure left items' circles align with the timeline */
    }

    .timeline-item.left .timeline-content::before,
    .timeline-item.right .timeline-content::before {
        left: -15px; /* Adjust the arrow position */
        border-width: 8px; /* Make arrows slightly smaller */
    }

    .about-content,
    .theme-card,
    .policy-card,
    .timeline-content,
    .info-item {
        padding: 1.5rem;
    }

    .section-title {
        margin-bottom: 2rem;
        font-size: 1.8rem;
    }

    .section-title::after {
        width: 60px;
        bottom: -10px;
    }

    .policy-card .icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .scroll-to-top {
        right: 20px;
        bottom: 20px;
        width: 40px;
        height: 40px;
    }

    .navbar-brand .logo-img {
        height: 30px;
    }

    .footer-nav {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-nav li {
        margin: 0.3rem 0;
    }

    .footer {
        padding: 2rem 0;
        text-align: center;
    }

    .copyright {
        margin-top: 1rem;
    }
}

/* Light Ray and Particle Effects for Hero Background */
.color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.light-rays-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.light-ray {
    position: absolute;
    height: 200%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform-origin: top left;
    will-change: transform, opacity;
    opacity: 0;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    filter: blur(1px);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Dissolve Particles Effect */
.dissolve-particles-container {
    position: absolute;
    pointer-events: none;
    z-index: 999;
    overflow: visible;
}

.dissolve-particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity, scale;
    filter: blur(1px);
    transform-origin: center center;
    transition: none !important;
}

.dissolve-text-particle {
    position: absolute;
    transform-origin: center center;
    will-change: transform, opacity, scale, rotation;
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
    user-select: none;
    transition: none !important;
}

/* Animation for dissolving elements */
@keyframes dissolveFlash {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 0; }
}

.dissolving {
    position: relative;
    z-index: 1;
    transition: opacity 0.5s ease-out;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Make the dissolve effect work with AOS animations */
[data-aos].dissolving {
    transition: transform 0.5s, opacity 0.5s;
    opacity: 0;
    transform: translateY(20px);
}

/* Help prevent flickering during animations */
.dissolve-particles-container * {
    backface-visibility: hidden;
}

/* Election Information Section */
#election-info {
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.election-sticker {
    background: linear-gradient(135deg, #006288 0%, #0078aa 100%);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.election-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.election-icon {
    font-size: 28px;
    background-color: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.election-header h3 {
    font-size: 28px;
    margin: 0;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.election-content {
    position: relative;
    z-index: 2;
}

.election-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 16px;
}

.election-details {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.election-dates, .election-info {
    flex: 1;
    min-width: 300px;
}

.election-dates p, .election-info p {
    margin-bottom: 10px;
    font-weight: 500;
}

.election-types {
    margin: 25px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.election-types h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
}

.election-types p {
    margin-bottom: 12px;
}

.election-footer {
    font-weight: 600;
    font-size: 18px !important;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.election-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100px;
    height: 100px;
    background-color: #ffce00;
    color: #006288;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    transform: rotate(15deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.election-badge::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px dashed #006288;
    border-radius: 50%;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .election-details {
        flex-direction: column;
    }

    .election-dates, .election-info {
        min-width: 100%;
    }

    .election-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .election-header h3 {
        font-size: 22px;
    }

    .election-badge {
        width: 80px;
        height: 80px;
        font-size: 22px;
    }
}

/* Mobile language selector */
.mobile-lang-selector {
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.mobile-lang-selector .btn {
    background-color: rgba(0, 61, 165, 0.1);
    border: 1px solid rgba(0, 61, 165, 0.2);
    color: var(--kokoomus-blue);
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
}

.mobile-lang-selector .dropdown-menu {
    min-width: auto;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.mobile-lang-selector .dropdown-item {
    padding: 8px 15px;
    font-size: 14px;
}

/* Community link in About section */
.community-link {
    margin-top: 15px;
    margin-bottom: 25px;
}

.article-link {
    display: inline-block;
    background-color: rgba(0, 61, 165, 0.1);
    color: var(--kokoomus-blue);
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 61, 165, 0.2);
}

.article-link:hover {
    background-color: rgba(0, 61, 165, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.article-link i {
    margin-right: 8px;
}