/* style.css (Nova Versão) */

/* Importa a fonte Inter do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* ---- Variáveis de Cor (Tema Spotify) ---- */
:root {
    --spotify-green: #1DB954;
    --spotify-green-hover: #1ed760;
    --spotify-black: #121212;
    --spotify-gray-light: #B3B3B3;
    --spotify-gray-dark: #282828;
    --spotify-gray-darker: #191919;
    --spotify-white: #FFFFFF;
    
    --radius-md: 8px;
    --radius-full: 50px;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition-fast: all 0.2s ease-in-out;
}

/* ---- Reset e Base ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--spotify-black);
    color: var(--spotify-white);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinha no topo */
    min-height: 100vh;
    padding: 40px 20px; /* Mais espaço no topo */
}

/* ---- Layout Principal ---- */
.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 30px; /* Espaço entre os cards */
}

/* ---- Card Principal (para cada etapa) ---- */
.card-step {
    background-color: var(--spotify-gray-darker);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--spotify-gray-dark);
    box-shadow: var(--shadow-lg);
    /* Animação de entrada */
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Tipografia ---- */
h1 {
    font-size: 2.5rem; /* 40px */
    font-weight: 800;
    color: var(--spotify-green);
    letter-spacing: -1.5px;
    line-height: 1.1;
}

h2 {
    font-size: 2rem; /* 32px */
    font-weight: 700;
    color: var(--spotify-white);
    margin-bottom: 8px;
    letter-spacing: -1px;
    line-height: 1.2;
}
h2 .spotify-green {
    color: var(--spotify-green);
}

p, span, label {
    font-size: 1rem; /* 16px */
    color: var(--spotify-gray-light);
    line-height: 1.6;
}
p.upload-intro, p.controls-intro {
    margin-top: 15px;
    margin-bottom: 25px;
}

code {
    background-color: var(--spotify-gray-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--spotify-white);
}

/* ---- Botões e Inputs ---- */
.btn {
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--spotify-green);
    color: var(--spotify-black);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--spotify-green-hover);
    transform: scale(1.03); /* Efeito de zoom */
}
.btn:disabled {
    background-color: var(--spotify-gray-dark);
    color: var(--spotify-gray-light);
    cursor: not-allowed;
}

/* ---- Estilização do Input de Arquivo ---- */
input[type="file"] {
    display: none; /* Esconde o input original */
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background-color: transparent;
    border: 2px dashed var(--spotify-gray-dark);
    color: var(--spotify-gray-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}
.file-upload-label svg {
    margin-right: 10px;
    stroke: var(--spotify-gray-light);
    transition: var(--transition-fast);
}
.file-upload-label:hover {
    color: var(--spotify-white);
    border-color: var(--spotify-gray-light);
}
.file-upload-label:hover svg {
    stroke: var(--spotify-white);
}

#file-name-display {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 10px;
    margin-bottom: 25px; /* Espaço antes do botão de carregar */
}

/* ---- Controles (Select, Input[number]) ---- */
.control-group {
    margin-bottom: 20px;
}
.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--spotify-white); /* Labels mais fortes */
}

.form-select, .form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--spotify-gray-dark);
    background-color: var(--spotify-gray-dark);
    color: var(--spotify-white);
    transition: var(--transition-fast);
    -webkit-appearance: none; /* Remove aparência padrão */
    -moz-appearance: none;
    appearance: none;
}
/* Seta para o Select */
.form-select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23B3B3B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
}
.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--spotify-green);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.3); /* Brilho verde */
}

/* Grid para período e valor */
.control-group-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

/* ---- Estado de Loading ---- */
.hidden {
    display: none !important;
}

#loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--spotify-gray-light);
    margin-top: 25px;
    gap: 15px;
}
.spinner {
    border: 4px solid var(--spotify-gray-dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--spotify-green); /* Verde Spotify */
    animation: spin 1s ease infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Tabela de Resultados ---- */
#results-output table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#results-output th, #results-output td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid var(--spotify-gray-dark);
}

#results-output th {
    color: var(--spotify-gray-light);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#results-output td {
    color: var(--spotify-white);
    font-weight: 600;
}
/* Coluna de horas */
#results-output td:last-child {
    color: var(--spotify-green);
    font-weight: 700;
    text-align: right;
    width: 120px; /* Largura fixa */
}

/* Efeito Hover na Tabela */
#results-output tbody tr {
    transition: var(--transition-fast);
}
#results-output tbody tr:hover {
    background-color: var(--spotify-gray-dark);
}