/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page Wrapper */
.history-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

/* Hero Section */
.page-hero {
    max-width: 1200px;
    margin: 0 auto 40px;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.hero-icon {
    font-size: 5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-content h1 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Clear History Button */
.btn-clear-history {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(239,68,68,0.4);
}

.btn-clear-history:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(239,68,68,0.5);
}

/* Stats Dashboard */
.stats-dashboard {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
    gap: 25px;
}

.stat-card {
    background: #fff;
    padding: 35px;
    border-radius: 20px;
    display: flex;
    gap: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: 0.3s;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    width: 100%;
}

.stat-primary::before { background: linear-gradient(90deg,#3b82f6,#2563eb); }
.stat-success::before { background: linear-gradient(90deg,#10b981,#059669); }
.stat-info::before { background: linear-gradient(90deg,#8b5cf6,#7c3aed); }

.stat-icon {
    font-size: 4rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
}

.stat-label {
    color: #64748b;
    font-weight: 600;
}

/* Content Section */
.content-section {
    max-width: 1200px;
    margin: 0 auto 30px;
    background: #fff;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 30px;
}

/* Subjects */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
    gap: 20px;
}

.subject-card {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    padding: 25px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    transition: 0.3s;
}

.subject-card:hover {
    transform: scale(1.05);
}

/* History */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item {
    background: linear-gradient(135deg,#f8fafc,#f1f5f9);
    padding: 30px;
    border-radius: 16px;
    display: flex;
    gap: 25px;
    border-left: 5px solid #667eea;
    transition: 0.3s;
}

.history-item:hover {
    transform: translateX(10px);
}

/* Buttons */
.btn-action {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-redownload {
    background: linear-gradient(135deg,#3b82f6,#2563eb);
    color: #fff;
}

.btn-view {
    background: #fff;
    border: 2px solid #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero,
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .stats-dashboard,
    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .history-item {
        flex-direction: column;
    }
}