/*
Theme Name: All Exam Answer Key Downloader
Theme URI: https://example.com/answer-key-downloader
Author: Antigravity
Description: A high-performance, SEO-optimized theme for Exam Answer Keys.
Version: 1.1.0
Text Domain: exam-answer-key
*/

/* 1. Global Reset & Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --dark-color: #0f172a;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --container-width: 1200px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    background-color: var(--light-bg);
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 25px;
    }
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: 0.2s ease;
}

/* 2. Header & Navigation */
.site-header {
    background: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.site-branding {
    flex: 1;
    min-width: 0;
}

.logo .site-title {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 800;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

@media (min-width: 768px) {
    .logo .site-title {
        font-size: 1.75rem;
    }
}

.main-navigation {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    line-height: 1;
}

.menu-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 0;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-color);
}

.toggled .menu-container {
    display: block;
}

.menu-container ul {
    list-style: none;
}

.menu-container ul li a {
    display: block;
    padding: 15px 20px;
    color: var(--dark-color);
    font-weight: 700;
    border-bottom: 1px solid #f8fafc;
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }

    .menu-container {
        display: block;
        position: static;
        box-shadow: none;
        padding: 0;
        background: transparent;
        border: none;
    }

    .menu-container ul {
        display: flex;
        gap: 25px;
    }

    .menu-container ul li a {
        padding: 0;
        border: none;
        font-size: 0.95rem;
    }
}

/* 3. Main Content Wrapper & Hero */
.main-content-wrapper {
    margin: 20px auto 40px;
}

.content-sidebar-layout {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (min-width: 992px) {
    .content-sidebar-layout {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 30px;
    }
}

/* 4. Single Page & Widgets */
.single-card,
.widget-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

@media (min-width: 768px) {

    .single-card,
    .widget-box {
        padding: 30px;
        border-radius: 20px;
    }
}

.entry-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--dark-color);
    font-weight: 800;
}

.sub-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 6px;
    border-bottom: 4px solid var(--primary-color);
    display: inline-block;
}

/* Details Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th,
.details-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.details-table tr:last-child th,
.details-table tr:last-child td {
    border-bottom: none;
}

.details-table th {
    background-color: #f8fafc;
    color: var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    width: 35%;
}

.details-table td {
    color: var(--dark-color);
    font-weight: 700;
}

@media (max-width: 600px) {

    .details-table th,
    .details-table td {
        display: block;
        width: 100%;
    }

    .details-table th {
        padding-bottom: 5px;
        border-bottom: none;
    }

    .details-table td {
        padding-top: 5px;
    }
}

.status-success {
    color: var(--success-color);
}

.badge-light {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* 5. Buttons & Actions */
.download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

@media (min-width: 600px) {
    .download-actions {
        flex-direction: row;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    text-align: center;
    font-size: 1rem;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: #fff;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: #f0f7ff;
}

.btn-full {
    width: 100%;
}

.btn-telegram {
    background: #0088cc;
    color: #fff;
}

/* 6. Homepage Hero & Listing */
.hero-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.15rem);
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto 25px;
}

.search-form {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .search-form {
        grid-template-columns: 1fr 1fr 1fr auto;
        padding: 20px;
        border-radius: 24px;
    }
}

.search-input,
.search-select {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
}

.exam-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.exam-table th {
    background: #f8fafc;
    color: var(--secondary-color);
    padding: 16px;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.exam-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.exam-name a {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.05rem;
}

/* 7. Archive & Meta */
.archive-item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
}

@media (min-width: 768px) {
    .archive-item-card {
        flex-direction: row;
        align-items: center;
    }
}

.meta-badge {
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

/* 8. Footer */
.site-footer {
    background: var(--dark-color);
    color: #cbd5e1;
    padding: 50px 0 30px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .footer-widgets {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        display: flex;
        justify-content: space-between;
    }
}

/* 9. Utility Classes */
.text-center {
    text-align: center !important;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.status-success {
    color: var(--success-color);
}