/**
 * 🎨 VEFIFY QUIZ BRANDING STYLES
 * File: assets/css/quiz-branding.css
 * 
 * Branding, fullscreen mode, and custom styling
 */

/* =============================================================================
   FULLSCREEN QUIZ MODE
   ============================================================================= */

.vefify-quiz-fullscreen {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    min-height: 100vh !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    overflow-y: visible;
    background: var(--vefify-bg-color, #f8f9fa);
}

/* Hide WordPress theme elements when in fullscreen mode */
/* REMOVED overflow hidden to allow scrolling
.vefify-quiz-fullscreen-active body {
    overflow: hidden !important;
}
*/

.vefify-quiz-fullscreen-active #wpadminbar,
.vefify-quiz-fullscreen-active header,
.vefify-quiz-fullscreen-active .site-header,
.vefify-quiz-fullscreen-active nav,
.vefify-quiz-fullscreen-active .navbar,
.vefify-quiz-fullscreen-active footer,
.vefify-quiz-fullscreen-active .site-footer,
.vefify-quiz-fullscreen-active aside,
.vefify-quiz-fullscreen-active .sidebar,
.vefify-quiz-fullscreen-active .widget-area {
    display: none !important;
}

/* =============================================================================
   BRAND LOGO SECTION
   ============================================================================= */

.vefify-brand-header {
    text-align: center;
    padding: 20px;
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    width: 100%;
}

.vefify-brand-logo {
    max-width: 300px;
    height: auto;
    display: inline-block;
    transition: all 0.3s ease;
}

.vefify-brand-logo:hover {
    transform: scale(1.05);
}

/* Logo responsive sizing */
@media (max-width: 768px) {
    .vefify-brand-logo {
        max-width: 200px;
    }
    
    .vefify-brand-header {
        padding: 15px;
        position: fixed; /* Ensure fixed on mobile too */
    }
    
    /* Adjust content padding for mobile */
    .vefify-quiz-fullscreen .vefify-brand-header + .vefify-quiz-content {
        padding-top: 80px;
    }
    
    /* Fix mobile scrolling */
    .vefify-quiz-fullscreen {
        position: absolute !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
}

@media (max-width: 480px) {
    .vefify-brand-logo {
        max-width: 150px;
    }
    
    .vefify-brand-header {
        padding: 10px;
        position: fixed !important;
    }
    
    /* Further adjust for small screens */
    .vefify-quiz-fullscreen .vefify-brand-header + .vefify-quiz-content {
        padding-top: 70px;
    }
    
    /* Ensure body can scroll on mobile */
    body {
        overflow-y: visible !important;
        height: auto !important;
    }
}

/* =============================================================================
   CUSTOM BACKGROUNDS
   ============================================================================= */

/* Background image support */
.vefify-bg-image {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Background gradient support */
.vefify-bg-gradient {
    background: var(--vefify-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%)) !important;
}

/* Background overlay for readability */
.vefify-quiz-container.has-background-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* =============================================================================
   ENHANCED QUIZ CONTAINER
   ============================================================================= */

.vefify-quiz-branded {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.vefify-quiz-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

/* Add padding when brand header is present */
.vefify-quiz-fullscreen .vefify-brand-header + .vefify-quiz-content {
    padding-top: 90px; /* Account for fixed header */
}

/* Enhanced quiz sections with glassmorphism */
.vefify-quiz-section.branded {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.vefify-quiz-section.branded:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.08);
}

/* =============================================================================
   BRANDED FORM STYLES
   ============================================================================= */

.vefify-field-input.branded {
    border: 2px solid rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.vefify-field-input.branded:focus {
    border-color: var(--vefify-primary-color, #007cba);
    box-shadow: 0 0 0 4px rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.1);
    background: rgba(255, 255, 255, 1);
}

/* =============================================================================
   BRANDED BUTTONS
   ============================================================================= */

.vefify-btn.branded {
    border-radius: 12px;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vefify-btn-primary.branded {
    background: linear-gradient(135deg, var(--vefify-primary-color, #007cba) 0%, var(--vefify-secondary-color, #0056b3) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.3);
}

.vefify-btn-primary.branded:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.4);
}

.vefify-btn-primary.branded:active {
    transform: translateY(-1px);
}

/* =============================================================================
   QUESTION STYLES
   ============================================================================= */

.vefify-question.branded {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.1);
    transition: all 0.3s ease;
}

.vefify-question.branded:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.2);
}

.vefify-question-title.branded {
    color: var(--vefify-text-color, #333);
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Enhanced radio/checkbox options */
.vefify-option.branded {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vefify-option.branded:hover {
    background: rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.05);
    border-color: rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.3);
    transform: translateX(5px);
}

.vefify-option.branded.selected {
    background: rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.1);
    border-color: var(--vefify-primary-color, #007cba);
    color: var(--vefify-primary-color, #007cba);
    font-weight: 600;
}

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */

.vefify-progress-bar.branded {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.vefify-progress-fill.branded {
    background: linear-gradient(90deg, var(--vefify-primary-color, #007cba), var(--vefify-secondary-color, #0056b3));
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s ease;
}

/* =============================================================================
   TIMER DISPLAY
   ============================================================================= */

.vefify-timer.branded {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: 600;
    color: var(--vefify-primary-color, #007cba);
    border: 2px solid rgba(var(--vefify-primary-rgb, 0, 124, 186), 0.2);
    backdrop-filter: blur(10px);
}

.vefify-timer.branded.warning {
    color: #dc3545;
    border-color: #dc3545;
    animation: pulse 1s infinite;
}

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

/* =============================================================================
   RESULTS SECTION
   ============================================================================= */

.vefify-results.branded {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 50px 40px;
    backdrop-filter: blur(20px);
}

.vefify-score.branded {
    font-size: 3em;
    font-weight: 700;
    color: var(--vefify-primary-color, #007cba);
    margin-bottom: 20px;
}

.vefify-results-message.branded {
    font-size: 1.2em;
    color: var(--vefify-text-color, #333);
    margin-bottom: 30px;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .vefify-quiz-content {
        padding: 20px 15px;
    }
    
    .vefify-quiz-section.branded {
        padding: 25px 20px;
        border-radius: 16px;
    }
    
    .vefify-question.branded {
        padding: 20px;
    }
    
    .vefify-btn.branded {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .vefify-score.branded {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .vefify-quiz-content {
        padding: 15px 10px;
    }
    
    .vefify-quiz-section.branded {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .vefify-question.branded {
        padding: 15px;
    }
    
    .vefify-option.branded {
        padding: 12px 15px;
    }
    
    .vefify-btn.branded {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .vefify-score.branded {
        font-size: 2em;
    }
}

/* =============================================================================
   CSS CUSTOM PROPERTIES DEFAULTS
   ============================================================================= */

:root {
    --vefify-primary-color: #007cba;
    --vefify-primary-rgb: 0, 124, 186;
    --vefify-secondary-color: #6c757d;
    --vefify-text-color: #333333;
    --vefify-bg-color: #f8f9fa;
    --vefify-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vefify-quiz-branded * {
    animation: slideInUp 0.6s ease-out;
}

.vefify-brand-header {
    animation: fadeIn 0.8s ease-out;
}

/* =============================================================================
   CRITICAL SCROLLING FIXES
   ============================================================================= */

/* Ensure body can scroll when quiz is active */
body.vefify-quiz-active,
html.vefify-quiz-active {
    overflow-y: visible !important;
    height: auto !important;
}

/* Prevent iOS bounce scrolling issues */
.vefify-quiz-fullscreen {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* Fix for sticky elements on mobile */
@supports (-webkit-overflow-scrolling: touch) {
    .vefify-quiz-fullscreen {
        transform: translateZ(0);
    }
}