/* Professional StudyLeem Styles - Enhanced Version */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --accent: #2563eb;       /* StudyLeem blue accent */
    --accent-dark: #1e40af;
    --accent-light: #3b82f6;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --bg-lighter: #f3f4f6;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --shadow-lg: rgba(0, 0, 0, 0.2);
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Header Styles */
.header {
    background: var(--bg);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img, .logo svg {
    height: 50px;
    width: auto;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.logo-text .highlight {
    color: var(--primary);
}

/* Navigation */
.nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 71px;
    left: 0;
    right: 0;
    background: var(--bg);
    box-shadow: 0 8px 24px var(--shadow-md);
    z-index: 99;
    padding: 0.5rem 0 1rem;
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.35s ease;
    border-top: 3px solid var(--primary);
}

.mobile-menu.active {
    display: block;
    max-height: 85vh;
}

.mobile-nav-link {
    display: block;
    padding: 0.65rem 1.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link[href^="·"],
.mobile-nav-link:not([href="/"]):not([href="/fbise"]):not([href="/about"]):not([href="/contact"]):not([href="/privacy"]):not([href="/terms"]) {
    font-size: 0.85rem;
    color: var(--text-light);
    padding-left: 2.5rem;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: var(--bg-light);
    color: var(--primary);
    border-left-color: var(--accent);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 1.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, var(--primary) 60%, #1d4ed8 100%);
    color: white;
    padding: 4.5rem 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M1200 120L0 16.48V0h1200z" fill="rgba(255,255,255,0.05)"/></svg>') no-repeat bottom;
    background-size: 100% 120px;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
    padding-bottom: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    color: var(--accent-light, #3b82f6);
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-top: 0.5rem;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.classes-section {
    padding-top: 0;
    margin-top: 0;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    color: var(--text);
}

/* Class Cards */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.class-card {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.class-card:hover::before {
    transform: scaleX(1);
}

.class-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px var(--shadow-md);
    border-color: var(--primary);
}

.class-icon {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.class-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.class-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Subject Cards */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-md);
    border-color: var(--primary);
}

.subject-card h3 {
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subject-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Material Cards */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.material-card {
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    box-shadow: 0 8px 24px var(--shadow-md);
    transform: translateY(-5px);
}

.material-cover {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: #f3f4f6;
    padding: 0.5rem;
    
}

.material-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.material-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.material-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
    line-height: 1.4;
}

.material-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.material-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.material-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.6;
}

.card-preview-hint {
    display: block;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
    margin-top: auto;
}

.material-card:hover .card-preview-hint {
    background: var(--primary-dark);
}

/* Tabs */
.material-type-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.875rem 2rem;
    border: 2px solid var(--border);
    background: var(--bg);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    color: var(--text);
}

.tab-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.tab-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-lighter);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

/* ═══════════════════════════════════════════════
   FOOTER - Professional
═══════════════════════════════════════════════ */
.footer {
    flex-shrink: 0;
    margin-top: auto;
    color: white;
}

.footer-inner {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-top: 4px solid var(--accent);
    padding: 3.5rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Brand column */
.footer-brand {}

.footer-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.footer-logo-study {
    color: #fff;
}

.footer-logo-leem {
    color: #f97316;
}

.footer-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 280px;
}

.footer-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Link columns */
.footer-col {}

.footer-col-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 1.25rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-list a {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.footer-list a:hover {
    color: #f97316;
    transform: translateX(3px);
}

/* Bottom bar */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-bottom-left p {
    color: rgba(255,255,255,0.45);
    font-size: 0.8rem;
    margin: 0;
}

.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.footer-bottom-right a {
    color: rgba(255,255,255,0.5);
    transition: color 0.2s;
}

.footer-bottom-right a:hover {
    color: #f97316;
}

.footer-bottom-right span {
    color: rgba(255,255,255,0.25);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2.5rem 0;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
}

.page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-lighter);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
}

.pdf-modal {
    max-width: 1100px;
}

.pdf-container {
    width: 100%;
    height: 600px;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.download-section {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 10px;
}

.download-section .btn {
    min-width: 200px;
}

#timerDisplay {
    margin-top: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

/* Processing Indicator */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    font-size: 1rem;
}

/* Admin Styles */
.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 2rem;
}

.login-box {
    background: var(--bg);
    padding: 3rem;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: block;
}

.login-box h2 {
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    font-size: 1.75rem;
}

.back-link {
    display: block;
    margin-top: 1.5rem;
    color: var(--primary);
    text-align: center;
    font-weight: 500;
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid var(--error);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

#uploadStatus {
    margin-top: 1rem;
    padding: 0.875rem;
    border-radius: 10px;
    font-size: 0.9rem;
    display: none;
    font-weight: 500;
}

#uploadStatus:not(:empty) {
    display: block;
}

#uploadStatus.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

#uploadStatus.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.admin-body {
    background: var(--bg-light);
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--text);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-weight: 500;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-nav-link.logout {
    color: var(--error);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.admin-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
}

.mobile-sidebar-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.25rem;
}

.admin-page {
    display: none;
}

.admin-page.active {
    display: block;
}

.upload-card {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.material-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.type-radio {
    flex: 1;
    cursor: pointer;
}

.type-radio input[type="radio"] {
    display: none;
}

.type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.type-radio input[type="radio"]:checked + .type-label {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.type-icon {
    font-size: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.manage-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.manage-controls input,
.manage-controls select {
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.manage-controls input {
    flex: 1;
    min-width: 220px;
}

.materials-table {
    background: var(--bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    overflow-x: auto;
}

.materials-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.materials-table th,
.materials-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.materials-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text);
}

.materials-table tbody tr:hover {
    background: var(--bg-light);
}

.material-cover-thumb {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-md);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

/* Legal Pages */
.legal-content {
    padding: 3rem 0 4rem;
}

.content-max-width {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text);
}

.legal-content ul {
    margin: 1rem 0 1.5rem 2rem;
    line-height: 1.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    }

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .logo img, .logo svg {
        height: 40px;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .classes-grid,
    .subjects-grid,
    .materials-grid {
        grid-template-columns: 1fr;
    }
    
    .material-cover {
        height: 250px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }
    
    .mobile-sidebar-toggle {
        display: block;
    }
    
    .manage-controls {
        flex-direction: column;
    }
    
    .manage-controls input {
        width: 100%;
    }
    
    .pdf-container {
        height: 400px;
    }
    
    .material-type-selector {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .class-icon {
        font-size: 2.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* Hero Search Bar */
.hero-search {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-search input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    outline: none;
    color: var(--text);
}

.search-btn {
    background: var(--warning);
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: white;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #d97706;
}

/* Custom PDF Viewer */
.pdf-viewer-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#pdfCanvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-top: 1rem;
}

.pdf-nav-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.pdf-nav-btn:hover {
    background: var(--primary-dark);
}

.pdf-nav-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: var(--text);
}

.pdf-loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.125rem;
    color: var(--text-light);
}

/* Admin Panel Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
}

.status-message:not(:empty) {
    display: block;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* PDF Container Styles */
.pdf-container {
    width: 100%;
    min-height: 600px;
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
}

#pdfViewer {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
    background: white;
}

.download-section {
    margin-top: 1.5rem;
    text-align: center;
}

.download-section button {
    min-width: 200px;
}

#timerDisplay {
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Content Page Styles */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content-page h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.content-page h2:first-child {
    margin-top: 0;
}

.content-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.content-page ul, .content-page ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content-page li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--text);
}

.content-page strong {
    color: var(--primary);
    font-weight: 600;
}

.content-page a {
    color: var(--primary);
    text-decoration: underline;
}

.content-page a:hover {
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .content-page {
        padding: 1.5rem;
    }

    .content-page h2 {
        font-size: 1.5rem;
    }

    .content-page h3 {
        font-size: 1.125rem;
    }
}

/* ═══════════════════════════════════════════════
   NEW ADDITIONS — clean URLs + exercises + SEO
═══════════════════════════════════════════════ */

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .875rem; opacity: .85; margin-bottom: .75rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.85); text-decoration: underline; }
.breadcrumb span { opacity: .7; }

/* Page header subtitle */
.page-header p { margin-top: .5rem; opacity: .85; font-size: 1rem; }

/* Type switcher (notes / books) */
.type-switcher { display: flex; gap: .75rem; flex-wrap: wrap; }
.type-switch-btn {
  padding: .6rem 1.5rem; border: 2px solid var(--border);
  border-radius: 50px; font-weight: 600; font-size: .9rem;
  background: var(--bg); color: var(--text); transition: all .2s;
}
.type-switch-btn.active,
.type-switch-btn:hover {
  border-color: var(--primary); background: var(--primary); color: #fff;
}

/* Section subtitle */
.section-subtitle {
  text-align: center; color: var(--text-light);
  margin-top: -.5rem; margin-bottom: 2.5rem; font-size: 1rem;
}

/* Chapter list */
.chapters-list { display: flex; flex-direction: column; gap: .75rem; }
.chapter-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.1rem 1.25rem;
  transition: all .25s; cursor: pointer;
}
.chapter-item:hover {
  border-color: var(--primary); box-shadow: 0 4px 16px var(--shadow);
  transform: translateX(4px);
}
.chapter-num {
  min-width: 110px; font-weight: 700; color: var(--primary); font-size: .9rem;
}
.chapter-info { flex: 1; min-width: 0; }
.chapter-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.chapter-desc { font-size: .85rem; color: var(--text-light); margin: .2rem 0 0; }
.chapter-arrow { color: var(--text-light); font-size: 1.1rem; flex-shrink: 0; }

/* Filter tabs (chapters / exercises) */
.material-type-tabs {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}

/* Features grid */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem;
}
.feature-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.75rem; text-align: center;
}
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .5rem; }
.feature-card p  { color: var(--text-light); font-size: .9rem; line-height: 1.6; }

/* Quick links grid */
.quick-links-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem;
}
.quick-link-card {
  background: var(--bg); border: 2px solid var(--border);
  border-radius: 10px; padding: 1rem; text-align: center;
  font-weight: 600; font-size: .95rem; transition: all .2s;
}
.quick-link-card:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-3px);
}

/* Search dropdown */
.hero-search { position: relative; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-md); z-index: 200; overflow: hidden;
}
.search-result-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text); transition: background .15s; font-size: .9rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-light); }
.search-result-item strong { margin-right: auto; }
.search-meta { font-size: .78rem; color: var(--text-light); flex-shrink: 0; }
.search-no-results { padding: 1.25rem; text-align: center; color: var(--text-light); }

/* Manage page filters */
.manage-filters {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.manage-filters .search-input {
  flex: 1; min-width: 200px; padding: .75rem 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; font-family: inherit;
}
.manage-filters select {
  padding: .75rem 1rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .95rem; font-family: inherit; background: var(--bg);
}

/* Admin table */
.table-responsive { overflow-x: auto; border-radius: 12px; box-shadow: 0 2px 8px var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg); min-width: 750px; }
.admin-table th, .admin-table td {
  padding: .875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.admin-table th { background: var(--bg-light); font-weight: 700; color: var(--text); }
.admin-table tbody tr:hover { background: var(--bg-light); }

/* Contact form */
.contact-section { padding: 4rem 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-form-card {
  background: var(--bg); border-radius: 16px; padding: 2.5rem;
  box-shadow: 0 2px 12px var(--shadow);
}
.contact-info-card { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-info-item {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--bg); border-radius: 12px; padding: 1.25rem;
  box-shadow: 0 2px 8px var(--shadow);
}
.contact-info-icon { font-size: 1.5rem; flex-shrink: 0; }

/* 404 page */
.not-found {
  min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center;
}
.not-found-content h1 { font-size: 8rem; font-weight: 900; color: var(--primary); line-height: 1; }
.not-found-content h2 { font-size: 2rem; margin: 1rem 0 .5rem; }
.not-found-content p  { color: var(--text-light); margin-bottom: 2rem; }

/* Responsive extras */
@media (max-width: 768px) {
  .contact-grid     { grid-template-columns: 1fr; }
  .chapter-num      { min-width: 80px; font-size: .82rem; }
  .features-grid    { grid-template-columns: 1fr 1fr; }
  .quick-links-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .chapter-item  { flex-wrap: wrap; }
}

/* ── Book item card in chapters list ── */
.book-item {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #bfdbfe;
}
.book-item:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

/* ── Accent / orange highlights ── */
.nav-link.active,
.nav-link:hover {
    color: var(--primary);
}

/* Logo: "Study" = blue, "Leem" = orange */
.logo-leem {
    color: #f97316 !important;
}

/* Hero wave connector to classes section */
.hero-wave {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin-bottom: -2px;
    background: linear-gradient(135deg, #1e40af 0%, var(--primary) 60%, #1d4ed8 100%);
}
.hero-wave svg {
    display: block;
    width: 100%;
}

/* Classes section flush with hero */
.classes-section {
    padding-top: 2.5rem !important;
}

/* stat numbers accent */
.hero .stat-number {
    color: #fbbf24;
}

/* Page header accent bar */
.page-header {
    border-bottom: 4px solid var(--accent);
}

/* Type switch buttons accent */
.type-switch-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.type-switch-btn:not(.active):hover {
    border-color: var(--accent);
    color: #f97316;
}

/* Subject cards accent hover */
.subject-card:hover {
    border-color: var(--accent);
}
.subject-card:hover h3 {
    color: #f97316;
}

/* Class card accent hover */
.class-card:hover {
    border-color: var(--accent);
}

/* Footer full-width on mobile */
@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    .footer-brand {
        grid-column: 1;
    }
    .footer-logo {
        font-size: 1.5rem;
    }
}
