/* Smart Quiz Builder Pro - Frontend Styles */

.sqb-v10-wrapper {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 900px;
    margin: 20px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.sqb-v10-wrapper * {
    box-sizing: border-box;
}

.sqb-screen {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.sqb-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Start Screen */
.sqb-start-card {
    text-align: center;
    padding: 40px 20px;
}

.sqb-icon-lg {
    font-size: 3.5em;
    display: block;
    margin-bottom: 15px;
}

.sqb-title {
    font-size: 1.8em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 10px;
}

.sqb-meta {
    color: #718096;
    margin-bottom: 25px;
}

.sqb-quote {
    background: #ebf8ff;
    color: #2c5282;
    padding: 15px;
    border-radius: 8px;
    font-style: italic;
    margin-bottom: 25px;
    display: inline-block;
}

.sqb-btn-start {
    background: #3182ce;
    color: white;
    padding: 12px 35px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.3);
}

.sqb-btn-start:hover {
    transform: scale(1.05);
}

/* Quiz UI */
.sqb-top-bar {
    background: #2d3748;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sqb-tabs {
    display: flex;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.sqb-tab {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: #718096;
    font-weight: 600;
    white-space: nowrap;
}

.sqb-tab.active {
    color: #3182ce;
    border-bottom-color: #3182ce;
    background: white;
}

.sqb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: white;
    border-bottom: 1px solid #edf2f7;
    max-height: 120px;
    overflow-y: auto;
}

.sqb-grid-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    font-size: 14px;
}

.sqb-grid-item.current {
    border-color: #3182ce;
    background: #ebf8ff;
    color: #2b6cb0;
    font-weight: bold;
}

.sqb-grid-item.answered {
    background: #c6f6d5;
    border-color: #9ae6b4;
    color: #22543d;
}

.sqb-grid-item.flagged {
    border-color: #ed8936;
    color: #ed8936;
    position: relative;
}

.sqb-grid-item.flagged::after {
    content: '•';
    position: absolute;
    top: 0;
    right: 2px;
    color: #ed8936;
}

.sqb-q-body {
    padding: 20px 0;
    min-height: 250px;
}

.sqb-passage {
    background: #fffaf0;
    border-right: 4px solid #ed8936;
    padding: 15px;
    margin-bottom: 20px;
    color: #2d3748;
    border-radius: 4px;
    line-height: 1.7;
}

.sqb-q-text {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1a202c;
}

.sqb-q-img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    display: block;
}

/* Options with Images */
.sqb-opt {
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
}

.sqb-opt:hover {
    background: #ebf8ff;
    border-color: #bee3f8;
}

.sqb-opt.selected {
    background: #ebf8ff;
    border-color: #3182ce;
    color: #2b6cb0;
    font-weight: bold;
}

.sqb-opt-circle {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-inline-end: 10px;
    flex-shrink: 0;
}

.sqb-opt.selected .sqb-opt-circle {
    background: #3182ce;
    border-color: #3182ce;
}

.sqb-opt-img {
    max-height: 80px;
    max-width: 150px;
    margin-inline-start: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.sqb-feedback {
    margin-top: 15px;
    padding: 12px;
    background: #e6fffa;
    border-radius: 6px;
    display: none;
}

.review-mode .sqb-opt {
    cursor: default;
}

.review-mode .sqb-opt.correct {
    background: #f0fff4;
    border-color: #48bb78;
}

.review-mode .sqb-opt.wrong {
    background: #fff5f5;
    border-color: #f56565;
}

/* Footer */
.sqb-footer {
    padding: 15px;
    background: #f7fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sqb-btn {
    padding: 10px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    flex: 1;
    min-height: 40px;
}

.sqb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sqb-btn-next {
    background: #3182ce;
    flex: 2;
}

.sqb-btn-prev {
    background: #a0aec0;
    flex: 1;
}

.sqb-btn-flag {
    background: transparent;
    border: 1px solid #ed8936;
    color: #ed8936;
    flex: 0 0 auto;
    padding: 10px 15px;
}

.sqb-btn-flag.active {
    background: #ed8936;
    color: white;
}

.sqb-btn-submit {
    background: #48bb78;
    flex: 2;
}

.sqb-btn-exit {
    background: #e53e3e;
    flex: 2;
}

/* Result Screen */
.sqb-res-box {
    text-align: center;
    padding: 30px 20px;
}

.sqb-score-lg {
    font-size: 3em;
    font-weight: bold;
    color: #3182ce;
    margin: 15px 0;
}

.sqb-res-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.sqb-res-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    min-width: 120px;
}

/* RTL Support */
[dir="rtl"] .sqb-opt-circle {
    margin-inline-start: 10px;
    margin-inline-end: 0;
}

[dir="rtl"] .sqb-opt-img {
    margin-inline-end: 10px;
    margin-inline-start: 0;
}

[dir="rtl"] .sqb-passage {
    border-right: none;
    border-left: 4px solid #ed8936;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sqb-v10-wrapper {
        border-radius: 0;
        margin: 0;
        border: none;
    }
    
    .sqb-footer {
        flex-direction: column;
    }
    
    .sqb-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .sqb-opt {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sqb-opt-img {
        margin-top: 5px;
        max-width: 100%;
    }
    
    .sqb-btn-flag span {
        display: none;
    }
    
    .sqb-btn-flag::after {
        content: '🚩';
    }
}
