/* Global styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Home page styles */
.home-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.home-title {
    font-size: 5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.home-nav {
    margin-top: 3rem;
}

.home-nav a {
    display: inline-block;
    background: white;
    color: #667eea;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.home-nav a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Tests page styles */
.tests-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

.tests-nav {
    margin-bottom: 2rem;
}

.tests-nav a {
    display: inline-block;
    background: white;
    color: #667eea;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tests-nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tests-container > h1 {
    color: white;
    font-size: 3rem;
    margin: 0 0 2rem 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Responsive grid layout for test boxes */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .test-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual test box styling */
.test-box {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.test-box h2 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Counter section styles */
.counter-label {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 1rem 0;
}

.counter-display {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
}

.counter-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.counter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.counter-button:active {
    transform: translateY(0);
}

/* WASM Executor section styles */
.wasm-executor-section h2 {
    /* Inherits from .test-box h2 */
}

.wasm-executor-section h3 {
    color: #495057;
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

.upload-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.upload-section input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

.stored-files-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 0.25rem;
    gap: 0.5rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.select-button, .delete-button, .execute-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.delete-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.select-button:hover, .execute-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.delete-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.select-button:disabled, .execute-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.execution-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.execute-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.error-message {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
}

.output-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.output-display {
    background: #212529;
    color: #00ff00;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 0 0;
    max-height: 400px;
    overflow-y: auto;
}

.output-display code {
    color: #00ff00;
}

/* HyperLogLog section styles */
.hyperloglog-section h2 {
    /* Inherits from .test-box h2 */
}

.hyperloglog-section p {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #495057;
}

.control-group select {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.control-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.control-button:active {
    transform: translateY(0);
}

.reset-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
}

.stat-value.good {
    color: #28a745;
}

.stat-value.warning {
    color: #ffc107;
}

.stat-value.error {
    color: #dc3545;
}

.info {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #667eea;
}

.info p {
    margin: 0;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Uppercase section styles */
.text-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
}

.uppercase-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    width: 100%;
    margin-bottom: 1rem;
}

.uppercase-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.uppercase-button:active:not(:disabled) {
    transform: translateY(0);
}

.uppercase-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-display {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.result-label {
    font-weight: 600;
    color: #495057;
    margin: 0 0 0.5rem 0;
}

.result-text {
    font-size: 1.2rem;
    color: #667eea;
    margin: 0;
    word-break: break-all;
}

/* Footer styles */
.tests-footer {
    text-align: center;
    padding: 2rem 0;
    color: white;
}

.tests-footer p {
    margin: 0;
}

.tests-footer a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.tests-footer a:hover {
    text-decoration: none;
}
