﻿/* =============================================== */
/* ======     USERS MANAGEMENT PAGE        ====== */
/* =============================================== */

.main-container {
    padding-top: 100px;
    padding-bottom: 40px;
    width: 100%;
}

.animated-heading {
    font-weight: 700;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: var(--white-text) !important;
}

/* --- Action Bar Styling --- */
.action-bar {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

#userSearchInput {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 10px;
    padding-left: 2.5rem; /* Space for the icon */
}

    #userSearchInput:focus {
        background: rgba(0, 0, 0, 0.5);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(66, 86, 161, 0.5);
    }

.search-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

/* --- Table Styling --- */
.table-wrapper {
    padding: 1.5rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(22, 29, 46, 0.4);
    --bs-table-hover-bg: rgba(66, 86, 161, 0.2);
    color: white;
    border-color: var(--border-color);
}

    .table thead th {
        color: white;
        font-weight: 600;
        border-bottom-width: 2px;
    }

    .table td, .table th {
        vertical-align: middle;
        color: white;
    }

.badge {
    padding: 0.5em 0.75em;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Modal Styling --- */
.modal-content {
    background: var(--dark-gradient);
    border: 1px solid var(--border-color);
    color: var(--light-text);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}
/* =============================================== */
/* ======         ROLE MANAGEMENT          ====== */
/* =============================================== */

.add-role-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.add-role-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

    .add-role-form .form-control {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-color);
        color: white;
    }

        .add-role-form .form-control:focus {
            background: rgba(0, 0, 0, 0.5);
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.25rem rgba(66, 86, 161, 0.5);
        }

/* Styling for the new interactive role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    padding: 0.4em 0.8em;
    margin: 2px;
    font-size: 0.85rem;
    color: var(--white-text);
}

.remove-role-btn {
    background: none;
    border: none;
    color: var(--white-text);
    margin-left: 8px;
    padding: 0;
    line-height: 1;
    font-size: 1.2em;
    font-weight: 700;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

    .remove-role-btn:hover {
        opacity: 1;
        cursor: pointer;
    }
/* =============================================== */
/* ======        LEARNING PATH PAGE        ====== */
/* =============================================== */
.main-container {
    padding-top: 100px;
    padding-bottom: 40px;
}

.topic-section {
    position: relative;
    padding: 2rem 0 2rem 2rem;
    border-left: 3px solid var(--border-color);
}

    .topic-section::before {
        content: '';
        position: absolute;
        left: -11px;
        top: 0;
        width: 20px;
        height: 20px;
        background-color: var(--primary-color);
        border-radius: 50%;
        border: 4px solid var(--dark-bg);
    }

.topic-title {
    color: var(--accent-yellow);
    font-weight: 700;
}

/* Material Card */
.material-card {
    border-left: 4px solid var(--primary-color);
}

    .material-card.done {
        opacity: 0.7;
        border-left-color: #28a745; /* Green */
    }

        .material-card.done .card-title {
            text-decoration: line-through;
            color: #6c757d !important;
        }

.form-check-input.material-done:checked {
    background-color: #28a745;
    border-color: #28a745;
}

/* Video Thumbnail */
.video-thumbnail-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.4);
    transition: background 0.3s;
}

.video-thumbnail-wrapper:hover .play-button-overlay {
    background: rgba(0,0,0,0.6);
}
/* =============================================== */
/* ======     TOPIC MANAGEMENT STYLES      ====== */
/* =============================================== */

.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    /* Re-using the glass-card style, so no need for background here */
}

/* Style for the item being dragged */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-color);
}

.drag-handle {
    cursor: grab;
    margin-right: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    transition: color 0.2s ease;
}

    .drag-handle:hover {
        color: var(--white-text);
    }

.topic-title {
    font-weight: 600;
    flex-grow: 1;
}

/* --- Visibility Toggle Switch --- */
.visibility-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

    .visibility-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #30363d;
    transition: .4s;
    border-radius: 28px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: var(--primary-color);
}

    input:checked + .slider:before {
        transform: translateX(22px);
    }

/* --- Modal Form --- */
.form-check.form-switch {
    display: flex;
    align-items: center;
    padding-left: 0;
}

    .form-check.form-switch .form-check-input {
        margin-left: 0;
        margin-right: 10px;
        height: 1.5em;
        width: 2.5em;
    }
/* =============================================== */
/* ======   NEW PILL-STYLE TABS STYLING    ====== */
/* =============================================== */

/* The main tab container now acts as a "track" for the pill */
.nav-tabs.glass-card {
    padding: 0.5rem;
    border-radius: 12px;
    position: relative;
    border-bottom: none;
    display: inline-flex; /* Makes the container fit its content */
    background: rgba(13, 17, 23, 0.5); /* A darker, more subtle track background */
}

/* The sliding "pill" indicator */
.nav-tabs .indicator {
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    height: calc(100% - 1rem);
    background-color: var(--primary-color);
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 15px rgba(66, 86, 161, 0.4);
    z-index: 1;
}

.nav-tabs .nav-item {
    z-index: 2; /* Ensure buttons are on top of the indicator */
}

.nav-tabs .nav-link {
    background-color: transparent !important;
    border: none !important;
    color: var(--light-text);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: color 0.4s ease;
    white-space: nowrap; /* Prevent text from wrapping */
}

    /* Active text is bright white */
    .nav-tabs .nav-link.active {
        color: var(--white-text);
    }

    /* Hover text is also bright white */
    .nav-tabs .nav-link:hover {
        color: var(--white-text);
    }
/* =============================================== */
/* ======     NEWS CARD STYLING      ====== */
/* =============================================== */

/* Ensure news tab has proper padding */
#news-tab-pane {
    padding: 1rem; /* Add some padding around the content */
}

/* Base card styling for glassmorphism */
.news-card-wrapper {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card {
    background: rgba(255, 255, 255, 0.08); /* Lighter glass effect */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure all cards in a row have equal height */
    position: relative; /* For image overlay */
    transition: all 0.3s ease;
}

    .news-card:hover {
        transform: translateY(-5px); /* Lift effect on hover */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Stronger shadow */
    }

.news-image {
    width: 100%;
    height: 180px; /* Fixed height for images */
    object-fit: cover; /* Crop images to fit */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* Placeholder for images */
.news-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(66, 86, 161, 0.3), rgba(66, 86, 161, 0.6));
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.news-card .card-body {
    padding: 1.25rem;
    flex-grow: 1; /* Allow body to take available space */
    color: var(--light-text);
}

.news-card .card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--white-text); /* Ensure title is bright */
    height: 3rem; /* Fixed height for title to prevent layout shifts */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit title to 2 lines */
    -webkit-box-orient: vertical;
}

.news-card .card-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    height: 4.5rem; /* Fixed height for content preview */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit content preview to 3 lines */
    -webkit-box-orient: vertical;
}

.news-card .card-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--light-text);
}

    .news-card .card-footer small .text-info {
        color: var(--primary-color-light) !important; /* Brighter accent for info */
        font-weight: 600;
    }

/* Action Buttons Overlay on Image */
.news-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px; /* Match image height */
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    z-index: 10;
}

.news-card:hover .news-image-overlay {
    opacity: 1;
}

.news-image-overlay .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
}

/* Override default bootstrap button colors for glass effect consistency */
.news-image-overlay .btn-warning {
    background-color: #ffc107; /* Standard yellow */
    border-color: #ffc107;
    color: #343a40; /* Dark text on yellow */
}

.news-image-overlay .btn-danger {
    background-color: #dc3545; /* Standard red */
    border-color: #dc3545;
    color: #fff;
}



#contestSearchInput {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 10px;
    padding-left: 2.5rem;
}
/* =============================================== */
/* ======     RESPONSIVE TABLE STYLES      ====== */
/* =============================================== */

@media (max-width: 768px) {
    .table-responsive-stack thead {
        display: none; /* Hide the original table header on small screens */
    }

    .table-responsive-stack tbody,
    .table-responsive-stack tr,
    .table-responsive-stack td {
        display: block;
        width: 100%;
    }

    .table-responsive-stack tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 0.5rem;
    }

    .table-responsive-stack td {
        display: flex;
        justify-content: space-between; /* Align label and value */
        align-items: center;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: right; /* Align value to the right */
    }

    .table-responsive-stack tr td:last-child {
        border-bottom: none;
    }

    /* This is the magic part that creates the labels */
    .table-responsive-stack td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--accent-yellow);
        margin-right: auto; /* Push the value to the right */
        text-align: left;
    }

    /* Center the action buttons on small screens */
    .table-responsive-stack td.actions-cell {
        justify-content: center;
    }
}