/* Stats and Quote Grid Layout */
.stats-and-tests-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.stats-section,
.quote-section {
    display: flex;
    flex-direction: column;
}

.stats-section .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    height: 100%;
    align-content: start;
}

.quote-section .dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.quote-section .card-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard Grid Uniform Heights */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.dashboard-grid .dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-grid .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Upcoming Tests Card */
.upcoming-tests-card .card-content {
    min-height: 200px;
}

@media (max-width: 768px) {
    .stats-and-tests-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-section,
    .quote-section {
        width: 100%;
        min-width: 0;
    }
    
    .stats-section .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-and-tests-grid {
        margin-bottom: 1rem;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 1rem;
    }
    
    .stats-section .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .quote-section .dashboard-card {
        min-height: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .stats-section,
    .quote-section {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    .stat-card {
        min-width: 0;
        max-width: 100%;
        padding: var(--space-sm);
    }
    
    .stat-content h3 {
        font-size: var(--font-size-lg);
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
}

.upcoming-tests {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.show-more-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--primary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--primary);
}

.show-more-btn i {
    transition: transform 0.3s ease;
}

.show-more-btn:hover i {
    transform: translateY(-1px);
}

.test-item.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.test-item {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.test-item:nth-child(even) {
    background: rgba(16, 185, 129, 0.05);
    border-left-color: var(--accent);
}

.test-item:nth-child(even) .test-subject,
.test-item:nth-child(even) .test-topic,
.test-item:nth-child(even) .test-date {
    color: var(--accent);
}

.test-item:nth-child(odd) {
    background: rgba(37, 99, 235, 0.05);
    border-left-color: var(--primary);
}

.test-item:nth-child(odd) .test-subject,
.test-item:nth-child(odd) .test-topic,
.test-item:nth-child(odd) .test-date {
    color: var(--primary);
}

.test-item:nth-child(even) .test-topic {
    border-left-color: var(--accent);
}

.test-item:nth-child(odd) .test-topic {
    border-left-color: var(--primary);
}

.test-item:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateX(2px);
}

.test-info {
    flex: 1;
}

.test-subject {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    font-size: 0.875rem;
}

.test-topic {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.125rem;
}

.test-date {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 500;
}

.no-upcoming-tests {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.no-upcoming-tests i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

[data-theme="dark"] .test-item:nth-child(odd) {
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .test-item:nth-child(even) {
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .test-item:nth-child(even) .test-subject,
[data-theme="dark"] .test-item:nth-child(even) .test-topic,
[data-theme="dark"] .test-item:nth-child(even) .test-date {
    color: #34d399;
}

[data-theme="dark"] .test-item:nth-child(odd) .test-subject,
[data-theme="dark"] .test-item:nth-child(odd) .test-topic,
[data-theme="dark"] .test-item:nth-child(odd) .test-date {
    color: #60a5fa;
}

[data-theme="dark"] .test-item:nth-child(even) .test-topic {
    border-left-color: #34d399;
}

[data-theme="dark"] .test-item:nth-child(odd) .test-topic {
    border-left-color: #60a5fa;
}

[data-theme="dark"] .test-item:hover {
    background: rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .test-item:nth-child(even):hover {
    background: rgba(16, 185, 129, 0.15);
}

/* Start Test Confirmation Dialog */
#start-test-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.stc-dialog {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    border-radius: 16px;
    padding: 2rem;
    width: min(420px, 90vw);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: stc-in .2s ease;
}
@keyframes stc-in {
    from { opacity: 0; transform: scale(.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.stc-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.stc-dialog h3 {
    margin: 0 0 .4rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #111);
}
.stc-title {
    font-weight: 600;
    color: var(--primary, #2563eb);
    margin: 0 0 .75rem;
}
.stc-warning {
    font-size: .875rem;
    color: var(--text-secondary, #555);
    margin: 0 0 1rem;
    line-height: 1.5;
}
.stc-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: .85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
}
.stc-meta i { margin-right: .3rem; }
.stc-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}
.stc-btn-cancel, .stc-btn-start {
    flex: 1;
    padding: .65rem 1rem;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s;
}
.stc-btn-cancel:hover, .stc-btn-start:hover { opacity: .85; }
.stc-btn-cancel {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #333);
}
.stc-btn-start {
    background: var(--primary, #2563eb);
    color: #fff;
}

.btn-resume-test {
    padding: 10px;
    border-radius: var(--radius-md);
}
