/* Reset simples */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #0a0908;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==================== BANNER HERO ==================== */
.hero-banner {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(88, 28, 135, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.banner-content {
    text-align: center;
    color: white;
    padding: 20px;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 16px;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: -1px;
}

.banner-title .highlight {
    color: #fbbf24;
}

.banner-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fbbf24;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.banner-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-indicator.active {
    background: #fbbf24;
    width: 30px;
    border-radius: 5px;
}

/* Wrapper central */
.melodia-wrapper {
    padding: 40px 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card principal */
.melodia-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    min-height: 400px;
    background: #f9fafb;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
    padding: 30px 40px;
}

/* Cabeçalho */
.melodia-header {
    margin-bottom: 10px;
}

.melodia-title {
    font-size: 20px;
    font-weight: 800;
    color: #020617;
    margin-bottom: 4px;
}

.melodia-subtitle {
    font-size: 11px;
    color: #6b7280;
}

/* ===================== TOPO: GRID [Pássaro][Espectro] / [Resultado] ===================== */

.melodia-top {
    display: grid;
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "bird spectro"
        "result result";
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 8px;
}

/* Coluna do pássaro */
.melodia-bird-col {
    grid-area: bird;
}

.melodia-image-box {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: #e5e7eb;
}

.melodia-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Coluna do espectrograma */
.melodia-spectrogram-box {
    grid-area: spectro;
    background: #ffffff;
    border-radius: 16px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.melodia-spectro-img {
    width: 100%;
    max-height: 110px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(15, 23, 42, 0.15);
}

/* Resultado ocupa a linha inteira abaixo */
.melodia-result-box {
    grid-area: result;
    background: #ffffff;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e5e7eb;
}

/* Badge "Resultado" */
.melodia-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #166534;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
}

.melodia-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
}

/* Texto do resultado */
.melodia-species {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.melodia-confidence {
    font-size: 12px;
    color: #4b5563;
}

/* Seções */
.melodia-section-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

/* Áudio */
.melodia-audio {
    margin-top: 8px;
    margin-bottom: 6px;
}

.melodia-audio-player {
    width: 100%;
}

/* Gráfico */
.melodia-chart {
    margin-bottom: 10px;
}

/* Rodapé */
.melodia-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.melodia-upload-label {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    display: block;
    margin-bottom: 4px;
}

.melodia-upload input[type="file"] {
    font-size: 11px;
}

/* Botão limpar */
.melodia-clear-btn {
    border: none;
    background: #e85d04;
    color: #f9fafb;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.melodia-clear-btn:hover {
    background: #b91c1c;
}

/* Responsivo básico: em telas menores, tudo empilha */
@media (max-width: 520px) {
    .melodia-card {
        width: 100%;
    }

    .melodia-top {
        grid-template-columns: 1fr;
        grid-template-areas:
            "bird"
            "spectro"
            "result";
    }

    .melodia-image-box {
        margin: 0 auto;
    }
}

.melodia-spectro-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    background: #e5e7eb;
}


/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 768px) {
    .hero-banner {
        height: 300px;
    }
    
    .banner-title {
        font-size: 2.5rem;
    }
    
    .banner-subtitle {
        font-size: 1.2rem;
    }
    
    .banner-description {
        font-size: 0.95rem;
    }
    
    .melodia-card {
        padding: 20px;
    }
    
    .melodia-top {
        grid-template-columns: 1fr;
        grid-template-areas:
            "bird"
            "spectro"
            "result";
    }
}

@media (max-width: 480px) {
    .hero-banner {
        height: 250px;
    }
    
    .banner-title {
        font-size: 2rem;
    }
    
    .banner-subtitle {
        font-size: 1rem;
    }
    
    .banner-description {
        font-size: 0.85rem;
    }
}

/* ==================== BOTÃO PAINEL ADMIN ==================== */
.admin-button-container {
    text-align: center;
    margin: 40px 0 30px 0;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-button-main {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 40px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #667eea !important;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.2),
                0 0 0 3px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 420px;
    animation: pulseGlow 3s ease-in-out infinite;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.admin-button-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.15), transparent);
    transition: left 0.5s;
}

.admin-button-main:hover::before {
    left: 100%;
}

.admin-button-main:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 50px rgba(255, 255, 255, 0.3),
                0 0 0 4px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-color: rgba(102, 126, 234, 0.8);
    animation: none;
}

.admin-button-main:active {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.25);
}

.admin-icon {
    font-size: 2.8em;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.admin-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
}

.admin-title {
    font-size: 1.4em;
    font-weight: 900;
    letter-spacing: 0.5px;
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-button-main:hover .admin-title {
    -webkit-text-fill-color: white;
}

.admin-subtitle {
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.8;
    display: block;
    color: #6b7280;
}

.admin-button-main:hover .admin-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.admin-arrow {
    font-size: 2em;
    font-weight: bold;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.admin-button-main:hover .admin-arrow {
    transform: translateX(5px);
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(255, 255, 255, 0.2),
                    0 0 0 3px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 10px 50px rgba(255, 255, 255, 0.3),
                    0 0 0 5px rgba(102, 126, 234, 0.5);
    }
}

@media (max-width: 768px) {
    .admin-button-main {
        min-width: auto;
        width: 100%;
        max-width: 400px;
        padding: 20px 30px;
        gap: 15px;
    }
    
    .admin-icon {
        font-size: 2em;
    }
    
    .admin-title {
        font-size: 1.1em;
    }
    
    .admin-subtitle {
        font-size: 0.8em;
    }
    
    .admin-arrow {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .admin-button-main {
        padding: 18px 24px;
        gap: 12px;
    }
    
    .admin-icon {
        font-size: 1.8em;
    }
    
    .admin-title {
        font-size: 1em;
    }
    
    .admin-subtitle {
        font-size: 0.75em;
    }
}

