/* Advanced Quiz Builder - Frontend Styles */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Work+Sans:wght@400;600;800&display=swap');

:root {
    --aqb-primary: #6366f1;
    --aqb-primary-dark: #4f46e5;
    --aqb-secondary: #ec4899;
    --aqb-success: #10b981;
    --aqb-danger: #ef4444;
    --aqb-dark: #0f172a;
    --aqb-gray: #64748b;
    --aqb-light: #f8fafc;
    --aqb-border: #e2e8f0;
}

* {
    box-sizing: border-box;
}

.aqb-quiz-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Work Sans', sans-serif;
}

/* Quiz Header */
.aqb-quiz-header {
    background: linear-gradient(135deg, var(--aqb-primary) 0%, var(--aqb-secondary) 100%);
    border-radius: 24px 24px 0 0;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.aqb-quiz-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.aqb-quiz-title {
    font-family: 'Space Mono', monospace;
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.aqb-quiz-progress {
    position: relative;
    z-index: 1;
}

.aqb-progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    height: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.aqb-progress-fill {
    background: white;
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.aqb-progress-text {
    margin-top: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    opacity: 0.95;
    font-family: 'Space Mono', monospace;
}

/* Quiz Form */
.aqb-quiz-form {
    background: white;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.aqb-question-slide {
    display: none;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.aqb-question-slide.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.aqb-question-card {
    padding: 50px;
    min-height: 400px;
    position: relative;
}

.aqb-question-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--aqb-primary), var(--aqb-secondary));
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-family: 'Space Mono', monospace;
}

.aqb-question-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--aqb-dark);
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.aqb-question-label-frontend {
    font-size: 13px;
    color: var(--aqb-gray);
    font-weight: 500;
    margin: -10px 0 25px 0;
    font-style: italic;
    opacity: 0.8;
}

.aqb-question-subtitle {
    font-size: 18px;
    color: var(--aqb-gray);
    margin-bottom: 30px;
}

.aqb-required {
    color: var(--aqb-danger);
}

/* Form Elements */
.aqb-form-group {
    margin-bottom: 25px;
}

.aqb-form-group label {
    display: block;
    font-weight: 600;
    color: var(--aqb-dark);
    margin-bottom: 10px;
    font-size: 15px;
}

.aqb-input,
.aqb-textarea,
.aqb-select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--aqb-border);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Work Sans', sans-serif;
    background: white;
}

.aqb-input:focus,
.aqb-textarea:focus,
.aqb-select:focus {
    outline: none;
    border-color: var(--aqb-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.aqb-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Radio and Checkbox */
.aqb-radio-label,
.aqb-checkbox-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--aqb-light);
    border: 2px solid var(--aqb-border);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.aqb-radio-label:hover,
.aqb-checkbox-label:hover {
    background: white;
    border-color: var(--aqb-primary);
    transform: translateX(5px);
}

.aqb-radio-label input[type="radio"],
.aqb-checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: var(--aqb-primary);
}

.aqb-radio-label:has(input:checked),
.aqb-checkbox-label:has(input:checked) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border-color: var(--aqb-primary);
    font-weight: 600;
}

.aqb-radio-label:has(input:checked)::after,
.aqb-checkbox-label:has(input:checked)::after {
    content: '✓';
    position: absolute;
    right: 20px;
    color: var(--aqb-primary);
    font-weight: 700;
    font-size: 20px;
}

/* Range Slider */
.aqb-range-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.aqb-range {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: var(--aqb-light);
    outline: none;
    -webkit-appearance: none;
}

.aqb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aqb-primary), var(--aqb-secondary));
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.aqb-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aqb-primary), var(--aqb-secondary));
    cursor: pointer;
    border: none;
}

.aqb-range-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--aqb-primary);
    min-width: 60px;
    text-align: center;
    font-family: 'Space Mono', monospace;
}

/* Color Picker */
.aqb-color-input {
    width: 100px;
    height: 60px;
    border: 3px solid var(--aqb-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aqb-color-input:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* File Upload */
.aqb-file-input {
    padding: 20px;
    border: 3px dashed var(--aqb-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aqb-file-input:hover {
    border-color: var(--aqb-primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Buttons */
.aqb-question-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--aqb-border);
}

.aqb-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aqb-btn-prev {
    background: var(--aqb-light);
    color: var(--aqb-gray);
}

.aqb-btn-prev:hover {
    background: var(--aqb-border);
    transform: translateX(-5px);
}

.aqb-btn-next,
.aqb-btn-submit {
    background: linear-gradient(135deg, var(--aqb-primary), var(--aqb-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    flex: 1;
}

.aqb-btn-next:hover,
.aqb-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.aqb-btn-submit {
    background: linear-gradient(135deg, var(--aqb-success), #059669);
}

/* Results */
.aqb-results-section {
    padding: 60px 50px;
    text-align: center;
}

.aqb-results-card {
    animation: slideIn 0.6s ease;
}

.aqb-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.aqb-results-title {
    font-family: 'Space Mono', monospace;
    font-size: 36px;
    font-weight: 700;
    color: var(--aqb-dark);
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

.aqb-results-score {
    font-size: 72px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--aqb-primary), var(--aqb-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
    font-family: 'Space Mono', monospace;
}

.aqb-results-message {
    font-size: 20px;
    color: var(--aqb-gray);
    margin-top: 20px;
}

/* Empty State */
.aqb-quiz-empty {
    padding: 100px 50px;
    text-align: center;
    color: var(--aqb-gray);
    font-size: 18px;
}

/* Loading State */
.aqb-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.aqb-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--aqb-border);
    border-top-color: var(--aqb-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .aqb-quiz-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .aqb-quiz-header {
        padding: 30px 20px;
        border-radius: 20px 20px 0 0;
    }
    
    .aqb-quiz-title {
        font-size: 32px;
    }
    
    .aqb-question-card {
        padding: 30px 20px;
        min-height: auto;
    }
    
    .aqb-question-title {
        font-size: 24px;
    }
    
    .aqb-question-actions {
        flex-direction: column;
    }
    
    .aqb-btn {
        width: 100%;
    }
    
    .aqb-results-section {
        padding: 40px 20px;
    }
    
    .aqb-results-title {
        font-size: 28px;
    }
    
    .aqb-results-score {
        font-size: 48px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .aqb-quiz-form {
        background: #1e293b;
    }
    
    .aqb-question-title {
        color: white;
    }
    
    .aqb-input,
    .aqb-textarea,
    .aqb-select {
        background: #0f172a;
        border-color: #334155;
        color: white;
    }
    
    .aqb-radio-label,
    .aqb-checkbox-label {
        background: #0f172a;
        border-color: #334155;
        color: white;
    }
}
