/* Courses Page Styles */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Courses Hero Section */
.courses-hero {
    min-height: 50vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
}

.courses-hero-content {
    max-width: 800px;
}

.courses-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.courses-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Categories Section */
.categories-section {
    padding: 6rem 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    grid-auto-rows: min-content; /* This ensures rows only take up as much height as needed */
}

/* Category Cards */
.category-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto; /* Allow height to be determined by content */
}

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

/* Category Header (Clickable) */
.category-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(240, 249, 255, 0.8));
    transition: background 0.3s ease;
}


.category-header:hover {
    background: linear-gradient(to right, rgba(240, 249, 255, 0.8), rgba(224, 242, 254, 0.8));
}

.category-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.category-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.category-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.3rem;
}

.toggle-icon {
    margin-left: 1rem;
    transition: transform 0.3s ease;
}

.toggle-icon i {
    font-size: 1rem;
    color: var(--primary);
}

/* Category Content (Expandable) */
.category-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: max-height 0.5s ease, padding 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Active Category State */
.category-card.active .category-content {
    max-height: 1000px; /* High enough to accommodate content */
    padding: 1rem 1.5rem 1.5rem;
}

.category-card.active .toggle-icon {
    transform: rotate(180deg);
}

.category-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Course List */
.course-list {
    display: grid;
    gap: 1rem;
}

.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(240, 249, 255, 0.5);
    border-left: 3px solid var(--primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
    background: rgba(224, 242, 254, 0.7);
}

.course-item h4 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.course-btn {
    display: inline-flex;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

.course-btn i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.course-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Animation for course items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card.active .course-item {
    animation: fadeIn 0.5s ease forwards;
}

.category-card.active .course-item:nth-child(1) {
    animation-delay: 0.1s;
}

.category-card.active .course-item:nth-child(2) {
    animation-delay: 0.2s;
}

.category-card.active .course-item:nth-child(3) {
    animation-delay: 0.3s;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 4rem 2rem;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    margin-top: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-family: inherit;
}

.subscribe-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.subscribe-btn:hover {
    background: var(--primary-dark);
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-hero h1 {
        font-size: 3rem;
    }
}

@media screen and (max-width: 768px) {
    .courses-hero h1 {
        font-size: 2.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .subscribe-btn {
        width: 100%;
    }
    
    .category-header {
        padding: 1rem;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .category-header h3 {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 480px) {
    .courses-hero h1 {
        font-size: 2rem;
    }
    
    .course-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .course-btn {
        margin-top: 0.75rem;
    }
}