/* ================= GLOBAL STYLES ================= */




/* ================= FILTER STYLES ================= */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.filters label {
    font-weight: bold;
    margin-right: 0.5rem;
}

.filters select {
    padding: 0.4rem 0.6rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    min-width: 120px;
}

.filters div {
    display: flex;
    align-items: center; /* keeps label and select inline */
    gap: 0.5rem;        /* space between label and select */
}

.filters .small {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive adjustments */
/* ==============================
   FILTERS - 768px MEDIA QUERY
============================== */
@media (max-width: 768px) {

    .filters {
        flex-direction: column;   /* stack filters vertically */
        align-items: stretch;     /* full width */
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .filters div {
        flex-direction: column;   /* label above select */
        align-items: stretch;
        gap: 0.25rem;
    }

    .filters select {
        min-width: 100%;          /* full width on small screens */
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }

    .filters label {
        font-size: 0.85rem;
        margin-right: 0;          /* remove horizontal spacing */
    }

    .filters .small {
        font-size: 0.8rem;
    }
}


/* ================= SELECT STYLES ================= */
.filters select {
    padding: 0.4rem 0.6rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    min-width: 120px;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Hover effect */
.filters select:hover {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

/* Focus effect (after clicking/selecting) */
.filters select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0,86,179,0.4);
    background: #fefefe;
}

/* Optional: Change option background on hover in dropdown */
.filters select option:hover {
    background-color: #f0f8ff;
}

/* ================= MEDIA QUERIES 768px ================= */
@media (max-width: 768px) {

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .filters div {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .filters select {
        min-width: 100%;
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }

    .filters label {
        font-size: 0.85rem;
        margin-right: 0;
    }

    .filters .small {
        font-size: 0.8rem;
    }
}




/* ================= CARD STYLES ================= */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.card h2 {
    margin-top: 0;
}

.card .small {
    color: #666;
    font-size: 0.9rem;
}



/* ================= MEDIA QUERIES 768px ================= */
@media (max-width: 768px) {

    .card {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    .card h2 {
        font-size: 1.1rem;
    }

    .card .small {
        font-size: 0.8rem;
    }
}




/* ================= CANDIDATE GRID ================= */
#candidates-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.candidate-card {
    background: #fafafa;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s;
}


.candidate-content {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.candidate-image img {
    width: 170px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.candidate-details h3 {
    margin: 0 0 0.5rem 0;
}

.candidate-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.candidate-details .btn {
    margin-top: 0.5rem;
    padding: 0.5rem 0.8rem;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.candidate-details .btn:hover {
    background: #0056b3;
}


/* ================= MEDIA QUERIES 768px ================= */
@media (max-width: 768px) {

    #candidates-display {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .candidate-content {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .candidate-image img {
        width: 100%;
        max-width: 150px;
        height: auto;
    }

    .candidate-details h3 {
        font-size: 1rem;
        text-align: center;
    }

    .candidate-details p {
        font-size: 0.85rem;
        text-align: start;
    }

    .candidate-details .btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.45rem 0;
    }
}



/* ================= MODAL STYLES ================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right:0;
    bottom:0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.candidate-full {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.modal-image img {
    width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.modal-details {
    flex: 1;
    min-width: 250px;
}

.modal-details h2 {
    margin-top: 0;
}

.modal-details p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* ================= SCROLL LOCK ================= */
body.no-scroll {
    overflow: hidden;
}

/* ================= RESPONSIVE ================= */
/* ================= MEDIA QUERIES 768px ================= */
@media (max-width: 768px) {

    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .candidate-full {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .modal-image img {
        width: 100%;
        max-width: 180px;
        height: auto;
    }

    .modal-details {
        min-width: auto;
        text-align: start;
    }

    .modal-details h2 {
        font-size: 1.2rem;
    }

    .modal-details p {
        font-size: 0.85rem;
    }
}



/* ================= CANDIDATE DETAIL PAGE ================= */
#candidate-detail {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    background: #f7f7f7;
}

#candidate-detail .card {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #fff;
}

#candidate-detail #back-btn {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.8rem;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

#candidate-detail #back-btn:hover {
    background: #0056b3;
}

#candidate-detail .candidate-full {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

#candidate-detail .modal-image {
    flex-shrink: 0;
}

#candidate-detail .modal-image img {
    width: 250px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

#candidate-detail .modal-details {
    flex: 1;
    min-width: 300px;
}

#candidate-detail .modal-details h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

#candidate-detail .modal-details p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ================= RESPONSIVE ================= */
/* ================= MEDIA QUERIES 768px ================= */
@media (max-width: 768px) {

    #candidate-detail {
        padding: 1rem;
    }

    #candidate-detail .card {
        padding: 1rem;
    }

    #candidate-detail .candidate-full {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    #candidate-detail .modal-image img {
        width: 100%;
        max-width: 180px;
        height: auto;
    }

    #candidate-detail .modal-details {
        min-width: auto;
        text-align: start;
    }

    #candidate-detail .modal-details h2 {
        font-size: 1.2rem;
    }

    #candidate-detail .modal-details p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    #candidate-detail #back-btn {
        width: 100%;
        text-align: center;
        padding: 0.5rem;
    }
}




/* ==========================
   Pagination Controls
========================== */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 0;
    font-size: 0.95rem;
    color: #333;
}

.pagination-controls .btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pagination-controls .btn:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.pagination-controls .btn:disabled {
    background-color: #d6d6d6;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.pagination-controls .page-info {
    font-weight: 500;
    color: #555;
    background: #f1f1f1;
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 180px;
    text-align: center;
}

.card .pagination-controls {
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 12px;
}


/* ==========================
   Pagination Controls (≤768px)
========================== */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 8px;
        margin-top: 12px;
        padding: 8px 0;
        font-size: 0.85rem;
    }

    .pagination-controls .btn {
        width: 100%;
        max-width: 240px;
        padding: 8px 0;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .pagination-controls .page-info {
        min-width: auto;
        width: 100%;
        max-width: 240px;
        font-size: 0.85rem;
        padding: 8px 0;
    }

    .card .pagination-controls {
        margin-top: 8px;
        padding-top: 10px;
    }
}
