/* style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    max-width: 1000px;
    width: 100%;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 86, 166, 0.08),
        0 8px 24px rgba(0, 86, 166, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    overflow: hidden;
    animation: slideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.9);
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.header {
    background: linear-gradient(135deg, #0056a6 0%, #006bbf 50%, #0083cc 100%);
    color: white;
    padding: 32px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo-badge {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    width: 90px;
    height: 90px;
    border-radius: 24px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0056a6;
    font-size: 2.5rem;
    box-shadow: 
        0 10px 30px rgba(0, 86, 166, 0.2),
        inset 0 -2px 4px rgba(0, 86, 166, 0.1);
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header h1 {
    font-size: 2.4rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 2;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    font-weight: 400;
}

.control-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Progress Section - Now at bottom */
.progress-section {
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e8f0f9;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: auto; /* Push to bottom */
}

.progress-content {
    max-width: 800px;
    margin: 0 auto;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-title {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-counter {
    font-size: 1.1rem;
    color: #0056a6;
    font-weight: 700;
    background: linear-gradient(to right, #e3f2fd, #f0f7ff);
    padding: 8px 20px;
    border-radius: 50px;
    box-shadow: 
        0 4px 12px rgba(0, 86, 166, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 86, 166, 0.1);
}

.progress-bar {
    height: 14px;
    background: linear-gradient(to right, #e3f2fd, #e8f0f9);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 86, 166, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c851 0%, #00a844 50%, #008c37 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(0, 200, 81, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 5px;
}

/* Step Indicators - Horizontal for all views */
.step-indicators {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.step-indicator {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    min-width: 50px;
}

.step-indicator-circle {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #d0e2f5 100%);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    border: 3px solid white;
    box-shadow: 
        0 4px 12px rgba(0, 86, 166, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.step-indicator.active .step-indicator-circle {
    background: linear-gradient(135deg, #0056a6 0%, #006bbf 100%);
    color: white;
    transform: scale(1.15);
    box-shadow: 
        0 8px 25px rgba(0, 86, 166, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.step-indicator.completed .step-indicator-circle {
    background: linear-gradient(135deg, #00c851 0%, #00a844 100%);
    color: white;
}

.step-indicator-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    transition: all 0.3s;
    display: block;
}

.step-indicator.active .step-indicator-label {
    color: #0056a6;
    font-weight: 700;
}

/* Game Content */
.game-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.game-step {
    display: none;
    padding: 30px 20px;
    animation: fadeIn 0.5s ease;
    height: 100%;
}

.step-content {
    max-width: 800px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-step.active {
    display: block;
}

.step-title {
    color: #0056a6;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f7ff;
    font-size: 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-weight: 700;
    text-align: center;
}

.step-title i {
    background: linear-gradient(135deg, #e3f2fd 0%, #d0e2f5 100%);
    padding: 16px;
    border-radius: 16px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0056a6;
    font-size: 1.8rem;
    box-shadow: 
        0 4px 15px rgba(0, 86, 166, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.step-description {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f7ff 100%);
    padding: 24px 28px;
    border-radius: 18px;
    margin-bottom: 30px;
    border-left: 5px solid #0056a6;
    font-size: 1.05rem;
    line-height: 1.7;
    box-shadow: 0 8px 25px rgba(0, 86, 166, 0.05);
    color: #2c3e50;
    text-align: center;
}

.game-question {
    margin-bottom: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 18px;
    border: 1px solid #e8f0f9;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 86, 166, 0.05);
}

.game-question:hover {
    box-shadow: 0 15px 40px rgba(0, 86, 166, 0.12);
    transform: translateY(-5px);
    border-color: #d0e2f5;
}

.question-title {
    font-weight: 700;
    margin-bottom: 20px;
    color: #0056a6;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    text-align: center;
}

.question-title i {
    color: #0083cc;
    background: #e3f2fd;
    padding: 10px;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    justify-content: center;
}

.answer-option {
    padding: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e8f0f9;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.answer-option:hover {
    border-color: #0056a6;
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 86, 166, 0.1);
}

.answer-option.selected {
    border-color: #00a844;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f8ed 100%);
    box-shadow: 0 12px 30px rgba(0, 168, 68, 0.15);
    transform: translateY(-3px);
}

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    margin-right: 18px;
    transform: scale(1.4);
    accent-color: #0056a6;
}

.answer-label {
    font-size: 1.05rem;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Inputs */
.input-group {
    margin-bottom: 25px;
    text-align: center;
}

.input-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    text-align: center;
}

.input-label.required::after {
    content: " *";
    color: #e63946;
}

.form-input, .form-select, textarea {
    width: 100%;
    max-width: 500px;
    padding: 16px;
    border: 2px solid #e8f0f9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #2c3e50;
    margin: 0 auto;
    display: block;
    resize: vertical;
}

.form-input:focus, .form-select:focus, textarea:focus {
    outline: none;
    border-color: #0056a6;
    box-shadow: 0 0 0 4px rgba(0, 86, 166, 0.15);
    background: #ffffff;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%230056a6' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    padding-right: 50px;
}

/* Form Rows */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.form-field {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

/* Navigation Buttons */
.game-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e8f0f9;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-btn {
    padding: 16px 35px;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    flex: 1;
}

.nav-btn i {
    margin-right: 12px;
    transition: transform 0.3s;
    font-size: 1.1rem;
}

.btn-prev {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f0f9 100%);
    color: #475569;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 86, 166, 0.1);
}

.btn-prev:hover {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, #0056a6 0%, #006bbf 100%);
    color: white;
    box-shadow: 
        0 8px 25px rgba(0, 86, 166, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-next:hover, .btn-submit:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px rgba(0, 86, 166, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #00c851 0%, #00a844 100%);
    box-shadow: 
        0 8px 25px rgba(0, 168, 68, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-submit:hover {
    box-shadow: 
        0 15px 40px rgba(0, 168, 68, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.95rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

/* Validation Messages */
.validation-message {
    color: #e63946;
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
    text-align: center;
    font-weight: 500;
}

/* Success Animation */
.success-animation {
    animation: successPulse 2s infinite;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        height: 100vh;
        overflow: hidden;
    }
    
    .game-container {
        border-radius: 20px;
        margin: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        min-height: 100vh;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .logo-badge {
        width: 70px;
        height: 70px;
        border-radius: 18px;
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .control-badge {
        position: relative;
        top: auto;
        right: auto;
        margin: 15px auto;
        display: inline-block;
        font-size: 0.8rem;
        padding: 8px 16px;
    }
    
    /* Progress Section - Mobile Horizontal */
    .progress-section {
        padding: 15px;
        border-top: 1px solid #e8f0f9;
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .progress-header {
        margin-bottom: 10px;
    }
    
    .progress-title {
        font-size: 1.1rem;
    }
    
    .progress-counter {
        font-size: 1rem;
        padding: 6px 15px;
    }
    
    .progress-bar {
        margin-bottom: 10px;
        height: 10px;
    }
    
    /* Step Indicators - Horizontal scroll for mobile */
    .step-indicators {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        gap: 8px;
        padding-bottom: 5px;
    }
    
    .step-indicators::-webkit-scrollbar {
        display: none;
    }
    
    .step-indicator {
        flex: 0 0 auto;
        min-width: 45px;
    }
    
    .step-indicator-circle {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .step-indicator.active .step-indicator-circle {
        transform: scale(1.1);
    }
    
    .step-indicator-label {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    /* Game Content */
    .game-content {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 10px;
    }
    
    .game-step {
        padding: 20px 15px;
        min-height: calc(100vh - 250px);
    }
    
    .step-title {
        font-size: 1.5rem;
        gap: 15px;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .step-title i {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        padding: 14px;
    }
    
    .step-description {
        padding: 18px;
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .game-question {
        padding: 18px;
        margin-bottom: 20px;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
        gap: 15px;
    }
    
    .answer-option {
        padding: 18px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-field {
        min-width: 100%;
        max-width: 100%;
    }
    
    .form-input, .form-select, textarea {
        max-width: 100%;
        padding: 14px;
    }
    
    .game-navigation {
        flex-direction: column;
        gap: 12px;
        margin-top: 30px;
        padding-top: 20px;
    }
    
    .nav-btn {
        width: 100%;
        min-width: auto;
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .question-title {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 1.1rem;
    }
    
    .question-title i {
        margin-bottom: 8px;
    }
    
    .input-label {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .step-title {
        font-size: 1.3rem;
    }
    
    .step-description {
        font-size: 0.95rem;
        padding: 15px;
    }
    
    .game-question {
        padding: 15px;
    }
    
    .answer-option {
        padding: 15px;
    }
    
    .nav-btn {
        padding: 14px 20px;
    }
    
    .answer-label {
        font-size: 1rem;
    }
    
    /* Progress Section - Extra small screens */
    .progress-section {
        padding: 12px 10px;
    }
    
    .step-indicator {
        min-width: 40px;
    }
    
    .step-indicator-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .answer-option, .nav-btn, .sqd-option, .cc-option {
        min-height: 50px;
    }
    
    input[type="radio"], input[type="checkbox"] {
        transform: scale(1.5);
    }
    
    .nav-btn {
        padding: 18px;
    }
    
    .form-input, .form-select, textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Ensure progress section stays at bottom on mobile */
    .progress-section {
        position: sticky;
        bottom: 0;
        width: 100%;
    }
}