/* Mobile-optimized styles with accessible language selector */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    font-size: 16px; /* Base font size */
}

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

/* Header styles with mobile optimization */
.header {
    background-color: #003366; /* Prussian blue for header */
    color: white;
    padding: 1rem 0;
    position: relative; /* For mobile menu positioning */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo-language-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    font-size: 1.2rem; /* Smaller on mobile */
    font-weight: bold;
    padding: 0.5rem 0;
}

/* Language selector - always visible */
.language-selector {
    display: flex;
    gap: 0.5rem;
    margin-left: auto; /* Push to the right */
    margin-right: 1rem; /* Space from hamburger menu */
}

.flag {
    width: 30px;
    height: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.flag:hover {
    transform: scale(1.1);
}

.flag.active {
    border: 2px solid white;
}

/* Flag styles using actual flag images */
.norwegian-flag {
    background-image: url('images/norway_flag.png');
    background-size: cover;
    background-position: center;
    display: block !important;
    visibility: visible !important;
}

.swedish-flag {
    background-image: url('images/sweden_flag.png');
    background-size: cover;
    background-position: center;
    display: block !important;
    visibility: visible !important;
}

/* Mobile menu button */
.mobile-menu-button {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

/* Hero section */
.hero {
    background-color: #003366; /* Prussian blue for hero */
    color: white;
    padding: 3rem 0; /* Reduced padding on mobile */
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero h1 {
    font-size: 2rem; /* Smaller on mobile */
    margin: 0;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem; /* Smaller on mobile */
    margin: 0;
}

.button-group {
    display: flex;
    gap: 0.75rem; /* Reduced gap on mobile */
    margin-top: 1rem;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}

.btn-primary {
    background-color: #005f9e; /* Lighter blue for buttons */
    color: white;
    padding: 0.75rem 1.25rem; /* Slightly smaller padding */
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    margin-bottom: 0.5rem; /* Space between wrapped buttons */
}

.btn-secondary {
    background-color: transparent;
    color: white;
    padding: 0.75rem 1.25rem; /* Slightly smaller padding */
    border-radius: 0.25rem;
    text-decoration: none;
    border: 2px solid white;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    margin-bottom: 0.5rem; /* Space between wrapped buttons */
}

/* Section styles */
.section {
    padding: 3rem 0; /* Reduced padding on mobile */
}

.section-title {
    font-size: 1.75rem; /* Smaller on mobile */
    color: #003366; /* Prussian blue for titles */
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem; /* Smaller on mobile */
    margin-bottom: 1.5rem;
    color: #005f9e; /* Lighter blue for subtitles */
}

.bg-light {
    background-color: #e6f0f9; /* Very light blue for alternating sections */
}

/* Grid layout with improved mobile responsiveness */
.grid {
    display: grid;
    gap: 1.5rem; /* Reduced gap on mobile */
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 51, 102, 0.1);
    padding: 1.25rem; /* Slightly reduced padding on mobile */
    border: 1px solid #e6f0f9; /* Light blue border */
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.3rem; /* Smaller on mobile */
    color: #003366; /* Prussian blue for titles */
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

/* Feature styles */
.feature-icon {
    width: 3.5rem; /* Slightly smaller on mobile */
    height: 3.5rem; /* Slightly smaller on mobile */
    background-color: #003366; /* Prussian blue for icons */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* Smaller on mobile */
    margin: 0 auto 0.75rem;
}

/* Teacher profile section */
.teacher-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.teacher-image-container {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 4px solid #003366; /* Prussian blue border */
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.2);
}

.teacher-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.teacher-info {
    max-width: 600px;
    margin: 0 auto;
}

.teacher-name {
    font-size: 1.5rem;
    color: #003366; /* Prussian blue */
    margin-bottom: 0.5rem;
}

.teacher-title {
    font-size: 1.1rem;
    color: #005f9e; /* Lighter blue */
    margin-bottom: 1rem;
    font-style: italic;
}

.teacher-bio {
    margin-bottom: 1.5rem;
}

.teacher-credentials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.credential {
    background-color: #e6f0f9; /* Light blue background */
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: #003366; /* Prussian blue */
}

/* CTA section */
.cta-section {
    background-color: #003366; /* Prussian blue for CTA */
    color: white;
    padding: 3rem 0; /* Reduced padding on mobile */
    text-align: center;
}

.cta-section h2 {
    font-size: 1.75rem; /* Smaller on mobile */
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.cta-section p {
    font-size: 1.1rem; /* Smaller on mobile */
    margin-bottom: 1.5rem;
}

/* Footer styles */
.footer {
    background-color: #002244; /* Darker Prussian blue for footer */
    color: white;
    padding: 3rem 0 1.5rem; /* Reduced padding on mobile */
}

.footer-title {
    font-size: 1.1rem; /* Smaller on mobile */
    margin-bottom: 0.75rem;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #cce0f5; /* Light blue for links */
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid #004477; /* Medium blue border */
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    text-align: center;
    color: #cce0f5; /* Light blue text */
    font-size: 0.9rem; /* Smaller on mobile */
}

/* Utility classes */
.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 1.5rem; /* Reduced on mobile */
}

.mt-4 {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 1.5rem; /* Reduced on mobile */
}

.text-blue {
    color: #003366; /* Prussian blue */
}

.content-list {
    list-style-position: inside;
    margin-bottom: 1rem;
    padding-left: 0.5rem; /* Reduced on mobile */
}

.content-list li {
    margin-bottom: 0.5rem;
}

/* Flag colors */
.norwegian-flag-color {
    background-color: #ef2b2d; /* Norwegian red */
    color: white;
}

.swedish-flag-color {
    background-color: #006aa7; /* Swedish blue */
    color: white;
}

.flag-accent {
    border-left: 4px solid #ef2b2d; /* Norwegian red */
    padding-left: 0.75rem; /* Reduced on mobile */
}

.flag-accent.swedish {
    border-left: 4px solid #006aa7; /* Swedish blue */
}

/* Tab styles for curriculum sections */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow tabs to wrap on mobile */
}

.tab {
    padding: 0.75rem 1rem; /* Reduced padding on mobile */
    cursor: pointer;
    border: 1px solid #e6f0f9;
    background-color: #f8f9fa;
    flex: 1; /* Equal width tabs */
    text-align: center;
    min-width: 120px; /* Ensure minimum width */
}

.tab.active {
    background-color: #003366;
    color: white;
    border-color: #003366;
}

.tab:first-child {
    border-radius: 0.25rem 0 0 0.25rem;
}

.tab:last-child {
    border-radius: 0 0.25rem 0.25rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Language content visibility */
.language-content {
    display: none; /* Hide all language content by default */
}

.language-content.active {
    display: block; /* Only show active language content */
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    /* Mobile navigation */
    .mobile-menu-button {
        display: block;
    }
    
    .nav-links {
        display: none; /* Hide by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #003366;
        padding: 1rem;
        z-index: 100;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        display: flex; /* Show when active */
    }
    
    .nav-links a {
        padding: 0.75rem 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    /* Language selector is now outside the nav-links */
    .language-selector {
        display: flex !important; /* Always visible */
    }
    
    /* Adjust grid for mobile */
    .grid {
        gap: 1rem;
    }
    
    /* Teacher profile adjustments for mobile */
    .teacher-image-container {
        width: 150px;
        height: 150px;
    }
    
    .teacher-name {
        font-size: 1.3rem;
    }
    
    .teacher-title {
        font-size: 1rem;
    }
    
    .credential {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Full-width buttons on very small screens */
    @media (max-width: 480px) {
        .btn-primary, .btn-secondary {
            width: 100%;
        }
        
        .button-group {
            flex-direction: column;
            width: 100%;
        }
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.25rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .md-grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    .md-grid-cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    /* On larger screens, language selector goes back in the nav-links */
    .language-selector {
        margin-left: 1.5rem;
        display: flex !important; /* Always visible */
    }
    
    .logo-language-container {
        width: auto;
    }
    
}
