/* --- Learning Layout --- */
.learning-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .learning-container {
        grid-template-columns: 1fr;
    }
}


.player-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    width: 100%; /* Ensure it fills the grid column */
    max-width: none !important; /* Override player.css max-width for grid layout */
    margin: 0 !important; /* Override player.css margin for grid layout */
}


.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
}
header .btn-primary {
    position: absolute;
    top: 0;
    right: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--navy);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}



.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    padding: 0;
    z-index: 2;
    position: relative;
}

.dash-kpi-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgb(12 73 131 / 100%);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dash-kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -8px rgba(12, 73, 131, 0.15);
}

.kpi-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.kpi-value {
    display: block;
    font-size: 2.25rem;
    color: var(--navy);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.dash-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dash-panel {
    background: #fff;
    border: 1px solid rgb(12 73 131 / 100%);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
    margin-bottom: 1.5rem;
}

.dash-hero-panel {
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgb(12 73 131 / 100%);
}

.dash-hero-panel .dash-panel-head h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.dash-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.dash-panel-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 700;
}

.muted-label {
    font-size: 0.8rem;
    color: #64748b;
}

.chart-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.dash-progress-list {
    display: grid;
    gap: 1rem;
}

.dash-progress-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dash-progress-item:last-child {
    border-bottom: none;
}

.dash-progress-thumb {
    width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    object-fit: cover;
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dash-progress-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.dash-progress-name {
    font-size: 1.1rem;
    color: #0c4983;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.dash-progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.dash-progress-fill {
    height: 100%;
    display: block;
    background: var(--primary-gradient);
    width: 0;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-progress-pct {
    text-align: right;
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 700;
}

.course-progress-mini {
    margin-bottom: 0.8rem;
}

.course-progress-track {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.course-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 999px;
    transition: width 0.8s ease;
}

.course-progress-label {
    color: #64748b;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 0.3rem;
}

/* --- Premium Course Cards (Student View) --- */
.course-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent-primary);
}

.card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f1f5f9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.course-card:hover .card-thumbnail::before {
    opacity: 0.8;
}

.card-thumbnail i {
    font-size: 3rem;
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.course-card:hover .card-thumbnail i {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.invoice-btn-floating {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    z-index: 10;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.course-card:hover .invoice-btn-floating {
    opacity: 1;
    transform: translateX(0);
}

.invoice-btn-floating:hover {
    background: var(--navy);
    color: #fff;
    transform: scale(1.1);
}

.course-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.course-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.course-info p {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    flex-grow: 1;
}

.course-progress-mini {
    margin-bottom: 1rem;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.03);
}

.start-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.course-card:hover .start-btn {
    background: var(--accent-primary);
    box-shadow: 0 10px 15px -3px rgba(12, 73, 131, 0.3);
}


/* --- Slide to Pay Button --- */
.slide-to-pay-container {
    position: relative;
    width: 100%;
    height: 56px;
    background: #f1f5f9;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 1rem;
    user-select: none;
}

.slide-text {
    position: relative;
    z-index: 1;
    color: #64748b;
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

.slide-thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    height: 48px;
    width: 60px;
    background: var(--navy);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    cursor: grab;
    z-index: 3;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.1s;
    touch-action: none;
}

.slide-thumb:active {
    cursor: grabbing;
}

.slide-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(12, 73, 131, 0.1);
    z-index: 2;
    border-radius: 28px 0 0 28px;
}

.slide-to-pay-container.success .slide-thumb {
    background: #059669; /* green */
    color: white;
}
.slide-to-pay-container.success .slide-fill {
    background: rgba(5, 150, 105, 0.1);
    width: 100% !important;
}
.slide-to-pay-container.loading .slide-thumb {
    background: #3b82f6; /* light blue */
    animation: pulse 1.5s infinite;
}
.slide-to-pay-container.error .slide-thumb {
    background: #ef4444; /* red */
}

.slide-to-pay-container.ready .slide-thumb {
    background: #059669; /* green */
}
.slide-to-pay-container.ready .slide-fill {
    background: rgba(5, 150, 105, 0.2);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@media (max-width: 900px) {
    .dash-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-kpi-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .dash-head, .student-dash-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Sidebar Styles --- */
.course-sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toolkit-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toolkit-header i {
    color: var(--accent-primary);
    background: var(--bg-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
}

.toolkit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.tool-item {
    background: white;
    border: 1px solid var(--navy);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-item:hover {
    transform: translateX(5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.tool-icon-box {
    width: 44px;
    height: 44px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.tool-icon-box i {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.tool-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.tool-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}

.tool-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-action {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolkit-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.toolkit-empty p {
    font-size: 0.85rem;
    font-style: italic;
}

/* --- Premium Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spa-section {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.dash-kpi-card:nth-child(1) { animation-delay: 0.1s; }
.dash-kpi-card:nth-child(2) { animation-delay: 0.2s; }
.dash-kpi-card:nth-child(3) { animation-delay: 0.3s; }

.course-card {
    animation: fadeInScale 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Stagger course cards */
.video-grid > .course-card:nth-child(1) { animation-delay: 0.1s; }
.video-grid > .course-card:nth-child(2) { animation-delay: 0.15s; }
.video-grid > .course-card:nth-child(3) { animation-delay: 0.2s; }
.video-grid > .course-card:nth-child(4) { animation-delay: 0.25s; }
.video-grid > .course-card:nth-child(5) { animation-delay: 0.3s; }
.video-grid > .course-card:nth-child(6) { animation-delay: 0.35s; }

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 3px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
/* --- CUSTOM FILE UPLOAD (STUDENT) --- */
.custom-file-upload {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
    padding: 1rem;
}

.custom-file-upload:hover {
    border-color: var(--navy);
    background: #f1f5f9;
}

.custom-file-upload i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.custom-file-upload:hover i {
    color: var(--navy);
}

.custom-file-upload span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.custom-file-upload .file-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

#payment-proof-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-selected .custom-file-upload {
    border-color: #10b981;
    background: #ecfdf5;
}

.file-selected .custom-file-upload i {
    color: #10b981;
}

.selected-filename {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* --- Notifications --- */
.notification-item {
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.notification-item.unread {
    border-left: 3px solid #ef4444;
}

.notif-icon {
    color: #ef4444;
    font-size: 1.25rem;
    padding-top: 2px;
}

.notif-content {
    flex: 1;
}

.notif-text {
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.notif-time {
    font-size: 0.75rem;
    color: #64748b;
}

.notif-empty {
    text-align: center;
    padding: 1rem;
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
}
