/* MOXO Test CSS - Modern & Responsive Design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.9;
    margin-bottom: 10px;
}

.version-info {
    font-size: 0.9rem;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #e0e7ff;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #e0e7ff;
    font-size: 0.95rem;
}

input, select {
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input:focus, select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

select option {
    background: #2d3748;
    color: white;
    padding: 10px;
}

/* Instructions */
.instructions {
    margin: 20px 0;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.instruction-icon {
    font-size: 1.5rem;
    min-width: 30px;
}

.target-color {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Examples */
.examples {
    margin-top: 30px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.example-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.example-item:hover {
    transform: scale(1.05);
}

.example-shape {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.target-shape { background: #10b981; }
.nontarget-shape { background: #ef4444; border-radius: 8px; }
.distractor-shape { 
    background: #f59e0b; 
    border-radius: 0;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.blue-shape { background: #3b82f6; }
.red-shape { background: #dc2626; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.setting-group h3 {
    margin-bottom: 15px;
    color: #e0e7ff;
}

/* Radio and Checkbox Styles */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.radio-label:hover, .checkbox-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-custom, .checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-custom {
    border-radius: 4px;
}

input[type="radio"], input[type="checkbox"] {
    display: none;
}

input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="radio"]:checked + .radio-custom,
input[type="checkbox"]:checked + .checkbox-custom {
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.radio-text, .checkbox-text {
    font-weight: 500;
}

/* Difficulty Info */
.difficulty-info {
    margin-top: 20px;
}

.difficulty-desc {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #10b981;
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #6b7280, #4b5563);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-large {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
}

/* Start Section */
.start-section {
    text-align: center;
    margin-top: 40px;
}

/* Test Screen Styles */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.test-controls {
    display: flex;
    gap: 15px;
}

.test-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.time-display {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.trial-display {
    font-size: 1rem;
    opacity: 0.8;
}

/* Test Area */
.test-area {
    position: relative;
    height: 450px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.test-area.last-minute {
    border-color: #ef4444;
    animation: pulse-red 1s infinite;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-red {
    0%, 100% { border-color: #ef4444; }
    50% { border-color: #dc2626; }
}

.last-minute-warning {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    z-index: 100;
    animation: bounce 1s infinite;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(5px);
}

.pause-content {
    text-align: center;
    color: white;
}

.pause-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stimulus-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
}

.stimulus {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: all 0.2s ease;
    animation: appear 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes appear {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.stimulus.square {
    border-radius: 8px;
}

.stimulus.triangle {
    border-radius: 0;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.distractors-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.distractor {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    color: #f59e0b;
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
}

.distractor.animate-bounce {
    animation: bounce 1.5s infinite;
}

.distractor.animate-spin {
    animation: spin 2s linear infinite;
}

.test-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Live Stats */
.live-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-value.correct { color: #10b981; }
.stat-value.error { color: #ef4444; }
.stat-value.missed { color: #f59e0b; }
.stat-value.neutral { color: #60a5fa; }

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.result-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-label {
    font-size: 1rem;
    opacity: 0.8;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.analysis-item strong {
    color: #e0e7ff;
}

/* Charts */
.chart-controls {
    margin-bottom: 20px;
    text-align: center;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.chart-item h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #e0e7ff;
}

.chart-item canvas {
    width: 100% !important;
    height: auto !important;
    border-radius: 10px;
}

/* Results Actions */
.results-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .test-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .test-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .test-area {
        height: 350px;
    }
    
    .live-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .btn-large {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .live-stats {
        grid-template-columns: 1fr;
    }
    
    .stimulus {
        width: 60px;
        height: 60px;
    }
    
    .test-area {
        height: 300px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .screen:not(.active) {
        display: none !important;
    }
    
    .btn, .test-controls, .results-actions {
        display: none !important;
    }
    
    .card {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .result-card {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
    }
    
    .header h1 {
        color: black !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid white;
    }
    
    .btn {
        border: 2px solid white;
    }
    
    input, select {
        border: 2px solid white;
    }
}