/* ============================================
   RESET E VARIÁVEIS
   ============================================ */

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

:root {
    /* Cores principais */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Cores de fundo */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    
    /* Cores de texto */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* Outras cores */
    --border-color: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Tamanhos */
    --border-radius: 12px;
    --spacing: 1.5rem;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

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

.logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================
   TABS (ABAS)
   ============================================ */

.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tab-btn i {
    font-size: 1.5rem;
}

.tab-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

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

/* ============================================
   CONVERSOR CARD
   ============================================ */

.converter-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    animation: fadeInUp 0.5s ease;
}

/* ============================================
   INPUT GROUPS
   ============================================ */

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.input-group input:hover,
.input-group select:hover {
    border-color: var(--primary-light);
}

.input-group input::placeholder {
    color: var(--text-light);
}

/* ============================================
   BOTÃO DE TROCA
   ============================================ */

.btn-swap {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: all 0.3s ease, transform 0.3s ease;
    margin-bottom: 1.5rem;
}

.btn-swap:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

/* ============================================
   RESULTADO
   ============================================ */

.result-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.result-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.result {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 70px;
    transition: transform 0.2s ease;
}

.result-unit {
    font-size: 1rem;
    opacity: 0.9;
}

.btn-copy {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   INFO DE ATUALIZAÇÃO (MOEDA)
   ============================================ */

.info-atualizacao {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.info-atualizacao i {
    margin-right: 0.25rem;
}

/* ============================================
   BOTÃO LIMPAR
   ============================================ */

.btn-clear {
    width: 100%;
    padding: 0.875rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-clear:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* ============================================
   BOTÃO RECARREGAR (ERRO DE MOEDA)
   ============================================ */

.btn-recarregar {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-recarregar:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* ============================================
   ANIMAÇÕES E TRANSIÇÕES
   ============================================ */

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

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-btn span {
        font-size: 0.8rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .converter-card {
        padding: 1.5rem;
    }
    
    .result {
        font-size: 1.25rem;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tabs {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 0.25rem;
    }
    
    .tab-btn i {
        font-size: 1.25rem;
    }
    
    .tab-btn span {
        font-size: 0.75rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .result {
        font-size: 1.1rem;
        padding: 1.25rem;
    }
    
    .btn-copy {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
}