* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #4CAF50;
    --danger: #ff6b6b;
    --warning: #ffa726;
    --light: #f8f9fa;
    --dark: #333;
    --gray: #666;
    --border: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 30px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--dark);
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--gray);
    font-size: 1.1em;
}

.section {
    background: var(--light);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.section:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.section h2 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

label {
    font-weight: bold;
    color: #555;
    min-width: 100px;
}

input[type="number"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    width: 100px;
    text-align: center;
    transition: all 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    white-space: nowrap;
}

button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.info-btn {
    background: #17a2b8;
}

.info-btn:hover {
    background: #138496;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.control-panel {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.age-display {
    font-size: 4em;
    font-weight: bold;
    color: var(--secondary);
    min-width: 150px;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
}

.arrow-btn {
    font-size: 2.5em;
    padding: 20px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.large-arrow {
    font-size: 3em;
    padding: 25px 35px;
    min-width: 100px;
    min-height: 100px;
}

.arrow-btn:hover {
    background: var(--secondary);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.arrow-btn:active {
    transform: scale(0.95);
}

.test-mode-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid var(--primary);
    text-align: center;
}

.result-value {
    font-size: 2.5em;
    color: var(--primary);
    font-weight: bold;
    margin: 10px 0;
}

.frequency-info {
    color: var(--gray);
    font-size: 1.2em;
    margin: 15px 0;
    text-align: center;
    font-weight: 500;
}

.volume-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.volume-control input[type="range"] {
    width: 200px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 5px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.test-progress {
    background: var(--border);
    height: 12px;
    border-radius: 6px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    border-radius: 6px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.4s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    color: var(--secondary);
    font-size: 1.8em;
}

.close {
    font-size: 2.5em;
    cursor: pointer;
    color: var(--gray);
    transition: all 0.3s;
    line-height: 1;
}

.close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.info-content {
    line-height: 1.6;
    color: var(--dark);
}

.info-content h3 {
    color: var(--primary);
    margin: 20px 0 10px 0;
}

.info-content h4 {
    color: var(--secondary);
    margin: 15px 0 10px 0;
}

.info-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-content li {
    margin-bottom: 8px;
}

.info-content p {
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

.playing-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 1s infinite;
    margin-right: 5px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === RODAPÉ === */
.footer {
    background-color: transparent;
    padding: 2rem 0;
    margin-top: auto;
    width: 100%;
}

.footer-card {
    background-color: var(--light);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    color: #495057;
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-card a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.footer-card a:hover {
    text-decoration: underline;
}

/* Estilos para o modal de informações */
.modal-info-large {
    max-width: 800px;
    max-height: 85vh;
}

.info-intro {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #333;
}

.info-highlight {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid var(--primary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.benefit-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.benefit-item:hover {
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

.benefit-item strong {
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.module-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.module-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.1);
}

.module-card h4 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.module-card ul {
    margin-left: 20px;
    margin-top: 10px;
}

.module-card li {
    margin-bottom: 8px;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffa726;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.warning-box p {
    margin-bottom: 10px;
}

.cta-text {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1em;
}

.info-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.info-content a:hover {
    text-decoration: underline;
}

/* === CONTROLE DE IDADE NA CONFIGURAÇÃO === */
.age-input-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.age-adjust-btn {
    font-size: 1.5em;
    padding: 10px 15px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.age-adjust-btn:hover {
    background: var(--secondary);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.age-adjust-btn:active {
    transform: scale(0.95);
}

#chronologicalAge {
    font-size: 2em;
    font-weight: bold;
    width: 120px;
    text-align: center;
    border: 3px solid var(--primary);
    border-radius: 10px;
    padding: 10px;
    color: var(--secondary);
    background: white;
    -moz-appearance: textfield;
    transition: all 0.3s;
}

#chronologicalAge::-webkit-inner-spin-button,
#chronologicalAge::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#chronologicalAge:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.2);
    transform: scale(1.05);
}

#chronologicalAge.invalid {
    border-color: #ff6b6b;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.start-btn {
    background: var(--success);
    font-size: 1.1em;
    padding: 15px 30px;
    border-radius: 12px;
    flex-shrink: 0;
}

.start-btn:hover {
    background: #45a049;
}

.reset-btn {
    background: #6c757d;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: #5a6268;
}

/* Presets de idade */
.age-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.age-presets span {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
    white-space: nowrap;
}

.preset-btn {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.preset-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

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

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

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .age-display {
        font-size: 2.5em;
        min-width: 100px;
    }
    
    .arrow-btn {
        font-size: 2em;
        padding: 15px 20px;
        min-width: 60px;
        min-height: 60px;
    }
    
    .large-arrow {
        font-size: 2.5em;
        padding: 20px 25px;
        min-width: 80px;
        min-height: 80px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }
    
    .age-presets {
        justify-content: center;
    }
    
    .age-adjust-btn {
        font-size: 1.2em;
        padding: 8px 12px;
        min-width: 40px;
        min-height: 40px;
    }
    
    #chronologicalAge {
        font-size: 1.5em;
        width: 80px;
    }
    
    .age-input-control {
        padding: 8px;
        gap: 5px;
    }
}

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

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .control-panel {
        gap: 15px;
    }
    
    .age-display {
        font-size: 2em;
        min-width: 80px;
    }
}