/**
 * QM SAVE - Frontend Styles v2.1.0
 * ONLY styles QM SAVE elements. Never overrides Quiz Maker styles.
 */

/* ==========================================================================
   SUPRESIÓN TOTAL DE FLECHAS DE NAVEGACIÓN (SOLO BOTONES DE TEXTO NATIVOS)
   ========================================================================== */
.ays_arrow,
.ays_next_arrow,
.ays_previous_arrow,
.ays_prev_arrow,
i.ays_arrow,
i.ays_next_arrow,
i.ays_previous_arrow,
i.ays_prev_arrow,
i.action-button.ays_arrow,
.ays_buttons_div i.ays_arrow,
.ays_buttons_div i.ays_next_arrow,
.ays_buttons_div i.ays_previous_arrow,
.ays_buttons_div i.ays_fa,
.ays_buttons_div i[class*="arrow"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* ==========================================================================
   1. Save Button
   ========================================================================== */
.qm-save-button-wrapper {
    margin: 15px 0;
    text-align: center;
    display: block;
    clear: both;
}

.qm-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background-color: #2271b1;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    outline: none;
}

.qm-save-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
    color: #ffffff;
}

.qm-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.qm-save-btn[disabled],
.qm-save-btn.qm-loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.qm-save-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Spinner */
.qm-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: qm-spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* Toast Notification */
.qm-toast-notification {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #10b981;
    pointer-events: none;
    max-width: calc(100vw - 40px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.qm-toast-icon {
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

/* ==========================================================================
   2. Modals
   ========================================================================== */
.qm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: qm-fade-in 0.2s ease-out;
}

@keyframes qm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.qm-modal-dialog {
    background: #ffffff;
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: qm-scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qm-scale-up {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.qm-modal-content {
    padding: 32px 28px;
    text-align: center;
}

.qm-modal-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-modal-icon-wrap.qm-icon-success {
    background-color: #ecfdf5;
    color: #059669;
}

.qm-modal-icon-wrap.qm-icon-info {
    background-color: #eff6ff;
    color: #2563eb;
}

.qm-modal-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.qm-modal-description {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.qm-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.qm-modal-btn {
    flex: 1;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.qm-modal-btn.qm-btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}

.qm-modal-btn.qm-btn-primary:hover {
    background-color: #1d4ed8;
}

.qm-modal-btn.qm-btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.qm-modal-btn.qm-btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* ==========================================================================
   3. Saved Quizzes Dashboard [qm_saved_quizzes]
   ========================================================================== */
.qm-saved-quizzes-dashboard {
    max-width: 900px;
    margin: 25px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.qm-saved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
    gap: 12px;
}

.qm-saved-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.qm-saved-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.qm-saved-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qm-saved-title svg {
    color: #38bdf8 !important;
    fill: currentColor;
}

.qm-saved-count-badge {
    background-color: #e0e7ff;
    color: #4338ca;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.qm-user-greeting {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.qm-user-greeting svg {
    color: #64748b;
}

.qm-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1.4;
}

.qm-btn-logout:hover {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.qm-btn-logout svg {
    flex-shrink: 0;
}

.qm-logout-wrapper {
    display: inline-block;
    margin: 10px 0;
}

.qm-saved-empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.qm-empty-icon { margin-bottom: 12px; }

.qm-empty-title {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 600;
    color: #334155;
}

.qm-empty-desc {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.qm-saved-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qm-saved-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 22px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.qm-saved-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.qm-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.qm-card-info {
    flex: 1;
    min-width: 260px;
}

.qm-card-quiz-title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.qm-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
}

.qm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.qm-meta-step {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    color: #334155;
}

.qm-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.qm-btn-resume {
    background-color: #2563eb;
    color: #ffffff !important;
}

.qm-btn-resume:hover {
    background-color: #1d4ed8;
    color: #ffffff !important;
}

.qm-btn-excel {
    background-color: #ecfdf5;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
}

.qm-btn-excel:hover {
    background-color: #059669;
    color: #ffffff !important;
    border-color: #059669 !important;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.25);
}

.qm-export-live-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
    cursor: pointer;
    background-color: #ecfdf5;
    color: #047857;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    outline: none;
}

.qm-export-live-btn:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.2);
}

.qm-export-live-btn[disabled],
.qm-btn-excel[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.qm-btn-excel-modal {
    width: 100%;
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qm-btn-excel-modal:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}

.qm-btn-delete {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 8px 10px;
}

.qm-btn-delete:hover {
    background-color: #fecaca;
    color: #b91c1c;
}

.qm-notice-warning {
    padding: 14px 18px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    border-radius: 6px;
    font-size: 14px;
}

/* QM Save - Responsive */
@media (max-width: 600px) {
    .qm-card-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .qm-card-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .qm-btn-resume { flex: 1; }
    .qm-modal-buttons { flex-direction: column; }
}


