/* ============================================
   RO DRIVING QUIZ - FRONTEND STYLES
   ============================================ */

:root {
    --rdq-primary: #0052CC;
    --rdq-primary-dark: #003D99;
    --rdq-secondary: #1E88E5;
    --rdq-success: #28a745;
    --rdq-danger: #dc3545;
    --rdq-warning: #ffc107;
    --rdq-light: #f8f9fa;
    --rdq-dark: #212529;
    --rdq-white: #ffffff;
    --rdq-border: #dee2e6;
    --rdq-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============ General Styles ============ */

.rdq-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.rdq-btn-primary:hover {
    background-color: var(--rdq-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--rdq-shadow);
}

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

.rdq-btn-secondary:hover {
    background-color: #e2e6ea;
}

.rdq-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.rdq-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ Start Test Screen ============ */

.rdq-start-test-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: var(--rdq-white);
    border-radius: 12px;
    box-shadow: var(--rdq-shadow);
}

.rdq-test-info h2 {
    color: var(--rdq-primary);
    margin-bottom: 30px;
    text-align: center;
    font-size: 32px;
}

.rdq-test-rules {
    background: var(--rdq-light);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.rdq-test-rules h3 {
    color: var(--rdq-dark);
    margin-bottom: 20px;
    font-size: 24px;
}

.rdq-test-rules ul {
    list-style: none;
    padding: 0;
}

.rdq-test-rules li {
    padding: 12px 0;
    border-bottom: 1px solid var(--rdq-border);
    font-size: 16px;
    line-height: 1.6;
}

.rdq-test-rules li:last-child {
    border-bottom: none;
}

.rdq-test-rules strong {
    color: var(--rdq-primary);
}

#rdq-start-test-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ============ Quiz Container ============ */

.rdq-quiz-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
}

/* ============ Timer & Progress ============ */

.rdq-timer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rdq-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--rdq-shadow);
}

.rdq-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--rdq-primary);
}

.rdq-timer-icon {
    font-size: 28px;
}

.rdq-timer.warning {
    color: var(--rdq-warning);
}

.rdq-timer.danger {
    color: var(--rdq-danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rdq-progress-info {
    font-size: 16px;
    color: var(--rdq-dark);
}

#rdq-answered-count {
    font-weight: bold;
    color: var(--rdq-primary);
}

/* ============ Questions ============ */

.rdq-questions-wrapper {
    background: var(--rdq-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--rdq-shadow);
    margin-bottom: 20px;
    min-height: 400px;
}

.rdq-question {
    display: none;
}

.rdq-question.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rdq-question-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--rdq-primary);
}

.rdq-question-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--rdq-primary);
}

.rdq-question-image {
    margin: 20px 0;
    text-align: center;
}

.rdq-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--rdq-shadow);
}

.rdq-question-text {
    margin: 20px 0;
}

.rdq-question-text p {
    font-size: 20px;
    line-height: 1.6;
    color: var(--rdq-dark);
    font-weight: 500;
}

/* ============ Answers ============ */

.rdq-answers {
    margin-top: 30px;
}

.rdq-answer-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--rdq-light);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rdq-answer-option:hover {
    background: #e9ecef;
    border-color: var(--rdq-primary);
}

.rdq-answer-option input {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rdq-answer-option input:checked ~ .rdq-answer-text {
    font-weight: bold;
    color: var(--rdq-primary);
}

.rdq-answer-option.selected {
    background: #cfe2ff;
    border-color: var(--rdq-primary);
}

.rdq-answer-text {
    font-size: 16px;
    line-height: 1.5;
    flex: 1;
}

/* ============ Navigation ============ */

.rdq-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rdq-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--rdq-shadow);
    margin-bottom: 20px;
}

.rdq-question-dots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    padding: 0 20px;
}

.rdq-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rdq-light);
    border: 2px solid var(--rdq-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.rdq-dot:hover {
    transform: scale(1.3);
}

.rdq-dot.answered {
    background: var(--rdq-primary);
    border-color: var(--rdq-primary);
}

.rdq-dot.current {
    width: 16px;
    height: 16px;
    background: var(--rdq-secondary);
    border-color: var(--rdq-secondary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.3);
}

/* ============ Submit Container ============ */

.rdq-submit-container {
    text-align: center;
    background: var(--rdq-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--rdq-shadow);
}

#rdq-submit-test-btn {
    min-width: 300px;
}

/* ============ Login Required ============ */

.rdq-login-required {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: var(--rdq-white);
    border-radius: 12px;
    box-shadow: var(--rdq-shadow);
    text-align: center;
}

.rdq-login-required h3 {
    color: var(--rdq-primary);
    margin-bottom: 20px;
    font-size: 28px;
}

.rdq-login-required p {
    font-size: 16px;
    margin-bottom: 30px;
    color: #6c757d;
}

.rdq-login-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ============ Upgrade Message ============ */

.rdq-upgrade-message {
    max-width: 600px;
    margin: 60px auto;
    padding: 50px;
    background: var(--rdq-white);
    border-radius: 12px;
    box-shadow: var(--rdq-shadow);
    text-align: center;
}

.rdq-message-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.rdq-upgrade-message h3 {
    color: var(--rdq-dark);
    margin-bottom: 30px;
    font-size: 24px;
    line-height: 1.5;
}

/* ============ Responsive ============ */

@media (max-width: 768px) {
    .rdq-start-test-container,
    .rdq-quiz-container {
        padding: 20px;
        margin: 10px;
    }
    
    .rdq-timer-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .rdq-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .rdq-question-dots {
        order: -1;
        padding: 0;
    }
    
    .rdq-question-text p {
        font-size: 18px;
    }
    
    .rdq-login-buttons {
        flex-direction: column;
    }
    
    .rdq-btn {
        width: 100%;
    }
}

/* ============ Loading Spinner ============ */

.rdq-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--rdq-white);
    animation: spin 1s linear infinite;
}

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

/* ============ Alerts ============ */

.rdq-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.rdq-alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.rdq-alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.rdq-alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}