/* ScieNEET Pro v10.0 - Multi-Exam + LaTeX Styles */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --extreme: #7c3aed;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    
    /* Exam colors */
    --neet: #059669;
    --jee-main: #2563eb;
    --jee-adv: #dc2626;
}

/* Reset */
.snp-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

.snp-app * { box-sizing: border-box; }

/* Header */
.snp-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.snp-header * { color: #fff !important; }
.snp-header-left { display: flex; align-items: center; gap: 15px; }
.snp-logo { height: 45px; }
.snp-header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.snp-header p { margin: 3px 0 0; opacity: 0.9; font-size: 0.9rem; }

.snp-exam-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.snp-exam-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.snp-exam-badge.neet { background: var(--neet); }
.snp-exam-badge.jee-main { background: var(--jee-main); }
.snp-exam-badge.jee-adv { background: var(--jee-adv); }

/* Container */
.snp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* Tabs */
.snp-tabs {
    display: flex;
    gap: 6px;
    background: var(--card);
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.snp-tab {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.snp-tab:hover { background: var(--bg); color: var(--text); }
.snp-tab.active { background: var(--primary); color: #fff !important; }

.snp-tab-content { display: none; }
.snp-tab-content.active { display: block; }

/* Cards */
.snp-card {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.snp-card h3 {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.snp-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.snp-col label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text);
}

.snp-input, .snp-select, .snp-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s;
}

.snp-input:focus, .snp-select:focus, .snp-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.snp-textarea { min-height: 100px; resize: vertical; }
.snp-multi { min-height: 140px; }

/* Difficulty Grid */
.snp-diff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.snp-diff-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg);
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.snp-diff-item:hover { border-color: var(--primary); }

.snp-diff-label {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    width: 100%;
    text-align: center;
}

.snp-diff-easy { background: #d1fae5; color: #065f46; }
.snp-diff-medium { background: #fef3c7; color: #92400e; }
.snp-diff-difficult { background: #fee2e2; color: #991b1b; }
.snp-diff-extreme { background: #ede9fe; color: #5b21b6; }

.snp-input-sm {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

/* Buttons */
.snp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.snp-btn-primary { background: var(--primary); color: #fff; }
.snp-btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.snp-btn-success { background: var(--success); color: #fff; }
.snp-btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

.snp-btn-lg { width: 100%; padding: 16px; font-size: 1.1rem; margin-top: 16px; }
.snp-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Progress */
.snp-progress {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.snp-summary {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #bae6fd;
}

.snp-summary-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #0369a1;
}

.snp-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.snp-summary-grid span { font-size: 0.9rem; }

.snp-summary-diff {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.snp-diff-tag {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}
.snp-diff-tag.easy { background: #d1fae5; color: #065f46; }
.snp-diff-tag.medium { background: #fef3c7; color: #92400e; }
.snp-diff-tag.difficult { background: #fee2e2; color: #991b1b; }
.snp-diff-tag.extreme { background: #ede9fe; color: #5b21b6; }

.snp-summary-chapters { font-size: 0.85rem; color: #0369a1; }

.snp-progress-bar {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.snp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s;
    border-radius: 6px;
}

.snp-progress-text {
    text-align: center;
    font-weight: 600;
    margin: 0;
}

/* Results */
.snp-results {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.snp-results-header {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.snp-title-input {
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px dashed transparent;
    background: transparent;
    color: #065f46;
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 350px;
}

.snp-title-input:hover, .snp-title-input:focus {
    border-color: #065f46;
    background: rgba(255,255,255,0.5);
}

.snp-results-stats span {
    padding: 6px 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #065f46;
}

.snp-results-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.snp-questions {
    padding: 20px;
    max-height: 800px;
    overflow-y: auto;
}

/* Question Card */
.snp-q {
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
    overflow: hidden;
}

.snp-q-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.snp-q-num {
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.snp-q-actions { margin-left: auto; display: flex; gap: 6px; }
.snp-q-actions button {
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.snp-q-actions button:hover { background: var(--bg); }

/* Badges */
.snp-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.snp-badge-easy { background: #d1fae5; color: #065f46; }
.snp-badge-medium { background: #fef3c7; color: #92400e; }
.snp-badge-difficult { background: #fee2e2; color: #991b1b; }
.snp-badge-extreme { background: #ede9fe; color: #5b21b6; }
.snp-badge-chapter { background: #e0e7ff; color: #3730a3; }
.snp-badge-subject { background: #fce7f3; color: #9d174d; }
.snp-badge-type { background: #cffafe; color: #0e7490; }

/* Question Content */
.snp-q-content { padding: 18px 20px; }

.snp-q-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text);
}

/* Options Grid */
.snp-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.snp-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.snp-option.correct {
    background: #ecfdf5;
    border-color: var(--success);
}

.snp-opt-label {
    background: var(--primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.snp-option.correct .snp-opt-label {
    background: var(--success);
}

.snp-opt-text {
    flex: 1;
    line-height: 1.6;
}

/* Answer Box */
.snp-answer-box {
    background: #ecfdf5;
    padding: 12px 16px;
    border-radius: 8px;
    color: #065f46;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Explanation */
.snp-explanation {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--primary);
}

.snp-expl-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.snp-expl-content {
    line-height: 1.8;
    color: #475569;
}

/* LaTeX Styling */
.latex-content .katex { font-size: 1.1em; }
.latex-content .katex-display { margin: 12px 0; overflow-x: auto; }

/* API Settings */
.snp-api-item {
    padding: 20px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.snp-api-head {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.snp-api-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.snp-api-badge.free { background: #d1fae5; color: #065f46; }
.snp-api-badge.best { background: #fef3c7; color: #92400e; }

.snp-api-item small { display: block; color: var(--muted); margin-top: 8px; font-size: 0.85rem; }
.snp-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.snp-link:hover { text-decoration: underline; }

/* Status messages */
.snp-success { color: var(--success); }
.snp-error { color: var(--danger); }
.snp-loading { color: var(--primary); }

/* Modal */
.snp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.snp-modal-box {
    background: #fff;
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.snp-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.snp-modal-head h3 { margin: 0; font-size: 1.2rem; }
.snp-modal-head button {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
}

.snp-modal-body { padding: 24px; }

.snp-modal-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.snp-modal-section:last-of-type { border-bottom: none; margin-bottom: 10px; }
.snp-modal-section h4 { margin: 0 0 15px; font-size: 1rem; }

.snp-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.snp-checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.snp-checks label:hover { border-color: var(--primary); }
.snp-checks input { accent-color: var(--primary); }

/* Footer */
.snp-footer {
    text-align: center;
    padding: 30px;
    margin-top: 30px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.snp-footer img { height: 35px; margin-bottom: 12px; }
.snp-footer p { margin: 5px 0; color: var(--muted); font-size: 0.9rem; }
.snp-footer a { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .snp-header { flex-direction: column; text-align: center; }
    .snp-diff-grid { grid-template-columns: repeat(2, 1fr); }
    .snp-options-grid { grid-template-columns: 1fr; }
    .snp-tabs { flex-direction: column; }
    .snp-results-header { flex-direction: column; text-align: center; }
}

/* Info Box */
.snp-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    color: #1e40af;
    font-size: 0.9rem;
}

.snp-warning {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1px solid #fcd34d;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    color: #92400e;
    font-size: 0.9rem;
}

/* Feature List */
.snp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.snp-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.9rem;
}

.snp-feature-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
