/* --- DESIGN SYSTEM & RESET --- */
:root {
    /* Palette */
    --accent: #4169E1;
    /* Royal Blue */
    --accent-rgb: 65, 105, 225;
    --accent-light: #5B8DEE;
    --accent-bg: #EBF0FF;
    --bg: #F8F9FB;
    /* Light Gray/Blueish */
    --card-bg: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --muted: #9CA3AF;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;

    /* Spacing & Layout */
    --radius: 14px;
    --radius-sm: 8px;
    --header-height: 60px;
    --nav-height: 60px;
    --max-width: 800px;
    /* Reduced max width for better readability on desktop */

    /* Effects */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
    padding-bottom: calc(var(--nav-height) + 20px);
    /* Space for bottom nav */
}

input,
button,
select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* --- LAYOUT STRUCTURE --- */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* View transition placeholder */
    opacity: 1;
    transition: opacity 0.2s ease;
}

.view-container {
    width: 100%;
    animation: fadeIn 0.3s ease forwards;
}

.view-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 20px 0;
}

.view-hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- TOP BAR --- */
.topbar {
    height: var(--header-height);
    background: var(--card-bg);
    /* Or transparent/blur? Card looks cleaner. */
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-left:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.topbar-title-light {
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- BOTTOM NAV BAR --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    width: 100%;
    height: 100%;
    transition: var(--transition);
}

.nav-item svg {
    stroke-width: 2px;
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active svg {
    transform: translateY(-2px);
    stroke: var(--accent);
}

/* --- KPI GRID --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 col on mobile by default */
    gap: 12px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

/* Primary KPI Card (Weighted Average) */
.kpi-card.primary {
    background: linear-gradient(135deg, var(--accent) 0%, #3056D3 100%);
    color: white;
    border: none;
    /* grid-column: span 2; Removed to allow side-by-side with Modules Avg */
}

@media (min-width: 600px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .kpi-card.primary {
        grid-column: span 1;
    }
}

.kpi-card.primary .kpi-label {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-card.primary .kpi-value {
    color: white;
}

.kpi-card.primary .kpi-subtext {
    color: rgba(255, 255, 255, 0.7);
}

.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 6px;
}

/* --- YEAR TABS --- */
.year-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    /* Removing margin here to force control via grid margin-top */
    width: 100%;
    /* Removed padding to match table width exactly */
}

.year-tabs {
    background: #E0E4ED;
    padding: 4px;
    border-radius: 99px;
    display: flex;
    gap: 4px;
    width: 100%;
    /* Removed max-width to match table width exactly */
    margin: 0 auto;
}

.year-tab {
    padding: 5px 0;
    flex: 1;
    text-align: center;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;

}

.year-tab.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* --- SEMESTER GRID --- */
.semester-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    /* Space between cards */
    margin-top: 24px;
    /* Space above first card (between tabs and list) */
    align-items: start;
}

.semester-section {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
}

.semester-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.semester-header {
    background: var(--bg);
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.semester-body {
    padding: 0;
}

/* --- EXAM ROW ITEM --- */
.exam-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    transition: background 0.2s;
}

.exam-item:last-child {
    border-bottom: none;
}

.exam-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}


.exam-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.exam-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

input.exam-name-input {
    border: none;
    border-bottom: 1px dashed var(--border);
    /* Visual hint for editability */
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    width: 100%;
    font-family: inherit;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
    line-height: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

input.exam-name-input:focus {
    outline: none;
    border-bottom: 1px solid var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
    /* Optional: slight background on focus */
    border-radius: 2px;
}

.exam-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.ects-badge {
    font-size: 9px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Exam Right: Controls */
.exam-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grade Select */
.grade-select {
    appearance: none;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 6px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    width: 50px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.grade-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}

.grade-select.has-grade {
    background-color: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent-light);
}

/* Saved Check Indicator */
.saved-indicator {
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    margin-left: -4px;
}

.saved-indicator.visible {
    opacity: 1;
}

/* Pass/Fail Toggle */
.pf-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.pf-toggle input {
    display: none;
}

.pf-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: white;
}

.pf-toggle input:checked~.pf-check {
    background: var(--accent);
    border-color: var(--accent);
}

/* --- FOOTER --- */
.app-footer {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin-top: auto;
    padding: 20px;
    font-family: monospace;
}

/* --- SORTABLE JS CLASSES --- */
.sortable-ghost {
    opacity: 0.4;
    background: var(--bg);
}

.sortable-drag {
    background: white;
    box-shadow: var(--shadow-lg);
    opacity: 1;
}

/* --- SIMULATION VIEW (Specifics) --- */
.sim-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.sim-group {
    margin-bottom: 24px;
}

.sim-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

.sim-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-primary {
    background: #1E3A8A;
    /* Dark Blue */
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 16px;
        gap: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-value {
        font-size: 22px;
    }
}

/* --- ERROR NOTIFICATION --- */
.error-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3), 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    max-width: 90%;
    width: auto;
    min-width: 300px;
    animation: slideInDown 0.3s ease forwards;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.error-content svg {
    flex-shrink: 0;
    stroke-width: 2.5;
}

.error-notification.fade-out {
    animation: slideOutUp 0.3s ease forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    /* Space for mobile */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    /* Prevent cutting off */
    overflow-y: auto;
    /* Allow scrolling */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text);
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.scroll-indicator.visible {
    opacity: 1;
    pointer-events: auto;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

/* --- CHART & TOGGLE --- */
.chart-container-wrapper {
    background: var(--card-bg);
    padding: 24px 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* Horizontal Scroll Wrapper */
.chart-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    /* Space for scrollbar */
}

.chart-scroll-wrapper::-webkit-scrollbar {
    height: 4px;
}

.chart-scroll-wrapper::-webkit-scrollbar-track {
    background: var(--bg);
}

.chart-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Scroll Hint */
.scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
    animation: bounceX 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    margin-left: 4px;
}

.scroll-hint.visible {
    opacity: 1;
}

@keyframes bounceX {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(0);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(3px);
    }
}

/* Tooltip Customization (if needed for Chart.js) */
#chart-tooltip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
}


.modal-buttons button {
    flex: 1;
}

/* --- TOPBAR RIGHT --- */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: rgba(var(--accent-rgb), 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* --- WELCOME MODAL SPECIFIC --- */
.welcome-content {
    max-width: 500px;
    padding: 32px;
    text-align: left;
}

.header-btn {
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 14px;
    /* Unified with system radius */
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-btn:hover {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.1);
}

.header-btn i {
    font-size: 14px;
}

@media (max-width: 480px) {
    .header-btn span {
        display: inline;
        /* Keep text visible */
        font-size: 11px;
        /* Slightly smaller to fit */
    }

    .header-btn {
        padding: 8px 10px;
        gap: 4px;
        border-radius: 10px;
    }
}

@media (max-width: 600px) {
    .welcome-content {
        padding: 24px 20px;
    }

    .welcome-icon {
        font-size: 2.5rem;
    }

    .welcome-sections {
        gap: 16px;
    }

    .info-section.impact-box {
        padding: 16px;
    }
}

.welcome-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.info-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section.impact-box {
    background: #F0F9FF;
    /* Pastel Light Blue */
    border: 1px solid #E0F2FE;
    border-radius: 18px;
    padding: 24px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-section.impact-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.info-section.impact-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.info-section.impact-box h3 {
    color: #1E3A8A;
    /* Dark Blue */
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.info-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.warning-box {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text);
}

.warning-box i {
    color: #ff9800;
    margin-top: 2px;
}

.contact-box {
    margin-top: 20px;
    padding: 20px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.contact-box p {
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-link {
    color: #1E3A8A;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-link:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
}

/* Handsouts Button */
.handouts-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    border: none;
    color: white;
    padding: 18px 24px;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.handouts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4f46e5, var(--accent));
}

.handouts-btn:active {
    transform: translateY(0);
}

.handouts-btn i {
    font-size: 20px;
}

@media (max-width: 480px) {
    .handouts-btn {
        padding: 16px 20px;
        font-size: 15px;
        border-radius: 16px;
    }
}