/* ============================================
   WEST RAND EXAM PREP — Q&A Platform Styles
   Dark theme | Red + Cyan accent | Mobile-first
   ============================================ */

:root {
    --brand-red: #991B1B;
    --brand-red-dark: #7F1D1D;
    --brand-red-light: #B91C1C;
    --cyan: #00D9FF;
    --cyan-dark: #00B8D4;
    --bg: #0A0A0A;
    --bg-elevated: #141414;
    --bg-card: #1A1A1A;
    --bg-card-hover: #222222;
    --border: #2A2A2A;
    --border-light: #333333;
    --text: #F5F5F5;
    --text-secondary: #AAAAAA;
    --text-muted: #777777;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --font-heading: 'Archivo Black', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Urgency Banner ── */
.urgency-banner {
    background: linear-gradient(90deg, var(--brand-red), var(--brand-red-dark));
    padding: 10px 0;
    position: relative;
    z-index: 100;
}
.urgency-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    text-align: center;
}
.urgency-pulse {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Header ── */
.main-header {
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-first { font-family: var(--font-heading); font-size: 0.85rem; color: var(--text); letter-spacing: 0.5px; }
.logo-second { font-family: var(--font-heading); font-size: 1rem; color: var(--brand-red-light); letter-spacing: 1px; }

.btn-post {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-post:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(153,27,27,0.3); }

/* ── Hero ── */
.hero { position: relative; padding: 60px 0 50px; overflow: hidden; }
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(153,27,27,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0,217,255,0.06) 0%, transparent 40%);
    pointer-events: none;
}
.hero-content { position: relative; text-align: center; max-width: 800px; margin: 0 auto; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,217,255,0.1);
    border: 1px solid rgba(0,217,255,0.2);
    color: var(--cyan);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1.15;
    margin-bottom: 16px;
}
.hero-title .highlight { color: var(--brand-red-light); position: relative; }
.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--brand-red), transparent);
    opacity: 0.4;
    border-radius: 4px;
    z-index: -1;
}
.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 28px;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.stat { text-align: center; }
.stat-number { display: block; font-family: var(--font-heading); font-size: 1.6rem; color: var(--cyan); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    animation: ctaPulse 2s ease-in-out infinite;
}
.hero-cta:hover { animation: none; transform: scale(1.04); }
@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(153,27,27,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(153,27,27,0); }
}

/* ── Filters ── */
.filters-section { padding: 20px 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.filter-group select, .search-box input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.filter-group select:hover, .search-box input:hover { border-color: var(--border-light); }
.filter-group select:focus, .search-box input:focus { outline: none; border-color: var(--cyan); }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.search-box input { padding-left: 32px; min-width: 220px; }

/* ── Feed Section ── */
.feed-section { padding: 40px 0 60px; }
.feed-header { margin-bottom: 28px; }
.feed-header h2 { font-family: var(--font-heading); font-size: 1.3rem; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.feed-header h2 i { color: var(--cyan); }
.feed-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Question Cards ── */
.questions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.question-card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: var(--shadow); }
.question-card:hover .question-image img { transform: scale(1.03); }

.question-image {
    width: 100%;
    height: 180px;
    background: var(--bg-elevated);
    overflow: hidden;
    position: relative;
}
.question-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.question-image .no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 2.5rem;
}
.question-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-pending { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.status-solved { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }

.question-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.meta-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 50px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
}
.meta-tag.grade { background: rgba(0,217,255,0.1); color: var(--cyan); }
.meta-tag.subject { background: rgba(153,27,27,0.15); color: var(--brand-red-light); }

.question-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.question-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.question-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.question-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}
.action-waiting { background: rgba(245,158,11,0.1); color: var(--warning); }
.action-unlock { background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark)); color: #fff; }
.action-view { background: rgba(16,185,129,0.15); color: var(--success); }

/* ── Loading / Empty States ── */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.loading-state i { font-size: 2rem; margin-bottom: 12px; display: block; }
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--border-light); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ── How It Works ── */
.how-it-works { padding: 50px 0; background: var(--bg-elevated); border-top: 1px solid var(--border); }
.how-it-works .section-title { text-align: center; margin-bottom: 32px; font-family: var(--font-heading); }
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.step-card {
    flex: 1;
    min-width: 220px;
    max-width: 280px;
    text-align: center;
    padding: 28px 20px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.step-num {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--brand-red);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-card > i { font-size: 1.8rem; color: var(--cyan); margin: 8px 0 12px; }
.step-card h3 { font-size: 1rem; margin-bottom: 6px; }
.step-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.step-arrow { color: var(--border-light); font-size: 1.2rem; }

/* ── CTA Section ── */
.cta-section { padding: 40px 0 60px; }
.cta-box {
    background: linear-gradient(135deg, rgba(153,27,27,0.12), rgba(0,217,255,0.05));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.cta-text h2 { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 6px; }
.cta-text p { color: var(--text-secondary); font-size: 0.9rem; max-width: 400px; }
.cta-whatsapp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    flex-shrink: 0;
}
.cta-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(153,27,27,0.3); }

/* ── Footer ── */
.main-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding: 24px 0; }
.footer-bottom { text-align: center; }
.footer-bottom p { color: var(--text-muted); font-size: 0.8rem; }

/* ═══════════════════════════════════════════ */
/* MODALS */
/* ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }
.modal-content.modal-lg { max-width: 700px; }
.modal-content.modal-sm { max-width: 440px; }
.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}
.close-modal:hover { background: var(--border); color: var(--text); }
.modal-header { padding: 28px 28px 0; }
.modal-header h2 { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.modal-header h2 i { color: var(--cyan); }
.modal-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Forms ── */
form { padding: 20px 28px 28px; }
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--cyan); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-help { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(153,27,27,0.3); }
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text); }

/* ── Image Upload ── */
.image-upload {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}
.image-upload:hover { border-color: var(--cyan); }
.image-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.upload-placeholder {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}
.upload-placeholder i { font-size: 2rem; margin-bottom: 8px; display: block; }
.upload-placeholder span { font-size: 0.85rem; }
.upload-preview { position: relative; }
.upload-preview img { width: 100%; max-height: 200px; object-fit: contain; background: var(--bg-elevated); }
.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* ── Detail Modal Content ── */
.detail-question { padding: 24px 28px; }
.detail-meta { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-image { width: 100%; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; background: var(--bg-elevated); }
.detail-image img { width: 100%; max-height: 400px; object-fit: contain; }
.detail-text { font-size: 1rem; line-height: 1.6; margin-bottom: 20px; white-space: pre-wrap; }

.solution-section { padding: 24px 28px; background: var(--bg-elevated); border-top: 1px solid var(--border); }
.solution-section.solved { border-top-color: rgba(16,185,129,0.3); }
.solution-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.solution-header i { color: var(--success); font-size: 1.2rem; }
.solution-header h3 { font-family: var(--font-heading); font-size: 1.1rem; }
.solution-text { font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; margin-bottom: 16px; }
.solution-image { width: 100%; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; }
.solution-image img { width: 100%; max-height: 400px; object-fit: contain; background: var(--bg); }

.paywall {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(153,27,27,0.08), rgba(0,217,255,0.04));
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
}
.paywall-icon { font-size: 2.5rem; color: var(--warning); margin-bottom: 12px; }
.paywall h4 { font-size: 1.1rem; margin-bottom: 8px; }
.paywall p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.paywall-price { font-family: var(--font-heading); font-size: 1.8rem; color: var(--cyan); margin-bottom: 16px; }

/* ── Unlock Modal ── */
.unlock-body { padding: 0 28px 28px; text-align: center; }
.unlock-question { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; text-align: left; }
.unlock-question h4 { font-size: 0.9rem; margin-bottom: 4px; }
.unlock-question p { font-size: 0.85rem; color: var(--text-secondary); }
.unlock-price { font-family: var(--font-heading); font-size: 2rem; color: var(--cyan); margin-bottom: 8px; }
.unlock-note { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }
.unlock-form { text-align: left; }
.unlock-form .form-group { margin-bottom: 14px; }
.unlock-form label { font-size: 0.8rem; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.toast i { color: var(--warning); font-size: 1.1rem; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }

/* ── Loading Overlay ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.loading-overlay.active { opacity: 1; visibility: visible; }
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--brand-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar { height: 56px; }
    .btn-post span { display: none; }
    .hero { padding: 40px 0 30px; }
    .hero-stats { gap: 20px; }
    .stat-number { font-size: 1.3rem; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { justify-content: center; }
    .search-box input { width: 100%; }
    .questions-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
    .step-card { max-width: 100%; }
    .cta-box { flex-direction: column; text-align: center; }
    .modal-content { margin: 10px; max-height: 95vh; }
}