@import url('styles.css');

.challenges-main {
    padding: 80px 5%;
    background-color: var(--mid-bg);
}

.challenges-section .header {
    text-align: center;
    margin-bottom: 60px;
}

.challenges-section .title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 3.5em;
    font-weight: 800;
    color: var(--dark-text);
    margin-bottom: 10px;
}

.challenges-section .subtitle {
    font-size: 1.2em;
    color: var(--paragraph-color);
}

.challenge-group {
    margin: 60px 0;
    padding: 30px;
    background-color: var(--light-bg);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.group-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.2em;
    font-weight: 800;
    color: var(--accent-teal);
    text-align: center;
    margin-bottom: 40px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.challenge-card {
    background-color: #f8f8f8;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.challenge-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 15px;
}

.video-container {
    position: relative;
    width: 100%;
    /* Standard 16:9 proportion for horizontal videos */
    padding-top: 56.25%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.challenge-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background-color: var(--dark-bg);
    color: white;
    border-radius: 12px;
    text-align: center;
}

.challenge-icon {
    font-size: 3.5em;
    color: var(--accent-orange);
    margin-bottom: 20px;
}

.placeholder-text {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 10px;
}

.placeholder-subtitle {
    font-size: 1em;
    color: #ccc;
}

/* CORRECTED: Styles for vertical Shorts playlists (9:16 aspect ratio) */
.playlist-container {
    position: relative;
    width: 100%;
    /* 9:16 aspect ratio for Shorts: 16 / 9 * 100% = 177.77% */
    padding-top: 57.77%; 
    max-width: 230px; /* Limits the width on large screens */
    
    margin: 0 auto 20px auto; /* Centers the container */
}

.playlist-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.playlist-description {
    text-align: center;
    color: var(--paragraph-color);
    font-size: 1em;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .challenges-main {
        padding: 40px 3%;
    }

    .challenges-section .title {
        font-size: 2.5em;
    }

    .group-title {
        font-size: 1.8em;
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    /* On mobile, allow the vertical playlist to take most of the width */
    .playlist-container {
        max-width: 280px;
        height: 500px;
    }
}