﻿/* --- CTF Page Styling --- */

.ctf-track-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 15px;
}

.track-tab {
    background-color: #2d3748;
    font-size: 16px;
    padding: 8px 16px;
}

    .track-tab:hover {
        background-color: #1a202c;
    }

.btn-secondary {
    background-color: #718096;
    font-size: 15px;
}

    .btn-secondary:hover {
        background-color: #4a5568;
    }

.ctf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Prevents columns from expanding */
    gap: 20px;
    margin-bottom: 20px;
}

.ctf-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 0;
    height: 100%;
    min-width: 0; /* Ensures flex/grid items can shrink below content size */
}

.ctf-card-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.ctf-title {
    font-size: 20px;
    color: #2d3748;
    margin-top: 8px;
    font-weight: 700;
}
.ctf-card-body {
    flex-grow: 1; /* Pushes the card footer to the very bottom */
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    margin-top: 0;
}

    .ctf-card-body p {
        flex-grow: 1; /* Ensures short content area occupies full height */
        font-size: 16px;
        line-height: 1.6;
        color: #4a5568;
        text-align: left;
        margin-top: 0;
        /* Forces long uninterrupted text/code strings to wrap */
        overflow-wrap: anywhere;
        word-break: break-word;
    }

.ctf-card-footer {
    margin-top: auto; /* Keeps buttons aligned on the bottom row */
}

.ctf-action-btn {
    width: 100%;
    text-decoration: none;
    font-size: 15px;
    padding: 12px 10px;
}

.btn-login {
    background-color: #3498db;
}

    .btn-login:hover {
        background-color: #2c80b4;
    }

.btn-buy {
    background-color: #718096;
}

    .btn-buy:hover {
        background-color: #4a5568;
    }

.btn-unlocked {
    background-color: #2ecc71;
}

    .btn-unlocked:hover {
        background-color: #27ae60;
    }

.difficulty-badge {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    text-transform: uppercase;
}

    .difficulty-badge.beginner {
        background-color: #c6f6d5;
        color: #22543d;
    }

    .difficulty-badge.intermediate {
        background-color: #feebc8;
        color: #744210;
    }

    .difficulty-badge.advanced {
        background-color: #fed7d7;
        color: #742a2a;
    }

@media screen and (max-width: 900px) {
    .ctf-grid {
        grid-template-columns: 1fr;
    }

    .ctf-track-selector {
        flex-direction: column;
    }

    .track-tab {
        width: 100%;
    }

    .banner-box {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}
