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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

main.main-visible {
    opacity: 1;
    visibility: visible;
}

h1, h2, h3 {
    color: #005a87;
    margin-bottom: 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

a {
    color: #e84a27;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #003c5a;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}


header {
    background-color: #005a87;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

nav .logo {
    font-size: 1.8rem;
    font-weight: bold;
    /* Logo is always visible */
}

nav ul,
nav .lang-switcher {
    /* Hide nav links and lang switcher initially */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

nav ul.nav-visible,
nav .lang-switcher.lang-switcher-visible {
    /* Class to make them visible */
    opacity: 1;
    visibility: visible;
}


nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: #fff;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    border-bottom-color: #e84a27;
}

.lang-switcher button {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.3rem 0.6rem;
    margin-left: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.lang-switcher button:hover,
.lang-switcher button.active-lang {
    background-color: #fff;
    color: #005a87;
}


.landing-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 4rem;
}

.landing-main h1 {
     background: linear-gradient(45deg, #005a87, #e84a27);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    font-size: 3.5rem;
}

.landing-main p {
    max-width: 600px;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    color: #555;
}

.landing-buttons .btn {
    background-color: #e84a27;
    color: #fff;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.landing-buttons .btn:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}


.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: #003c5a;
}

.card .class-date,
.card .lab-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
}

.card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
    color: #555;
}

.card-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-link {
    display: inline-block;
    background-color: #005a87;
    color: #fff !important;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
}

.card-link:hover {
    background-color: #e84a27;
    color: #fff !important;
}

.github-link {
    background-color: #555;
}
.github-link:hover {
    background-color: #333;
}


.class-detail-main,
.lab-detail-main {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-top: 1rem;
}

.class-detail-main h1,
.lab-detail-main h1 {
    text-align: left;
    font-size: 2.2rem;
}

.class-detail-main .class-date,
.lab-detail-main .lab-date {
    font-size: 1rem;
    color: #777;
    margin-bottom: 1.5rem;
    display: block;
}

.class-detail-main h2,
.lab-detail-main h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid #e84a27;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.detail-section h3 {
    font-size: 1.4rem;
    color: #005a87;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.detail-section ul,
.detail-section ol {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.detail-section ul li,
.detail-section ol li {
    margin-bottom: 0.5rem;
}

.detail-section p,
.detail-section li {
    color: #444;
}

.detail-section pre {
    background-color: #eee;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #333;
}

.detail-section code {
     font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
     background-color: #eee;
     padding: 0.1em 0.3em;
     border-radius: 3px;
}

.detail-section pre code {
    padding: 0;
    background: none;
    border-radius: 0;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: none;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.back-button {
    background-color: #6c757d;
    color: #fff !important;
    margin-top: 2rem;
}

.back-button:hover {
    background-color: #5a6268;
    color: #fff !important;
}

.github-button {
    background-color: #333;
    color: #fff !important;
    margin-top: 2rem;
    margin-left: 1rem;
}

.github-button:hover {
     background-color: #222;
     color: #fff !important;
}

footer {
    background-color: #e0e0e0;
    color: #555;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    .landing-main h1 {
        font-size: 2.8rem;
    }
    nav {
        flex-direction: column;
        align-items: stretch; /* Stretch items to full width */
    }
    nav .logo-link {
        align-self: center;
        margin-bottom: 1rem;
    }

    nav ul {
        margin-top: 0;
        flex-direction: column;
        width: 100%;
        /* Ensure ul is still hidden initially if needed */
        opacity: 0;
        visibility: hidden;
    }
    nav ul.nav-visible { /* Make visible */
        opacity: 1;
        visibility: visible;
    }

    nav ul li {
        margin-left: 0;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }
    nav ul li a {
         display: block;
         padding: 0.8rem;
         border-bottom: none;
    }
     nav ul li a:hover,
     nav ul li a.active {
        background-color: rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }
    .lang-switcher {
        margin-top: 1rem;
        align-self: center;
         /* Ensure switcher is hidden initially */
        opacity: 0;
        visibility: hidden;
    }
     .lang-switcher.lang-switcher-visible { /* Make visible */
        opacity: 1;
        visibility: visible;
    }

    .card-container {
        grid-template-columns: 1fr;
    }
}

.btn,
.card-link,
nav ul li a {
    display: inline-flex; /* Align icon and text */
    align-items: center;  /* Center items vertically */
    gap: 0.5em;           /* Space between icon and text */
    justify-content: center; /* Center content for button-like elements */
}

/* Specific adjustment for nav links if needed */
nav ul li a {
     justify-content: flex-start; /* Align nav text left */
}

/* Optional: Add a small margin if icons feel too close */
/*
.btn i,
.card-link i,
nav ul li a i {
     margin-right: 0.4em;
}
*/

/* Style adjustment for icon-only links/buttons if you add any */
.icon-only {
    padding: 0.6rem 0.8rem; /* Adjust padding */
    gap: 0; /* No gap needed */
}
.icon-only i {
    margin: 0; /* No margin needed */
}