/* ===================================================================
   HUBBDI QUIZ PREVIEW - CSS ESPECÍFICO PARA PÁGINA QUIZZ.PHP
   Solo estilos específicos para la pantalla de preview de quizzes
   Los estilos principales están en hubbdiquizzes.css (global)
   =================================================================== */

/* Estilos de emergencia mientras carga el CSS global */
.hubbdi-quiz-container {
    max-width: 800px;
    /* margin: 20px auto; */
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.quiz-content-wrapper {
    padding: 30px;
}

.quiz-header {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color2) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.quiz-screen {
    display: none;
}

.quiz-screen.active {
    display: block;
}

.quiz-btn {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--main-font);
}

.quiz-btn:hover {
    background: var(--main-color2);
}

.quiz-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--neutral-light, #dee2e6);
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
}

/* ===================================================================
   SECCIÓN DE USUARIO (REGISTRO/LOGOUT) - AHORA EN HUBBDIQUIZZES.CSS
   Los estilos de autenticación están en el archivo CSS global
   =================================================================== */

/* ===================================================================
   CONTROLES DE PREVIEW (ESPECÍFICOS)
   =================================================================== */

/* Logo responsivo para no deformarse */
.modern-quiz-logo img {
    max-height: 80px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* Container del quiz como widget */
.modern-quiz-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.modern-quiz-card {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header condicional */
.modern-quiz-header {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color2) 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.preview-controls {
    background: var(--main-container-color);
    border-bottom: 1px solid var(--neutral-light);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-controls h4 {
    margin: 0;
    color: var(--main-font-color);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--main-font);
}

.preview-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-control-group label {
    font-size: 14px;
    color: var(--text-muted, #6c757d);
    margin: 0;
}

/* ===================================================================
   SELECTOR DE TEMPLATES (ESPECÍFICO DEL PREVIEW)
   =================================================================== */

#template-selector {
    padding: 8px 12px;
    border: 1px solid var(--neutral-light, #ced4da);
    border-radius: 6px;
    background: var(--main-container-color, white);
    color: var(--main-font-color, #495057);
    font-size: 14px;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#template-selector:hover {
    border-color: var(--main-color, #5d31ff);
}

#template-selector:focus {
    outline: none;
    border-color: var(--main-color, #5d31ff);
    box-shadow: 0 0 0 3px rgba(93, 49, 255, 0.1);
}

/* ===================================================================
   BOTONES DE CONTROL DE VISTA
   =================================================================== */

.view-control-btn {
    padding: 8px 16px;
    border: 1px solid var(--neutral-light, #ced4da);
    border-radius: 6px;
    background: var(--main-container-color, white);
    color: var(--main-font-color, #495057);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-control-btn:hover {
    background: var(--neutral-light, #e9ecef);
    border-color: var(--secondary-color, #adb5bd);
}

.view-control-btn.active {
    background: var(--main-color, #5d31ff);
    border-color: var(--main-color, #5d31ff);
    color: white;
}

.view-control-btn i {
    font-size: 12px;
}

/* ===================================================================
   VISTA RESPONSIVE (ESPECÍFICA DEL PREVIEW)
   =================================================================== */

.responsive-preview {
    max-width: 768px;
    margin: 20px auto;
    border: 2px dashed var(--neutral-light, #dee2e6);
    border-radius: 8px;
    padding: 15px;
    background: var(--background-light, #f8f9fa);
}

.responsive-preview::before {
    content: "Vista Tablet (768px)";
    display: block;
    text-align: center;
    color: var(--text-muted, #6c757d);
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* ===================================================================
   VISTA MÓVIL (ESPECÍFICA DEL PREVIEW)
   =================================================================== */

.mobile-preview {
    max-width: 375px;
    margin: 20px auto;
    border: 2px dashed var(--warning-color, #ffc107);
    border-radius: 8px;
    padding: 15px;
    background: var(--warning-background, #fff9e6);
}

.mobile-preview::before {
    content: "Vista Móvil (375px)";
    display: block;
    text-align: center;
    color: var(--warning-text, #856404);
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* ===================================================================
   MODAL DE PREVIEW
   =================================================================== */

.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.preview-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.preview-modal-content {
    padding: 0;
}

.preview-modal-header {
    background: linear-gradient(135deg, var(--main-color, #5d31ff) 0%, var(--main-color2, #764ba2) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
}

.preview-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-modal-body {
    padding: 25px;
}

.preview-modal-body p {
    margin: 0 0 20px 0;
    color: var(--main-font-color, #495057);
    line-height: 1.6;
}

.preview-responses {
    background: var(--background-light, #f8f9fa);
    border: 1px solid var(--neutral-light, #dee2e6);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.preview-responses h4 {
    margin: 0 0 10px 0;
    color: var(--main-font-color, #495057);
    font-size: 14px;
    font-weight: 600;
}

.preview-responses pre {
    background: var(--neutral-light, #e9ecef);
    border: 1px solid var(--neutral-light, #ced4da);
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.preview-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--neutral-light, #dee2e6);
    text-align: right;
}

.preview-modal-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preview-modal-footer .btn-primary {
    background: var(--main-color, #5d31ff);
    color: white;
}

.preview-modal-footer .btn-primary:hover {
    background: var(--main-color-dark, #4c28d9);
    transform: translateY(-1px);
}

/* ===================================================================
   INFORMACIÓN DE TEMPLATE (ESPECÍFICA DEL PREVIEW)
   =================================================================== */

.template-info {
    background: var(--info-background, #e3f2fd);
    border: 1px solid var(--info-border, #90caf9);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: var(--info-color, #0d47a1);
}

.template-info h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.template-info p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* ===================================================================
   LOADING ESPECÍFICO DEL PREVIEW
   =================================================================== */

.quiz-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #6c757d);
}

.quiz-loading i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--main-color, #5d31ff);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.quiz-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--main-font-color, #495057);
}

/* ===================================================================
   AJUSTES ESPECÍFICOS PARA PÁGINA DE PREVIEW
   =================================================================== */

.quiz-preview-page {
    background: var(--background-light, #f5f6fa);
    min-height: 100vh;
    padding: 20px 0;
}

.quiz-preview-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.quiz-preview-page h1 {
    text-align: center;
    color: var(--main-font-color, #2d3436);
    margin-bottom: 30px;
    font-weight: 700;
}

/* Breadcrumb para preview */
.preview-breadcrumb {
    background: white;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted, #6c757d);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-breadcrumb a {
    color: var(--main-color, #5d31ff);
    text-decoration: none;
}

.preview-breadcrumb a:hover {
    text-decoration: underline;
}

/* ===================================================================
   RESPONSIVE ESPECÍFICO DEL PREVIEW
   =================================================================== */

@media (max-width: 768px) {
    .preview-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .preview-control-group {
        justify-content: space-between;
    }
    
    #template-selector {
        width: 100%;
    }
    
    .view-control-btn {
        flex: 1;
        justify-content: center;
    }
    
    .preview-modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .preview-modal-header,
    .preview-modal-body,
    .preview-modal-footer {
        padding: 15px 20px;
    }
    
    .responsive-preview,
    .mobile-preview {
        margin: 10px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .quiz-preview-page {
        padding: 10px 0;
    }
    
    .quiz-preview-page .container {
        padding: 0 10px;
    }
    
    .preview-controls {
        padding: 10px 15px;
    }
    
    .preview-modal {
        margin: 5px;
        border-radius: 8px;
    }
    
    .preview-modal-header {
        border-radius: 8px 8px 0 0;
    }
}
