* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Fredoka", sans-serif;
    height: 100vh;
    overflow-x: hidden;
}

.navbar {
    background-color: #663399;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1000;
}

.nav-item {
    position: relative;
    margin: 0 20px;
}

.nav-link {
    color: white;
    padding: 15px 20px;
    display: block;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #f9f9f9;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: none;
    z-index: 1001;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #663399;
    color: white;
}


/* Loading indicator */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 9999;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #663399;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content area */
.content {
    min-height: calc(100vh - 50px);
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    padding: 100px 20px;
    color: #663399;
}

.welcome-message h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.welcome-message p {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Loaded content styles - from welcome.css */
.content .hero {
    width: 100vw;
    min-height: 200px;
    background-image: url("./pictures/Hero_Banner4.png");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    padding: 1rem;
    margin: 0;
    position: relative;
}

.content .hero h1 {
    font-size: 2.5rem;
    margin: 0;
    text-align: center;
}

.content .centered-image {
    margin: 30px 0;
    text-align: center;
}

.content .centered-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.content h4 {
    margin-bottom: 5px;
    font-size: larger;
    text-decoration: underline;
    color: #663399;
}

.content p {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.5;
    color: #000;
}

.content .center-bottom {
    text-align: center;
    margin-top: 20px;
}

.content .images-and-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.content img {
    margin-bottom: 5px;
}

.content .small-image {
    width: 50px;
    height: 50px;
}

.content .tulevaisuuden-taidot {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
    color: #000;
}

.content .leftside {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: left;
    color: #000;
}

.content .tulevaisuuden-taidot__container {
    margin: 0 auto;
}

.content .tulevaisuuden-taidot__text {
    color: #000;
    margin-bottom: 20px;
}

.content .tulevaisuuden-taidot__text a {
    color: #663399;
    margin-bottom: 20px;
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.content .tulevaisuuden-taidot__text h2 {
    font-size: 36px;
    margin-bottom: 15px;
    color: #663399;
}

.content .tulevaisuuden-taidot__text p {
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #000;
}

.content .tulevaisuuden-taidot__image {
    text-align: center;
}

.content .tulevaisuuden-taidot__image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
}

.content .tinterface img {
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    margin-bottom: 20px;
}

.content .tinterface__image {
    text-align: center;
}

.content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.content a {
    color: #663399;
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content strong {
    font-weight: bold;
}

.content .toggle-section {
    width: 100%;
    max-width: 900px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
    overflow: hidden; /* Prevent content from overflowing */
}

.content .toggle-button {
    font-family: "Fredoka", Arial, sans-serif;
    font-weight: 600;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    padding: 15px 20px;
    background-color: #a453d9;
    color: #fff !important;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.content .toggle-button:hover {
    background-color: #8323c3;
    color: #fff !important;
}

/* Ensure all text inside toggle buttons is white */
.content .toggle-button *,
.content .toggle-button span,
.content .toggle-button div {
    color: #fff !important;
}

.content .toggle-button:hover *,
.content .toggle-button:hover span,
.content .toggle-button:hover div {
    color: #fff !important;
}

.content .toggle-content {
    font-family: "Fredoka", Arial, sans-serif;
    font-size: 18px;
    font-weight: 300;
    padding: 20px;
    border-top: 1px solid #ddd;
    animation: fadeIn 0.3s ease;
    color: #333;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

.content .toggle-content.hidden {
    display: none;
}

.content .button-icon {
    transition: transform 0.3s ease;
}

.content .toggle-button[aria-expanded="true"] .button-icon {
    transform: rotate(180deg);
}

.content .print-button-container {
    margin-top: 20px;
    text-align: center;
}

.content .print-button {
    font-family: "Fredoka", Arial, sans-serif;
    font-weight: 600;
    background-color: #a453d9;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.content .print-button:hover {
    background-color: #8323c3;
    transform: scale(1.05);
}

.content .printer-icon {
    margin-right: 8px;
    vertical-align: middle;
}

/* Additional content styles for lesson pages */
.content section {
    margin: 20px 0;
}

.content .leftside h2 {
    color: #663399;
    font-size: 28px;
    margin-bottom: 15px;
}

.content .leftside h4 {
    color: #663399;
    font-size: 20px;
    margin: 20px 0 10px 0;
    text-decoration: underline;
}

.content .tinterface {
    text-align: center;
    margin: 20px 0;
}


/* Ensure font consistency */
.content, .content * {
    font-family: "Fredoka", Arial, sans-serif;
}

/* Add constrained width and padding back for non-hero content */
.content > :not(.hero) {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Keep lesson content (toggle sections) with violet theme */
.content .toggle-section {
    color: inherit; /* Don't override lesson colors */
}

.content .toggle-section p,
.content .toggle-section li,
.content .toggle-section span {
    color: #333; /* Original lesson text color */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
        position: relative;
        padding: 50px 10px 10px 10px; /* Top padding for burger button */
        min-height: 50px;
    }
    
    .nav-item {
        width: 100%;
        margin: 0;
        display: none; /* Hidden by default */
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }
    
    .nav-item.show {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.95);
        border-radius: 0;
        display: block; /* Always show in mobile */
        margin-top: 0;
    }
    
    .dropdown-menu a {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
    }
    
    /* Burger menu button */
    .burger-menu {
        display: block;
        position: absolute;
        top: 12px;
        left: 15px;
        background: none;
        border: none;
        font-size: 24px;
        color: white;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        border-radius: 3px;
        transition: background-color 0.3s ease;
    }
    
    .burger-menu:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .burger-menu span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: white;
        margin: 5px 0;
        transition: 0.3s;
    }
    
    /* Animation for burger menu */
    .burger-menu.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .burger-menu.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Mobile content adjustments */
    .content {
        padding: 0;
    }
    
    .content > :not(.hero) {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Desktop-only hover effects */
@media screen and (min-width: 769px) {
    .burger-menu {
        display: none;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* Print styles */
@media print {
    .navbar, .loading, .burger-menu {
        display: none !important;
    }
    
    .content {
        height: auto !important;
        max-height: none !important;
    }
}