/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.resolution-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(79, 70, 229, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.resolution-label {
    font-size: 0.9rem;
    color: #6b7280;
}

.resolution-value {
    font-weight: 600;
    color: #4f46e5;
    font-family: 'Courier New', monospace;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.welcome-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Test Grid */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.test-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.test-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.test-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.test-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.test-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.test-btn:active {
    transform: translateY(0);
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 0.5rem 0;
    color: #4b5563;
    position: relative;
    padding-left: 1.5rem;
}

.instructions li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Test Overlay */
.test-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.test-overlay.hidden {
    display: none;
}

.test-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.exit-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.exit-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-1px);
}

.test-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

#test-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

#test-instructions {
    font-size: 0.9rem;
    opacity: 0.8;
}

.test-navigation {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: rgba(79, 70, 229, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(79, 70, 229, 1);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.test-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Test-specific styles */
.solid-color-test {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.backlight-test {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
}

.interference-pattern {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        #000 0px,
        #000 1px,
        #333 1px,
        #333 2px
    );
    animation: interference 2s linear infinite;
}

@keyframes interference {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.focus-test {
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2rem;
}

.focus-pattern {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #000 1px, transparent 1px);
    background-size: 20px 20px;
    border: 2px solid #000;
}

.focus-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.2;
    color: #000;
    text-align: center;
    max-width: 600px;
}

.breathing-test {
    width: 100%;
    height: 100%;
    background: #808080;
    animation: breathing 3s ease-in-out infinite;
}

@keyframes breathing {
    0%, 100% { background: #404040; }
    50% { background: #c0c0c0; }
}

.contrast-test {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.contrast-square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.gradient-test {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gradient-bar {
    flex: 1;
    display: flex;
}

.gradient-segment {
    flex: 1;
}

.saturation-test {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
}

.saturation-block {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .test-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .test-card {
        padding: 1.5rem;
    }

    .test-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .test-navigation {
        justify-content: center;
    }

    .focus-pattern {
        width: 200px;
        height: 200px;
    }

    .focus-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .test-card {
        padding: 1rem;
    }

    .test-controls {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 0.75rem;
    }
}
