/* ==========================================================================
   📜 NEXTEDU - PREMIUM HISTORY & LEDGER ARCHIVE CSS (v3.5)
   ========================================================================== */

:root {
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --font-outfit: 'Outfit', sans-serif;
}

body.dashboard-body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 50px;
    font-family: var(--font-outfit);
    min-height: 100vh;
}

/* Drift glow background shapes */
body.dashboard-body::before {
    content: '';
    position: fixed;
    width: 45vw;
    height: 45vw;
    max-width: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0) 70%);
    top: -10%;
    left: -10%;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

body.dashboard-body::after {
    content: '';
    position: fixed;
    width: 35vw;
    height: 35vw;
    max-width: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, rgba(236, 72, 153, 0) 70%);
    bottom: 5%;
    right: -10%;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

.history-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 14px 40px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- 📊 SUMMARY PANEL --- */
.summary-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.s-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 10px;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}
.s-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.15);
}

.s-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
}

.s-info {
    display: flex;
    flex-direction: column;
}

.s-info .val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-main);
    font-family: 'Orbitron', sans-serif;
}

.s-info .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-top: 3px;
}

/* --- 📝 UNIVERSAL HISTORY CARDS --- */
.logs-grid, .wallet-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

.history-card:hover {
    transform: translate3d(5px, 0, 0);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.h-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.h-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.h-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.h-details h4 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--text-main);
    font-weight: 800;
    font-family: var(--font-outfit);
}

.h-details span {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Quiz Specific */
.score-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    border: 1px solid transparent;
    padding: 4px 10px;
    border-radius: 8px;
}
.score-badge span { font-size: 0.65rem; text-transform: uppercase; opacity: 0.8; font-weight: 700; }
.score-badge strong { font-size: 1.05rem; font-family: 'Orbitron', sans-serif; }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 45px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.empty-state i {
    font-size: 2.8rem;
    opacity: 0.4;
}
.empty-state p {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0;
}

/* iOS Style Segmented Control for History Tabs */
.history-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.tab-controls {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 5px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: 100%;
    max-width: 350px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    transform: translate3d(0,0,0);
    will-change: transform;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    will-change: transform;
    font-family: var(--font-outfit);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
    transform: scale(1.02);
}

.tab-content {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-content.active {
    display: block;
}

/* Adjust main content for Bottom Nav */
.main-content {
    padding-bottom: 120px !important;
}

/* --- 📝 ATTEMPT DETAILED REVIEW MODAL --- */
.modal-overlay {
    display: none; 
    position: fixed; 
    inset: 0;
    background: rgba(0,0,0,0.78); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000; 
    align-items: center; 
    justify-content: center; 
    padding: 16px;
    transform: translate3d(0, 0, 0);
    will-change: opacity;
}

.attempt-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.attempt-question {
    margin-bottom: 14px; 
    padding: 16px; 
    background: var(--input-bg); 
    border: 1px solid var(--card-border);
    border-radius: 18px;
}

.attempt-question-options {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- 📱 MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 600px) {
    .summary-panel { gap: 8px; }
    .s-card { padding: 14px 4px; border-radius: 16px; }
    .s-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
    .s-info .val { font-size: 1.05rem; }
    .s-info .label { font-size: 0.62rem; }
    
    .history-card { padding: 14px 15px; border-radius: 15px; }
    .h-details h4 { font-size: 0.92rem; }
    .h-details span { font-size: 0.72rem; }
    .h-icon { width: 34px; height: 34px; font-size: 0.9rem; }
    
    .tab-controls { border-radius: 16px; }
    .tab-btn { padding: 8px 0; font-size: 0.82rem; border-radius: 12px; }
    
    .attempt-modal-content { max-height: 90vh; border-radius: 24px; }
}