/* =========================================================
   HACKINGVICHAR — CHALLENGES PAGE
   Header + Footer remain unchanged
========================================================= */

.hv-challenges {
    max-width: 1180px;
    margin: 0 auto;
    padding: 35px 25px 80px;
    color: #202044;
}

/* =========================================================
   PAGE HERO
========================================================= */

.hv-challenge-hero {
    position: relative;
    overflow: hidden;
    padding: 55px 50px;
    margin-bottom: 35px;
    border-radius: 0 0 60px 0;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(239,112,108,.16),
            transparent 28%
        ),
        radial-gradient(
            circle at 10% 90%,
            rgba(80,75,150,.10),
            transparent 30%
        ),
        #f8f8fc;
}

.hv-challenge-hero::after {
    content: "{ CTF }";
    position: absolute;
    right: 25px;
    bottom: -30px;
    font-family: monospace;
    font-size: 100px;
    font-weight: 900;
    color: rgba(41,36,92,.035);
}

.hv-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hv-eyebrow {
    display: inline-block;
    color: #ef706c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 13px;
}

.hv-challenge-hero h1 {
    font-family: Georgia, serif;
    font-size: clamp(36px, 5vw, 55px);
    line-height: 1.1;
    color: #202044;
    margin: 0 0 15px;
}

.hv-challenge-hero h1 span {
    color: #514c83;
}

.hv-challenge-hero p {
    max-width: 650px;
    color: #777;
    line-height: 1.8;
    font-size: 15px;
    margin: 0;
}

/* =========================================================
   QUICK INFO
========================================================= */

.hv-challenge-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 35px;
}

.hv-challenge-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e9e8ef;
    border-radius: 15px;
}

.hv-stat-icon {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f0eff9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.hv-challenge-stat strong {
    display: block;
    color: #29245c;
    font-size: 18px;
}

.hv-challenge-stat span {
    color: #999;
    font-size: 11px;
}

/* =========================================================
   FILTER BAR
========================================================= */

.hv-filter-wrapper {
    margin-bottom: 30px;
}

.hv-filter-label {
    font-family: Georgia, serif;
    color: #29245c;
    font-size: 18px;
    margin-bottom: 13px;
}

.hv-filter-bar {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.hv-filter-btn {
    border: 1px solid #e1e0e9;
    background: white;
    color: #666;
    padding: 9px 17px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: .25s ease;
}

.hv-filter-btn:hover {
    border-color: #514c83;
    color: #514c83;
    transform: translateY(-1px);
}

.hv-filter-btn.active {
    background: #29245c;
    color: white;
    border-color: #29245c;
    box-shadow: 0 6px 15px rgba(41,36,92,.15);
}

/* =========================================================
   CHALLENGES GRID
========================================================= */

.hv-challenges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* =========================================================
   CHALLENGE CARD
========================================================= */

.hv-challenge-card {
    position: relative;
    background: white;
    border: 1px solid #e8e7ef;
    border-radius: 25px 0 25px 0;
    padding: 24px;
    cursor: pointer;
    overflow: hidden;
    transition: .3s ease;
}

.hv-challenge-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #514c83;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: .3s ease;
}

.hv-challenge-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(40,38,80,.10);
    border-color: #dedde9;
}

.hv-challenge-card:hover::before {
    transform: scaleY(1);
}

/* solved card */

.hv-challenge-card.solved {
    background: linear-gradient(
        135deg,
        #fff,
        #f8fbf8
    );
}

.hv-challenge-card.solved::before {
    background: #59a875;
    transform: scaleY(1);
}

/* card top */

.hv-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.hv-category {
    background: #efedf8;
    color: #4c477c;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.hv-difficulty {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
}

.hv-easy {
    background: #eaf7ef;
    color: #3f9560;
}

.hv-medium {
    background: #fff5df;
    color: #b77b17;
}

.hv-hard {
    background: #fff0ef;
    color: #d65c58;
}

.hv-insane {
    background: #eeeafa;
    color: #514c83;
}

.hv-points {
    margin-left: auto;
    color: #ef706c;
    font-size: 13px;
    font-weight: 800;
}

/* card body */

.hv-challenge-card h3 {
    font-family: Georgia, serif;
    color: #29245c;
    font-size: 21px;
    line-height: 1.3;
    margin: 0 0 12px;
}

.hv-challenge-description {
    color: #888;
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 22px;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* card footer */

.hv-card-footer {
    border-top: 1px solid #f0eff3;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.hv-solves-btn {
    background: none;
    border: none;
    padding: 0;
    color: #888;
    font-size: 11px;
    cursor: pointer;
}

.hv-solves-btn strong {
    color: #29245c;
}

.hv-solves-btn:hover {
    color: #29245c;
}

.hv-view {
    color: #514c83;
    font-size: 11px;
    font-weight: 800;
}

.hv-solved {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4d9a68;
    font-size: 11px;
    font-weight: 800;
}

/* =========================================================
   LOADING
========================================================= */

.hv-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    color: #888;
}

.hv-loader-circle {
    width: 42px;
    height: 42px;
    margin: 0 auto 15px;
    border: 3px solid #ebeaf2;
    border-top-color: #514c83;
    border-radius: 50%;
    animation: hvSpin .8s linear infinite;
}

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

.hv-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    border: 1px dashed #dddce5;
    border-radius: 20px;
    color: #888;
}

.hv-empty-icon {
    font-size: 35px;
    margin-bottom: 12px;
}

/* =========================================================
   CHALLENGE MODAL
========================================================= */

.hv-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(23,21,50,.68);
    backdrop-filter: blur(5px);

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.hv-modal-overlay.active {
    display: flex;
}

.hv-challenge-modal {
    position: relative;
    width: 100%;
    max-width: 650px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 30px 0 30px 0;
    padding: 35px;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);

    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hv-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: #f2f1f6;
    color: #666;
    font-size: 22px;
    cursor: pointer;
}

.hv-close:hover {
    background: #29245c;
    color: white;
}

.hv-modal-header {
    padding-right: 35px;
    margin-bottom: 20px;
}

.hv-modal-header h2 {
    font-family: Georgia, serif;
    font-size: 29px;
    color: #29245c;
    margin: 0 0 15px;
}

.hv-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.hv-modal-description {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    padding: 22px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* File */

.hv-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 11px 16px;
    border-radius: 9px;
    background: #f0eff9;
    color: #29245c;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.hv-file-link:hover {
    background: #29245c;
    color: white;
}

/* Flag */

.hv-flag-section {
    margin-top: 25px;
}

.hv-flag-section label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #29245c;
    margin-bottom: 9px;
}

.hv-flag-form {
    display: flex;
    gap: 9px;
}

.hv-flag-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #dddce5;
    border-radius: 9px;
    padding: 12px 14px;
    outline: none;
    font-family: monospace;
}

.hv-flag-input:focus {
    border-color: #514c83;
    box-shadow: 0 0 0 3px rgba(81,76,131,.08);
}

.hv-submit {
    border: none;
    background: #29245c;
    color: white;
    padding: 0 20px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
}

.hv-submit:hover {
    background: #514c83;
}

/* =========================================================
   SOLVES MODAL
========================================================= */

.hv-solves-modal {
    position: relative;
    width: 100%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 25px 0 25px 0;
    padding: 30px;
}

.hv-solves-modal h2 {
    font-family: Georgia, serif;
    color: #29245c;
    margin: 0 0 20px;
}

.hv-solves-table {
    width: 100%;
    border-collapse: collapse;
}

.hv-solves-table th {
    background: #f5f4f9;
    color: #555;
    font-size: 11px;
    text-align: left;
    padding: 11px;
}

.hv-solves-table td {
    border-bottom: 1px solid #eee;
    padding: 12px 11px;
    font-size: 12px;
    color: #777;
}

.hv-solves-table td:first-child {
    color: #29245c;
    font-weight: 700;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 950px) {

    .hv-challenges-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 700px) {

    .hv-challenge-hero {
        padding: 40px 25px;
        border-radius: 0 0 40px 0;
    }

    .hv-challenge-stats {
        grid-template-columns: 1fr;
    }

    .hv-challenges-grid {
        grid-template-columns: 1fr;
    }

    .hv-challenge-modal {
        padding: 25px;
    }

    .hv-flag-form {
        flex-direction: column;
    }

    .hv-submit {
        padding: 12px;
    }

}

@media (max-width: 450px) {

    .hv-challenges {
        padding: 25px 15px 60px;
    }

    .hv-challenge-hero h1 {
        font-size: 36px;
    }

    .hv-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

}