/* ============================================
   tuIQ - Test de CI Styles
   ============================================ */

.test-page {
    background: linear-gradient(180deg, #e8f4f8 0%, #f0f9ff 50%, #e0f2fe 100%);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Test Navbar */
.test-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #e8f4f8;
    border-bottom: none;
    padding-bottom: 0;
}

.test-navbar .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.test-navbar .logo {
    margin-left: 0;
    left: 0;
}

.test-navbar .logo-img {
    height: 60px;
}

/* Timer */
.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.timer-display i {
    color: var(--gray-500);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #d1d5db;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
}

/* Test Start Screen */
.test-start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 120px 24px 40px;
}

.start-card {
    background: white;
    border-radius: 28px;
    padding: 44px 48px 48px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 25px 60px -15px rgba(13, 106, 94, 0.18);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(13, 106, 94, 0.08);
}

.start-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa, #3b82f6, #2563eb);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Badge */
.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    border: 1px solid rgba(13, 106, 94, 0.15);
}

.test-badge i {
    font-size: 0.7rem;
}

/* Icon */
.start-icon {
    position: relative;
    margin-bottom: 28px;
    display: inline-block;
}

.icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(13, 106, 94, 0.15) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 3s ease-in-out infinite;
}

.icon-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border: 2px dashed rgba(13, 106, 94, 0.15);
    border-radius: 50%;
    animation: rotate-slow 20s linear infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes rotate-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.start-icon svg {
    width: 88px;
    height: 88px;
    position: relative;
    z-index: 1;
}

.brain-icon-wrapper {
    width: 88px;
    height: 88px;
    background: linear-gradient(145deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow:
        0 10px 30px rgba(13, 106, 94, 0.35),
        0 0 0 4px rgba(13, 106, 94, 0.1),
        inset 0 -3px 10px rgba(0, 0, 0, 0.1);
    animation: float-gentle 4s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.brain-icon-wrapper i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Title Section */
.title-section {
    margin-bottom: 26px;
}

.start-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.start-subtitle::before,
.start-subtitle::after {
    content: '';
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1);
}

.start-subtitle::after {
    background: linear-gradient(90deg, #cbd5e1, transparent);
}

/* Domain Pills */
.domain-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(13, 106, 94, 0.12);
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.domain-pill:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: rgba(13, 106, 94, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 106, 94, 0.12);
}

.domain-pill i {
    font-size: 0.8rem;
    color: #2563eb;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 106, 94, 0.1);
    border-radius: 50%;
    padding: 10px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 26px;
    padding: 20px 16px;
    background: linear-gradient(145deg, #f8fafb 0%, #f1f5f9 50%, #eff6ff 100%);
    border-radius: 18px;
    border: 1px solid rgba(13, 106, 94, 0.1);
    position: relative;
}

.features-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(13, 106, 94, 0.2), transparent);
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    position: relative;
}

.feature-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 50%;
    background: linear-gradient(180deg, transparent, #d1d5db, transparent);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(13, 106, 94, 0.08);
    transition: all 0.25s ease;
}

.feature-item:hover .feature-icon {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(13, 106, 94, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: rgba(13, 106, 94, 0.2);
}

.feature-icon i {
    font-size: 1.1rem;
    color: #2563eb;
}

.feature-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.feature-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.feature-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Result Preview */
.result-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 28px;
    border: 1px solid rgba(13, 106, 94, 0.15);
    box-shadow: 0 2px 8px rgba(13, 106, 94, 0.08);
    position: relative;
    overflow: hidden;
}

.result-preview::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #60a5fa);
}

.result-preview i {
    color: #2563eb;
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(13, 106, 94, 0.15);
}

.result-preview span {
    font-size: 0.9rem;
    color: #2563eb;
    text-align: left;
    line-height: 1.45;
    font-weight: 500;
}

/* Gender Selection */
.gender-label {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gender-label::before {
    content: '\f0a4';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: #2563eb;
    animation: point-right 1s ease-in-out infinite;
}

@keyframes point-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

.gender-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 26px;
}

.gender-btn {
    flex: 1;
    padding: 18px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #2563eb 0%, #3b82f6 60%, #60a5fa 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow:
        0 6px 20px rgba(13, 106, 94, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.gender-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.gender-btn:hover::before {
    left: 100%;
}

.gender-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(13, 106, 94, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gender-btn:active {
    transform: translateY(-1px) scale(1);
}

.gender-btn i {
    font-size: 1.25rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Average Score Box */
.average-score-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 100px;
    font-size: 0.875rem;
    color: #64748b;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.score-indicator {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    position: relative;
}

.score-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

@keyframes pulse-ring {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.3); }
}

.average-score-box strong {
    color: #2563eb;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Question Screen */
.test-questions-screen {
    padding: 120px 24px 40px;
    min-height: calc(100vh - 80px);
}

.question-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-text {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.4;
}

/* Text Options (Likert Scale and Multiple Choice) */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 20px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    background: #eff6ff;
    color: var(--dark);
}

/* Likert Scale Colors */
.option-btn.likert-1 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.option-btn.likert-2 {
    background: linear-gradient(135deg, #dbeafe, #dbeafe);
}

.option-btn.likert-3 {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
}

.option-btn.likert-4 {
    background: linear-gradient(135deg, #ffe4e6, #fecdd3);
}

.option-btn.likert-5 {
    background: linear-gradient(135deg, #fecdd3, #fda4af);
}

/* Neutral options for non-likert questions */
.option-btn.neutral {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.option-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-btn.selected {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color: white;
    transform: translateX(8px);
}

/* Image Questions (Pattern Recognition) */
.image-question-container {
    text-align: center;
}

.pattern-grid {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: inline-block;
}

.pattern-grid img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Pattern Matrix Display */
.matrix-display {
    display: grid;
    gap: 4px;
    padding: 16px;
    background: white;
    border-radius: 12px;
}

.matrix-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #1f2937;
    aspect-ratio: 1;
}

.matrix-cell.question-mark {
    background: white;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    font-size: 2rem;
    font-weight: 700;
}

.choose-label {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.image-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.image-option-btn {
    padding: 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-option-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.image-option-btn.selected {
    border-color: #2563eb;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.image-option-btn svg,
.image-option-btn img {
    max-width: 80px;
    max-height: 80px;
}

/* Navigation Footer */
.test-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--gray-500);
}

.nav-arrow:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.question-counter {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.question-counter span:first-child {
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .test-start-screen {
        padding: 100px 16px 40px;
    }

    .start-card {
        padding: 32px 24px 36px;
        border-radius: 24px;
    }

    .start-title {
        font-size: 1.5rem;
    }

    .start-subtitle::before,
    .start-subtitle::after {
        width: 16px;
    }

    .brain-icon-wrapper {
        width: 76px;
        height: 76px;
    }

    .brain-icon-wrapper i {
        font-size: 2.2rem;
    }

    .icon-glow {
        width: 120px;
        height: 120px;
    }

    .icon-glow::after {
        width: 96px;
        height: 96px;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 16px 12px;
    }

    .feature-item:not(:last-child)::after {
        height: 40%;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .feature-icon i {
        font-size: 0.95rem;
    }

    .feature-value {
        font-size: 1.05rem;
    }

    .domain-pills {
        gap: 8px;
    }

    .domain-pill {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .domain-pill i {
        width: 16px;
        height: 16px;
        padding: 8px;
        font-size: 0.7rem;
    }

    .gender-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .gender-btn {
        width: 100%;
        padding: 16px 24px;
    }

    .gender-label::before {
        display: none;
    }

    .question-text {
        font-size: 1.125rem;
    }

    .image-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .image-option-btn {
        padding: 16px;
    }

    .result-preview {
        padding: 14px 16px;
        gap: 12px;
    }

    .result-preview i {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .result-preview span {
        font-size: 0.825rem;
    }

    .average-score-box {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .score-indicator {
        width: 8px;
        height: 8px;
    }

    .average-score-box strong {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .test-navbar .logo-img {
        height: 48px;
    }

    .timer-display {
        padding: 8px 14px;
        font-size: 0.875rem;
    }

    .start-card {
        padding: 28px 20px 32px;
    }

    .start-title {
        font-size: 1.35rem;
    }

    .start-subtitle {
        font-size: 0.9rem;
    }

    .start-subtitle::before,
    .start-subtitle::after {
        width: 12px;
    }

    .brain-icon-wrapper {
        width: 68px;
        height: 68px;
    }

    .brain-icon-wrapper i {
        font-size: 1.9rem;
    }

    .icon-glow {
        width: 100px;
        height: 100px;
    }

    .icon-glow::after {
        width: 84px;
        height: 84px;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 14px 10px;
    }

    .feature-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .feature-icon i {
        font-size: 0.85rem;
    }

    .feature-value {
        font-size: 0.95rem;
    }

    .feature-label {
        font-size: 0.65rem;
    }

    .domain-pill {
        padding: 6px 12px;
        font-size: 0.7rem;
        gap: 5px;
    }

    .domain-pill i {
        width: 14px;
        height: 14px;
        padding: 7px;
        font-size: 0.6rem;
    }

    .gender-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .gender-btn i {
        font-size: 1.1rem;
    }

    .result-preview {
        padding: 12px 14px;
        gap: 10px;
    }

    .result-preview::before {
        width: 3px;
    }

    .result-preview i {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .result-preview span {
        font-size: 0.78rem;
    }

    .test-badge {
        font-size: 0.6875rem;
        padding: 6px 12px;
    }
}

@media (max-width: 360px) {
    .start-card {
        padding: 24px 16px 28px;
    }

    .start-title {
        font-size: 1.2rem;
    }

    .brain-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .brain-icon-wrapper i {
        font-size: 1.7rem;
    }

    .feature-value {
        font-size: 0.875rem;
    }

    .gender-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}
