/* ============================================
   Academy Detail Page – custom.css
   Extracted from show.blade.php inline styles
   + reference design alignment
   ============================================ */

/* --- commonBgSeMain wrapper (reference outer container) --- */
.commonBgSeMain {
    padding: 0;
}

/* --- Academy meta dot separator --- */
.ad-meta-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #CBCED3;
    vertical-align: middle;
    margin: 0 6px;
}

/* --- Header card overrides --- */
.ad-header-card {
    background: #fff;
    border-radius: 32px;
    padding: 24px 0 10px;
    border: 1px solid #00000040;
    flex-direction: column;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 0px;
}

.ad-header-card .adFlex1Main {
    display: flex;
    justify-content: space-between;
    padding: 0 20px 10px;
    width: 100%;
    align-items: center;
}

.ad-academy-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Membership dropdown (click-to-toggle) --- */
.ad-membership-wrap {
    position: relative;
    display: inline-flex;
}

.ad-membership-badge {
    font-size: 11px;
    font-weight: 500;
    color: #4921ea;
    border-radius: 20px;
    padding: 2px 10px;
    border: 1px solid #4921ea33;
    background: #f0ecff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ad-membership-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 3px 11px #2d487e1a;
    min-width: 220px;
    padding: 8px;
    z-index: 500;
}

.ad-membership-dropdown.open {
    display: block;
}

.ad-membership-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

.ad-membership-item:hover {
    background: #f4f4f4;
}

/* --- KPI section spacing --- */
.ad-kpi-section {
    margin-bottom: 20px;
    margin-top: 20px;
}

/* --- Table wrapper (ctr-card pattern from reference) --- */
.ad-detail-table-wrap {
    border: 1px solid #00000040;
    border-radius: 32px;
    overflow: hidden;
}

/* --- Student list header (db-acad-header) --- */
.ad-detail-table-wrap .db-acad-header {
    font-size: 13px;
    font-weight: 500;
    color: #000;
    text-align: left;
    padding: 32px 20px;
    border-bottom: 1px solid #eee;
}

/* --- Table scroll container --- */
.ad-detail-table-wrap .tbl-card {
    background: #fff;
    overflow: hidden;
}

.ad-detail-table-wrap .ctr-tbl-scroll {
    overflow-x: auto;
}

/* --- Table headers --- */
.ad-detail-table-wrap .ctr-tbl thead th {
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 12px 16px;
    white-space: nowrap;
}

/* --- Table body cells --- */
.ad-detail-table-wrap .ctr-tbl tbody td {
    font-size: 13px;
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

/* --- Exam list section --- */
.ad-tbl-section {
    margin-top: 24px;
}

.ad-tbl-section .ad-tbl-top {
    overflow: visible;
    margin-bottom: 5px;
    margin-top: 0;
    padding: 14px 18px 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
}

.ad-tbl-section .ad-tbl-top.noMargin {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 32px 32px 0 0;
}

/* --- Filter row responsive --- */
@media (max-width: 992px) {
    .ad-filter-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    .ad-filter-row .acad-search-wrap {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .ad-filter-row .filterFlexMain {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .ad-filter-row .filterFlexMain>.date-range-dropdown,
    .ad-filter-row .filterFlexMain>.acad-membership-wrap {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }

    .ad-filter-row .filterFlexMain>.date-range-dropdown .acad-membership-wrap {
        width: 100% !important;
    }

    .ad-filter-row .filterFlexMain>.date-range-dropdown .ad-date-btn {
        width: 100% !important;
    }

    .ad-filter-row .filterFlexMain>.acad-membership-wrap>.acad-membership-select {
        width: 100% !important;
    }

    #examResetBtn.acad-reset-btn {
        flex: 0 0 100% !important;
        width: 100% !important;
        justify-content: center !important;
    }
}

/* --- Date range picker overflow fix (borderCommonmain clips it) --- */
#examSection.borderCommonmain {
    background: #fff;
    margin-bottom: 20px;
}

/* Date picker popup: fixed positioning so overflow:hidden ancestors cannot clip it */
.datepicker-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.datepicker-popup.show {
    display: block;
    animation: dpFadeCenter 0.18s ease forwards;
}

@keyframes dpFadeCenter {
    from {
        opacity: 0;
        transform: translate(-50%, -46%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 820px) {
    .datepicker-popup {
        max-width: calc(100vw - 24px);
        max-height: 88vh;
        overflow: auto;
    }
}

/* Keep Date Range trigger label on one line */
.date-trigger {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Month/year option colors */
.month-dropdown option,
.year-dropdown option {
    color: #21236A;
    background: #fff;
}

/* Datepicker footer buttons */
.dp-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px 0 0;
    flex: 0 0 100%;
}

/* Selected range text shown in the datepicker footer */
.dp-selected {
    margin-right: auto;
    font-size: 12px;
    font-weight: 500;
    color: #676A72;
}

.datepicker-wrapper {
    flex-wrap: wrap;
}

.dp-btn {
    padding: 7px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

.dp-btn-cancel {
    background: #F4F4F4;
    color: #676A72;
}

.dp-btn-cancel:hover {
    background: #E8E8E8;
}

.dp-btn-apply {
    background: #303088;
    color: #fff;
}

.dp-btn-apply:hover {
    background: #262580;
}

/* --- Mobile accordion expand button with leftBorderDiv --- */
.ad-detail-table-wrap .dataCssCollapsed .leftBorderDiv {
    border-left: 1px solid #eee;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-detail-table-wrap .dataCssExpandBtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    font-size: 12px;
}

/* --- Mobile responsive --- */
@media (max-width: 768px) {

    .ad-header-card,
    .ad-kpi-section,
    .ad-tbl-section,
    .table-wrap,
    .ad-detail-table-wrap {
        margin: 0px !important;
    }

    .ad-header-card {
        flex-direction: column;
        padding: 0;
        margin-top: 0;
        border: none;
    }

    .ad-header-card .adFlex1Main {
        padding: 0;
        flex-direction: column;
        align-items: start;
        gap: 16px;
    }

    .ad-academy-name {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .ad-membership-badge {
        font-size: 9px;
    }

    .ad-header-actions {
        width: 100%;
        justify-content: flex-end !important;
        display: flex;
    }

    .ad-hdr-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .ad-academy-meta {
        font-size: 9px;
    }

    .ad-header-card {
        margin-bottom: 10px !important;
    }

    .ad-detail-table-wrap {
        border-radius: 16px;
        margin-bottom: 10px !important;
    }

    .ad-detail-table-wrap .db-acad-header {
        padding: 15px;
        border-bottom: none;
    }

    .ad-tbl-section .ad-tbl-top {
        margin-top: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 1199px) {
    .ad-detail-table-wrap .ad-stu-avatar {
        width: 30px;
        height: 30px;
    }
}