/* ztt-frontend-style */
.ztt-quiz-wrapper, .ztt-sopa-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #333;
}

.ztt-module-header {
    text-align: center;
    margin-bottom: 30px;
}
.ztt-module-header h2 {
    color: #17a8e3;
    font-size: 28px;
    margin-bottom: 10px;
}
.ztt-module-header p {
    color: #64748b;
    font-size: 16px;
}

.ztt-question-block {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaebec;
    transition: transform 0.2s ease;
}

.ztt-question-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.ztt-question-title {
    font-size: 18px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    color: #1a202c;
    line-height: 1.4;
}

/* Frases específicas */
.ztt-hueco {
    display: inline-block;
    border-bottom: 2px solid #17a8e3;
    min-width: 50px;
    color: #17a8e3;
    text-align: center;
}
.ztt-pill-label {
    padding: 8px 16px !important;
    border-radius: 20px !important;
    background: #f8fafc !important;
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
}
.ztt-pill-label input {
    display: none !important;
}

.ztt-options-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ztt-option-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    user-select: none;
}

.ztt-option-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ztt-option-label input[type="radio"] {
    margin-right: 12px;
    accent-color: #17a8e3;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Radio button direct selection styling */
.ztt-option-label:has(input[type="radio"]:checked) {
    background: #eff6ff !important;
    border-color: #17a8e3 !important;
    color: #17a8e3;
}


.ztt-form-actions {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 50px;
}

.ztt-btn-primary {
    background: linear-gradient(135deg, #17a8e3 0%, #008fca 100%);
    color: #fff !important;
    border: none;
    padding: 15px 35px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(23, 168, 227, 0.3);
}

.ztt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(23, 168, 227, 0.4);
    background: linear-gradient(135deg, #008fca 0%, #17a8e3 100%);
}

.ztt-btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Sopa de Letras Layout */
.ztt-sopa-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.ztt-sopa-grid {
    display: grid;
    gap: 0;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    user-select: none;
    touch-action: none; /* Prevenir scroll al hacer drag en mobile */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: max-content;
    align-self: flex-start;
    border: 1px solid #e2e8f0;
}

.ztt-cell {
    background: transparent;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.1s;
    user-select: none;
}

.ztt-cell.ztt-selected {
    background: #bae6fd;
    color: #0369a1;
}

.ztt-cell.ztt-found {
    background: #6ee7b7;
    color: #064e3b;
    animation: foundPop 0.3s ease;
}

@keyframes foundPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.ztt-sopa-sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.ztt-sopa-sidebar h3 {
    margin-top: 0;
    font-size: 18px;
    color: #0f172a;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.ztt-sopa-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ztt-sopa-lista li {
    padding: 8px 0;
    font-size: 15px;
    color: #475569;
    transition: color 0.3s;
}

.ztt-sopa-lista li.word-found {
    text-decoration: line-through;
    color: #cbd5e1;
}


/* Modal Styles */
.ztt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

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

.ztt-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    animation: scaleUp 0.3s forwards;
}

@keyframes scaleUp {
    to { transform: scale(1); }
}

.ztt-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.ztt-modal-close:hover {
    color: #334155;
}

.ztt-modal-content h2 {
    margin-top: 0;
    font-size: 24px;
    color: #0f172a;
    font-weight: 700;
}

.ztt-modal-content p {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

.ztt-input-group {
    margin-bottom: 20px;
    text-align: left;
}

.ztt-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

.ztt-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.ztt-input-group input:focus {
    outline: none;
    border-color: #17a8e3;
    box-shadow: 0 0 0 3px rgba(23, 168, 227, 0.1);
}

.ztt-thankyou-wrapper {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.5s ease;
}

.ztt-thankyou-wrapper h2 {
    color: #0bc30b;
    font-size: 28px;
    margin-bottom: 15px;
}

.ztt-thankyou-wrapper p {
    color: #475569;
    font-size: 18px;
}

/* Spinner for loading state */
.ztt-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

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

@media (max-width: 768px) {
    .ztt-sopa-layout {
        flex-direction: column;
    }
    .ztt-cell {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}
