/* ==========================================================================
   DASHBOARD CSS — Fully Responsive, Modern Design
   Normalized font sizes, fluid layouts, consistent across all screens
   ========================================================================== */

/* ==========================================================================
   1. CORE LAYOUT
   ========================================================================== */
body.dashboard-open {
    background-color: var(--color-light, #f7f8fa);
    font-family: var(--font-primary, 'Segoe UI', sans-serif);
    color: var(--color-body, #ba0f00);
    font-size: 14px; /* Single source of truth for base size */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.dashboard-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.dashboard-body {
    padding: clamp(5px, 0.5vw, 7px);
    flex: 1 0 auto;
}

/* ==========================================================================
   2. SIDEBAR
   ========================================================================== */
.mwr-dash-sidebar {
    width: 260px;
    height: 100vh;
    background: var(--color-white, #fff);
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--color-border-2, #edf0f5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-content-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Sidebar Branding */
.dash-side-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--color-border-2, #edf0f5);
    flex-shrink: 0;
	display: flex;
    flex-direction: row;
    gap: 120px;
}

.dash-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.dash-brand-link img {
    height: 36px;
    width: auto;
}

.brand-name {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.25rem; /* Normalized from 2.15rem */
    line-height: 1;
    letter-spacing: -0.3px;
}

.text-red  { color: var(--color-primary, #761c22); }
.text-gold { color: var(--color-secondary, #c9a050); }

/* Sidebar Navigation */
.dash-side-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border, #dde1e8) transparent;
}

.dash-side-nav::-webkit-scrollbar { width: 3px; }
.dash-side-nav::-webkit-scrollbar-thumb {
    background: var(--color-border, #dde1e8);
    border-radius: 10px;
}

.nav-group { margin-bottom: 20px; }

.group-title {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #9e9e9e;
    letter-spacing: 1.2px;
    margin: 0 0 8px 10px;
    display: block;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--color-body, #4a5568);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    margin-bottom: 3px;
    transition: background 0.2s ease, color 0.2s ease;
    gap: 10px;
}

.nav-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-light, #f3f4f6);
    border-radius: 8px;
    color: var(--color-bodyest, #2d3748);
    font-size: 13px;
    transition: background 0.2s ease, color 0.2s ease;
}

.dash-nav-item:hover {
    background: var(--primary-opacity, #fff0f0);
    color: var(--color-primary, #761c22);
}

.dash-nav-item:hover .nav-icon {
    background: var(--primary-opacity, #fff0f0);
    color: var(--color-primary, #761c22);
}

.dash-nav-item.active {
    background: var(--color-primary, #761c22);
    color: #fff;
    box-shadow: 0 4px 12px rgba(118, 28, 34, 0.25);
}

.dash-nav-item.active .nav-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.badge-count {
    margin-left: auto;
    background: var(--color-secondary, #c9a050);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.4;
}

/* Sidebar Close Button Style */
.sidebar-close-btn {
    background: var(--primary-opacity);
    border: none;
    color: var(--color-primary);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Overlay for Mobile */
.mwr-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
}

.mwr-sidebar-overlay.active {
    display: block;
}

/* Ensure Sidebar is above overlay */
.mwr-dash-sidebar {
    z-index: 100;
}

/* Quick Links Card */
.dash-external-box {
    background: var(--color-primary, #761c22);
    padding: 16px;
    border-radius: 14px;
    margin-top: 8px;
}

.dash-external-box p,
.dash-external-box h6 {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin: 0 0 8px;
}

.dash-mainmenu-footer {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.dash-mainmenu-footer li a {
    color: rgba(255,255,255,0.8);
    font-size: 12.5px;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.dash-mainmenu-footer li a:hover {
    color: var(--color-secondary, #c9a050);
    transform: translateX(4px);
}

/* Sidebar Footer */
.dash-side-footer {
    padding: 16px;
    border-top: 1px solid var(--color-border-2, #edf0f5);
    flex-shrink: 0;
}

.btn-dash-logout {
    width: 100%;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #dde1e8);
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--color-danger, #dc3545);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-dash-logout:hover {
    background: var(--color-danger, #dc3545);
    color: #fff;
    border-color: var(--color-danger, #dc3545);
}

/* ==========================================================================
   3. TOP HEADER
   ========================================================================== */
.dash-top-nav {
    height: 64px;
    background: var(--color-white, #fff);
    border-bottom: 1px solid var(--color-border-2, #edf0f5);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    overflow: visible;
}

/* Search */
.header-search-box {
    position: relative;
    width: 320px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-body, #4a5568);
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--color-gray-light, #f3f4f6);
    border: 1px solid transparent;
    padding: 9px 14px 9px 40px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--color-body, #4a5568);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background: var(--color-white, #fff);
    border-color: var(--color-secondary, #c9a050);
    box-shadow: 0 0 0 3px rgba(201, 160, 80, 0.12);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--color-gray-light, #f3f4f6);
    color: var(--color-bodyest, #2d3748);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}

.icon-btn:hover {
    background: var(--primary-opacity, #fff0f0);
    color: var(--color-primary, #761c22);
}

.dot-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-secondary, #c9a050);
    border: 2px solid var(--color-white, #fff);
    border-radius: 50%;
}

.avatar-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--color-border-2, #edf0f5);
}

.avatar-box img { width: 100%; height: 100%; object-fit: cover; }

.user-name { font-size: 13px; font-weight: 700; color: var(--color-heading, #1a202c); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--color-body, #4a5568); font-weight: 500; }

/* Page Title */
.page-title {
    font-weight: 700;
    color: var(--color-heading, #1a202c);
    font-size: 1.5rem; /* Normalized from 2.25rem */
    letter-spacing: -0.3px;
}

/* Live Pulse */
.class-status-btn {
    position: relative;
    background: #fff5f5 !important;
    color: var(--color-primary, #761c22) !important;
    font-size: 13px;
}

.status-pulse {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* ==========================================================================
   4. PROFILE DROPDOWN (FIXED)
   ========================================================================== */
.profile-dropdown-wrapper {
    position: relative;
    overflow: visible;
}

.header-avatar-trigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--color-border-2, #edf0f5);
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.header-avatar-trigger:hover { 
    border-color: var(--color-secondary, #c9a050); 
}

.header-avatar-trigger img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* Core Dropdown Base State */
.modern-user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    z-index: 9999;
    border: 1px solid var(--color-border-2, #edf0f5);
    
    /* FIX: Remove display: none completely to allow fluid animation properties */
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px); /* Explicitly set a start point for the transition engine */
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.2s;
}

/* FIX: Clear display overrides, rely on opacity, transform, and pointer engines */
.modern-user-dropdown.show {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
}

/* Inner Layout Blocks */
.user-info-header { 
    padding: 12px 16px 12px; 
}

.header-avatar-inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.header-avatar-inner img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.name-text { 
    font-size: 13.5px; 
    font-weight: 600; 
    color: var(--color-heading, #1a202c); 
}

.username-text { 
    font-size: 11.5px; 
    color: var(--color-body, #4a5568); 
    display: block; 
}

.modern-user-dropdown .divider {
    height: 1px;
    background: #f0f0f0;
    margin: 6px 0;
}

/* Anchor Link Controls */
.modern-user-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--color-bodyest, #2d3748);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.modern-user-dropdown li a i {
    width: 18px;
    font-size: 14px;
    color: #999;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.modern-user-dropdown li a:hover {
    background: #f8f9fa;
    color: var(--color-primary, #761c22);
}

.modern-user-dropdown li a:hover i { 
    color: var(--color-primary, #761c22); 
}

/* Logout Edge Styling */
.logout-link { 
    color: var(--color-danger, #dc3545) !important; 
}

.logout-link i { 
    color: var(--color-danger, #dc3545) !important; 
}

/* ==========================================================================
   5. COURSE CARDS
   ========================================================================== */

/* Standard Grid Card */
.mwr-grid-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0f0f0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mwr-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(118, 28, 34, 0.08);
    border-color: #c9a050;
}

.mwr-card-banner {
    position: relative;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.mwr-card-banner img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mwr-grid-card:hover .mwr-card-banner img { transform: scale(1.06); }

/* Modern Card Variant */
.mwr-modern-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.mwr-modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(118, 28, 34, 0.08);
}

.card-image-wrap {
    position: relative;
    height: 180px; /* Normalized from 220px */
    margin: 8px;
    border-radius: 14px;
    overflow: hidden;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mwr-modern-card:hover .card-image-wrap img { transform: scale(1.05); }

/* Badge */
.modern-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(8px);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Card Body */
.card-body-content {
    padding: 16px 18px 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-title-text {
    font-weight: 700;
    font-size: 15px; /* Normalized from 1.7rem */
    color: #111;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-sub-text {
    font-size: 13px; /* Normalized from 1.05rem */
    color: #666;
    line-height: 1.55;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Info Box */
.course-info-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f8fa;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.info-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px; /* Normalized from 1.15rem */
    font-weight: 600;
    color: #444;
}

.info-tag i {
    color: #c9a050;
    font-size: 13px;
}

/* Action Button */
.mwr-main-btn {
    width: 100%;
    background: #761c22;
    color: #fff;
    border: none;
    padding: 10px 10px 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 13.5px; /* Normalized from 1.35rem */
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: auto;
    text-decoration: none;
}

.btn-arrow {
    background: rgba(255,255,255,0.18);
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.mwr-main-btn:hover {
    background: #c9a050;
    transform: scale(1.01);
}

/* Utility Buttons */
.btn-red-primary {
    background: #761c22;
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 18px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-red-primary:hover { background: #c9a050; }

/* Status Colors */
.text-gold  { color: #c9a050 !important; }
.text-red   { color: #761c22 !important; }
.text-light-gray { color: #d0d0d0; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   6. DASHBOARD HEADER SEARCH / FILTER
   ========================================================================== */
.dashboard-search,
.dashboard-filter { max-width: 260px; }

.dashboard-search .input-group-text,
.dashboard-filter .input-group-text {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    padding-right: 8px;
    font-size: 13px;
}

.dashboard-search .form-control,
.dashboard-filter .form-select {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
    font-size: 13px;
    height: 40px;
}

.form-select:focus,
.form-control:focus {
    box-shadow: 0 0 0 3px rgba(201, 160, 80, 0.15) !important;
    outline: none;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.mwr-footer,
.dash-footer {
    background: var(--color-white, #fff);
    border-top: 1px solid var(--color-border-2, #edf0f5);
    padding: 16px 24px;
    flex-shrink: 0;
}

.dash-footer-text { font-size: 12.5px; color: var(--color-body, #4a5568); }
.footer-brand { color: #761c22; font-weight: 600; }

.footer-link,
.symtech-link {
    font-size: 12.5px;
    color: var(--color-body, #4a5568);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover    { color: #761c22; }
.symtech-link         { color: var(--color-heading, #1a202c); font-weight: 700; }
.symtech-link:hover   { color: #c9a050; }

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet (≤ 992px) — Sidebar hidden, main goes full width */
@media (max-width: 992px) {
    .mwr-dash-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }

    .mwr-dash-sidebar.active {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(0,0,0,0.15);
    }

    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }

    .header-search-box { width: 240px; }

    .dashboard-search,
    .dashboard-filter {
        max-width: 100%;
        width: 100%;
    }
}

/* Mobile (≤ 768px) — Dropdown goes fixed */
@media (max-width: 767.98px) {
    .header-search-box { width: 180px; }

    .dash-top-nav { padding: 0 16px; height: 58px; }

    .dashboard-body { padding: 14px; }

    .page-title { font-size: 1.25rem; }

    .header-actions .modern-user-dropdown {
        position: fixed !important;
        top: 64px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px);
    }

    .profile-dropdown-wrapper .modern-user-dropdown {
        left: auto !important;
        right: 12px !important;
        width: 240px !important;
    }
}

/* Small mobile (≤ 480px) */
@media (max-width: 480px) {
    .header-search-box { display: none; }

    .card-image-wrap { height: 160px; }

    .course-info-box { flex-direction: column; align-items: flex-start; gap: 6px; }
}
