/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Header top com botão voltar */
.header-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-button i {
    margin-right: 8px;
}

/* Main content */
.tuner-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 25px;
    color: white;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions i {
    color: #ffd700;
    margin-right: 8px;
}

/* Container da guitarra */
.guitar-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 800px;
    width: 100%;
}

.guitar-neck {
    position: relative;
    background: #8B4513;
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.2);
}

.guitar-head {
    margin-bottom: 20px;
    text-align: center;
}

.tuning-pegs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.peg {
    width: 20px;
    height: 8px;
    background: #C0C0C0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Cordas */
.strings-container {
    display: flex;
    flex-direction: column;
    gap: 35px;
    position: relative;
    padding: 20px 0;
}

.string-group {
    position: relative;
}

.string-button {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    outline: none;
}

.string-button:hover {
    transform: translateY(-2px);
}

.string-button:active {
    transform: translateY(0);
}

.string-line {
    flex: 1;
    height: 4px;
    background: #FFD700;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}

.string-1 { height: 2px; background: #E6E6E6; }
.string-2 { height: 2.5px; background: #D4D4D4; }
.string-3 { height: 3px; background: #FFD700; }
.string-4 { height: 3.5px; background: #DDA0DD; }
.string-5 { height: 4px; background: #CD853F; }
.string-6 { height: 4.5px; background: #2C3E50; }

.string-button:hover .string-line {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    transform: scaleY(1.2);
}

.string-button.playing .string-line {
    animation: stringVibration 0.1s infinite alternate;
    box-shadow: 0 0 20px rgba(255, 215, 0, 1);
}

@keyframes stringVibration {
    0% { transform: translateY(-1px) scaleY(1.2); }
    100% { transform: translateY(1px) scaleY(1.2); }
}

.note-info {
    position: absolute;
    right: -140px;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    width: max-content;
    white-space: nowrap;
    transition: all 0.3s ease;
    z-index: 10;
}

.note-info::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #2c3e50;
}

.note-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.note-letter {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffd700;
    white-space: nowrap;
}

.string-number {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
}

.string-button:hover .note-info {
    background: #34495e;
    transform: translateX(-5px);
}

.string-button.playing .note-info {
    background: #e74c3c;
    transform: translateX(-5px) scale(1.05);
}

/* Controles */
.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-button {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.control-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.control-button:active {
    transform: translateY(-1px);
}

.control-button.secondary {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
}

.control-button.loop-off {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
}

.control-button.loop-on {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    animation: loopPulse 2s infinite;
}

@keyframes loopPulse {
    0%, 100% { 
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    }
    50% { 
        box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    }
}

.control-button i {
    font-size: 1.1rem;
}

/* Informações da afinação */
.tuning-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
}

.tuning-info h3 {
    margin-bottom: 15px;
    font-weight: 500;
    color: #ffd700;
}

.frequency-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#current-note {
    font-size: 1.2rem;
    font-weight: 500;
}

#current-frequency {
    font-size: 1rem;
    opacity: 0.8;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: white;
    opacity: 0.8;
}

.footer i {
    color: #e74c3c;
    margin: 0 5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .guitar-container {
        padding: 20px;
    }
    
    .strings-container {
        gap: 25px;
    }
    
    .note-info {
        right: -110px;
        min-width: 100px;
        width: max-content;
        padding: 6px 10px;
        gap: 6px;
        white-space: nowrap;
    }
    
    .note-letter {
        font-size: 1.5rem;
    }
    
    .controls {
        gap: 10px;
    }
    
    .control-button {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .guitar-container {
        padding: 15px;
    }
    
    .strings-container {
        gap: 20px;
        padding: 15px 0;
    }
    
    .note-info {
        position: static;
        margin-left: 10px;
        background: rgba(44, 62, 80, 0.9);
        backdrop-filter: blur(5px);
        width: max-content;
        white-space: nowrap;
        gap: 4px;
        padding: 6px 10px;
        border-radius: 8px;
    }
    
    .note-info::before {
        display: none;
    }
    
    .string-button {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        min-height: 30px;
    }
    
    .string-line {
        min-height: 3px;
        flex: 1;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* Animações adicionais */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container > * {
    animation: fadeIn 0.6s ease forwards;
}

.container > *:nth-child(2) { animation-delay: 0.1s; }
.container > *:nth-child(3) { animation-delay: 0.2s; }
.container > *:nth-child(4) { animation-delay: 0.3s; }