/* ========================================
ARCHIVO: css/header.css
ESTILOS PARA HEADER, FOOTER Y COMPONENTES
========================================
*/

/* --- 1. ESTILOS GENERALES (BODY, HEADER, NAV) --- */
body {
    margin: 0; /* CORRECCIÓN CLAVE 1: Elimina cualquier margen predeterminado del navegador */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f4;
}

header {
    background-color: #1a1a1a;
    padding: 15px 15px; /* Ajuste para móvil (15px) */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid #f39c12;
    
    /* CORRECCIÓN CLAVE 2: Asegura que el header ocupe el 100% de la ventana */
    width: 100%; 
    /* CORRECCIÓN CLAVE 3: Asegura que el padding no cause desbordamiento */
    box-sizing: border-box; 
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    max-width: 1200px;
    margin: 0 auto; /* Centrar el contenido de la navegación */
}

/* --- 2. LOGO Y NAVEGACIÓN (NO LOGUEADO) --- */
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    flex-shrink: 0; 
}

.logo:hover {
    color: #f39c12;
}

/* Contenedor de elementos de navegación/botones */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    justify-content: flex-end; 
    flex-grow: 1; 
}

nav ul li {
    margin-left: 10px; 
    margin-top: 5px; 
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.btn-login:hover {
    color: #f39c12;
}

.btn-register {
    background-color: #f39c12;
    color: #1a1a1a;
    padding: 8px 12px; 
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; 
}

.btn-register:hover {
    background-color: #e67e22;
    color: #ffffff;
}

/* --- 3. NAVEGACIÓN (LOGUEADO) --- */

.logged-in-nav-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-grow: 1;
}

.user-menu-trigger {
    cursor: pointer;
    white-space: nowrap;
    margin-left: 10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2c2c2c;
    min-width: 150px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    z-index: 1000;
    padding: 0;
    margin-top: 5px;
}

.dropdown-content li {
    margin: 0;
}

.dropdown-content li a {
    display: block;
    padding: 10px 14px; 
    color: #ffffff;
    font-size: 0.9rem;
}

.dropdown-content li a:hover {
    background-color: #f39c12;
    color: #1a1a1a;
}

.user-menu:hover .dropdown-content {
    display: block;
}

/* --- 4. COMPONENTE COIN WALLET (EN HEADER) --- */

/* 4.1. Estilos BASE del componente (La versión grande) */
.coin-wallet {
    background: #fff7e6;
    border: 1px solid #ffe4b3;
    border-radius: 50px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 250px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.coin-wallet-left {
    display: flex;
    align-items: center;
}

.coin-wallet .coin-icon {
    width: 45px;
    height: 45px;
    margin-right: 10px;
}

.coin-wallet .coin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.coin-wallet .coin-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #8c6d44;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coin-wallet .coin-amount {
    font-size: 1.6rem;
    font-weight: 700;
    color: #d95b00;
    line-height: 1;
}

.coin-wallet .coin-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: #ffffff;
    border: 1px solid #fde0a6;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 600;
    color: #f39c12;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.coin-wallet .coin-add-button:hover {
    transform: scale(1.1);
    background-color: #f39c12;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

/* 4.2. 🔥 ADAPTACIÓN RESPONSIVA DEL WALLET 🔥 */

.nav-wallet-container {
    margin-left: 0; 
    margin-right: 10px; 
    margin-top: 5px; 
}

nav .coin-wallet {
    margin-top: 0; 
    padding: 5px 8px; 
    max-width: 150px; 
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.1);
}

nav .coin-icon {
    width: 30px;
    height: 30px;
    margin-right: 5px;
}

nav .coin-label {
    display: none; 
}
nav .coin-amount {
    font-size: 1.2rem;
    line-height: 1;
}

nav .coin-add-button {
    width: 25px; 
    height: 25px; 
    font-size: 1.2rem;
}

/* --- 5. ESTILOS DEL FOOTER --- */
footer {
    background-color: #1a1a1a;
    color: #a0a0a0;
    padding: 25px 15px; 
    margin-top: 50px;
    border-top: 3px solid #f39c12;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.footer-content p {
    margin: 0;
    text-align: center;
    flex-grow: 1;
    width: 100%; 
}

.social-links {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    width: 100%; 
}

.social-links a {
    color: #a0a0a0;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #f39c12;
}

/* --- 6. MEDIA QUERY PARA ESCRITORIO (A partir de 768px) --- */
@media (min-width: 768px) {
    
    header {
        padding: 15px 30px; /* Restaurar padding de escritorio */
    }

    nav {
        flex-wrap: nowrap; /* Restaurar a una sola línea */
    }

    /* Restaurar el contenedor de botones de navegación */
    nav ul {
        flex-wrap: nowrap;
        flex-grow: 0;
        justify-content: flex-start;
    }
    
    /* Restaurar márgenes de los botones de acceso/registro */
    nav ul li {
        margin-left: 20px; 
        margin-top: 0;
    }

    /* Restaurar el Coin Wallet para la vista de escritorio */
    nav .coin-label {
        display: block; /* Muestra el texto "COINS" de nuevo */
        font-size: 0.8rem;
    }
    nav .coin-icon {
        margin-right: 10px;
    }

    .nav-wallet-container {
        margin-right: 15px;
        margin-top: 0;
    }
    
    /* Estilos del footer para escritorio */
    footer {
        padding: 25px 30px;
    }
    .footer-content {
        flex-wrap: nowrap;
    }
    .footer-content p {
        text-align: left;
        width: auto;
    }
    .social-links {
        justify-content: flex-end;
        width: auto;
    }
}