/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Modo Oscuro */
[data-theme="dark"],
body.dark-mode {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --text-color: #f9fafb;
    --text-light: #d1d5db;
    --bg-color: #1f2937;
    --bg-light: #111827;
    --bg-dark: #0f172a;
    --border-color: #374151;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header */
.header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav {
    position: relative;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Botón de modo oscuro */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-card {
    margin-top: 1rem;
}

.btn-color {
    margin: 0.5rem;
}

/* Sección de tarjetas */
.tests-grid {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Secciones de test */
.test-section {
    padding: 4rem 0;
}

.test-section:nth-child(even) {
    background-color: var(--bg-light);
}

.test-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.test-section p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.test-container {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

/* Test de Micrófono */
.mic-test {
    text-align: center;
}

.mic-status {
    margin: 1.5rem 0;
    font-weight: 600;
    color: var(--text-color);
}

.mic-meter-container {
    margin: 2rem 0;
}

.mic-meter-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.mic-meter {
    width: 100%;
    height: 30px;
    background-color: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.mic-meter-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, #fbbf24 50%, #ef4444 100%);
    transition: width 0.1s ease;
    border-radius: 15px;
}

.mic-info {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Test de Teclado */
.keyboard-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 0.5rem;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.key {
    padding: 1rem;
    min-width: 50px;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key.key-special {
    min-width: 100px;
    flex: 0 1 auto;
}

.key.key-space {
    min-width: 200px;
    flex: 1 1 auto;
    max-width: 400px;
}

.key.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: scale(1.1);
}

.keyboard-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 0.5rem;
}

.info-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.info-item span {
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

/* Test de Mouse */
.mouse-area {
    width: 100%;
    height: 400px;
    background-color: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 2rem;
    cursor: crosshair;
}

.mouse-instructions {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.mouse-position {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
}

.mouse-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 0.5rem;
}

.status-icon {
    font-size: 1.5rem;
    transition: var(--transition);
}

.status-icon.ok {
    color: var(--secondary-color);
}

/* Test de Pantalla */
.screen-info {
    margin-bottom: 2rem;
}

.screen-color-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-overlay.white {
    background-color: #ffffff;
}

.screen-overlay.black {
    background-color: #000000;
}

.screen-overlay.red {
    background-color: #ef4444;
}

.screen-overlay.green {
    background-color: #10b981;
}

.screen-overlay.blue {
    background-color: #3b82f6;
}

.screen-overlay.gray {
    background-color: #6b7280;
}

/* Test de Audio */
.audio-test {
    text-align: center;
}

.audio-status {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 0.5rem;
}

/* Test de Cámara */
.camera-test {
    text-align: center;
}

.camera-preview {
    margin: 2rem 0;
}

#cameraVideo,
#cameraCanvas {
    max-width: 100%;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

#capturedImage {
    margin-top: 1rem;
}

#capturedImage img {
    max-width: 100%;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

.camera-status {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Test Completo */
.full-test-container {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.full-test-content {
    min-height: 200px;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.full-test-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* FAQ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--bg-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.faq-question {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.faq-answer {
    color: var(--text-light);
    line-height: 1.8;
}

.faq-answer a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--bg-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-dark);
    color: white;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-content p {
    flex: 1;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

/* Ajustes para modo oscuro en elementos de formulario */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea {
    background-color: var(--bg-light);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        width: 200px;
        box-shadow: var(--shadow-lg);
        border-radius: 0.5rem;
        padding: 1rem;
        display: none;
        gap: 0.5rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .mouse-area {
        height: 300px;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

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

    .hero {
        padding: 2rem 0;
    }

    .test-section {
        padding: 2rem 0;
    }

    .test-container {
        padding: 1rem;
    }
}

