@import url('home.css');

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-inner {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
}

.course-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-alt-image {
        display: none;
    }

    .btn-alt {
        display: none;
    }
}

@media (max-width: 900px) {
    nav {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #0F2C43;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
        padding-bottom: 10px;
        display: none;
    }

    nav.open {
        max-height: 300px;
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
    }

    .nav-links li {
        text-align: center;
        margin: .5rem 0;
    }

    .menu-toggle {
        display: block;
    }
}

nav {
    display: flex;
    align-items: center;
}

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

nav li {
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
}

nav li a {
    padding: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
}

nav li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #FFC300;
}

.category {
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.category-header {
    width: 100%;
    background: #f9f9f9;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0F2C43;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.category-header span {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.category-header .arrow {
    transition: transform 0.3s ease;
}

.category-content {
    display: none;
    padding: 1rem;
    grid-gap: 1rem;
}

.category-content a {
    margin-top: 20px;
    text-align: center;
}

.category-content img {
    width: 400px;
    background-position: center;
    background-repeat: no-repeat;
}

.category.open .category-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.category.open .category-content .course-card {
    width: 100%;
}

@media (max-width: 500px) {
    .category.open .category-content img {
        width: 100%;
    }
}

.category.open .category-header .arrow {
    transform: rotate(90deg);
}

.loading-spinner {
    width: 64px;
    height: 64px;
    margin: 40px auto;
    border: 8px solid rgba(255, 195, 0, 0.2);
    border-top: 8px solid #FFC300;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-error {
    display: block;
    margin: 30px auto;
    padding: 15px 20px;
    max-width: 400px;
    text-align: center;
    font-weight: bold;
    color: #c00;
    background: #ffe5e5;
    border: 1px solid #f5c2c2;
    border-radius: 8px;
    position: relative;
    animation: shake 0.3s ease-in-out;
}

.loading-error::before {
    content: "⚠️";
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
    vertical-align: middle;
}

@keyframes shake {
    0% {
        transform: translateX(-5px);
    }

    25% {
        transform: translateX(5px);
    }

    50% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}