/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    width: 100%;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo img {
    height: 200px;
    width: auto;
    transition: transform 0.3s;
}

.logo img:hover {
    transform: scale(1.05);
}

.tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffc107;
    background: rgba(0,0,0,0.2);
    padding: 8px 16px;
    border-radius: 30px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.8rem;
    flex-wrap: wrap;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s, color 0.3s;
    font-size: 1.05rem;
}

nav ul li a:hover {
    border-bottom-color: white;
    color: #ffc107;
}

/* ===== FOOTER ===== */
footer {
    background: #343a40;
    color: #f8f9fa;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 0.9rem;
}

footer a {
    color: #ffc107;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn, button[type="submit"], .btn-primary {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,123,255,0.2);
}

.btn:hover, button[type="submit"]:hover {
    background: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,123,255,0.3);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn:active {
    transform: translateY(0);
}

/* ===== FORMS ===== */
form {
    background: white;
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 30px auto;
}

form label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

form input, form select, form textarea {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0,123,255,0.15);
}

form button {
    margin-top: 25px;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

/* ===== ALERTS ===== */
.error, .alert-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.success, .alert-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.info, .alert-info {
    color: #0c5460;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 25px 35px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.credit-info {
    background: #e9ecef;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.credits {
    color: #007bff;
    margin-right: 15px;
}

.days {
    color: #28a745;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card h2 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.card p {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* ===== EXAM & HISTORY PAGES ===== */
.timer {
    font-size: 2.2rem;
    font-weight: bold;
    color: #dc3545;
    background: #f8d7da;
    display: inline-block;
    padding: 12px 30px;
    border-radius: 60px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(220,53,69,0.2);
}

.question {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #007bff;
}

.question p {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.question label {
    display: block;
    padding: 10px 20px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: 1px solid #e9ecef;
}

.question label:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.question input[type="radio"] {
    margin-right: 12px;
    width: auto;
    transform: scale(1.1);
}

/* Score Card */
.score-card {
    background: white;
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 2px solid #28a745;
}

.score-card h2 {
    font-size: 2.2rem;
    color: #28a745;
    margin-bottom: 10px;
}

.short-tricks {
    background: #fff3cd;
    border: 2px solid #ffeeba;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
}

.review-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 6px solid #007bff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.explanation {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 12px;
    margin-top: 10px;
    border-radius: 4px;
}

/* History table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.history-table th {
    background: #007bff;
    color: white;
    padding: 12px;
    text-align: left;
}
.history-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.history-table tr:hover {
    background: #f8f9fa;
}
.btn-small {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    margin-right: 5px;
    display: inline-block;
}
.btn-info {
    background: #17a2b8;
}
.btn-info:hover {
    background: #138496;
}
.btn-danger {
    background: #dc3545;
}
.btn-danger:hover {
    background: #c82333;
}

/* Spinner */
.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== HERO SECTION (homepage) ===== */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(0,123,255,0.15), rgba(0,86,179,0.15));
    border-radius: 20px;
    margin-bottom: 50px;
}

.hero h1 {
    font-size: 3rem;
    color: #0056b3;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    color: #495057;
    max-width: 800px;
    margin: 0 auto 35px;
}

.cta-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.features {
    text-align: center;
}

.features h2 {
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: #343a40;
    position: relative;
    display: inline-block;
}

.features h2:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #007bff;
    margin: 15px auto 0;
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
}

.feature {
    background: white;
    padding: 35px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 35px rgba(0,123,255,0.15);
}

.feature h3 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature p {
    color: #6c757d;
    line-height: 1.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    nav ul {
        justify-content: center;
        gap: 1.2rem;
    }

    .logo img {
        height: 80px;
    }

    .tagline {
        font-size: 1rem;
        padding: 6px 12px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .btn {
        width: 100%;
    }

    form {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .credit-info {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .logo img {
        height: 60px;
    }
}

@media print {
    header, footer, .btn, .timer, form, .cta-buttons {
        display: none;
    }
    body {
        background: white;
    }
    main {
        padding: 0;
    }
    .questions-list, .question-item, .review-item, .score-card {
        box-shadow: none;
        border: none;
    }
}