/* --- Estilos base y variables --- */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --background-color: #f4f6f7;
    --card-background: #ffffff;
    --text-color: #34495e;
    --light-text: #ffffff;
    --header-bg: #ffffff;
    --border-color: #dfe6e9;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex-grow: 1; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px; text-align: left; }

/* --- Header, Nav y Footer (consistente) --- */
header { background-color: var(--header-bg); box-shadow: 0 2px 10px rgba(0,0,0,0.08); padding: 0 20px; position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 25px; }
nav a { text-decoration: none; color: var(--text-color); font-weight: 600; padding: 5px 10px; border-radius: 5px; transition: color .3s, background-color .3s; }
nav a:hover { color: var(--secondary-color); background-color: #ecf0f1; }
footer { background-color: var(--primary-color); color: #bdc3c7; text-align: center; padding: 20px; margin-top: auto; }
footer p { margin: 0; font-size: 0.9rem; }

/* --- Contenido Principal --- */
h1 { color: var(--primary-color); font-size: 2.5rem; margin-bottom: 0.5rem; }
.subtitle { font-size: 1.1rem; color: #4d4d4d; margin-top: 0; }

.generator-wrapper {
    background: var(--card-background);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    margin-top: 30px;
}

/* --- Panel de Sorteo (Slot Machine) --- */
.slot-panel {
    display: grid;
    /* --- CAMBIO: Dos columnas --- */
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}
.slot-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.slot-label {
    font-weight: 600;
    padding: 15px;
    background: #ecf0f1;
    text-align: right;
    border-right: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.slot-value {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: left;
}

/* --- Paneles de Progreso y Resultado --- */
.progress-container {
    margin: 30px 0;
}
.progress-container p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}
.progress-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    border-radius: 15px;
    transition: width 1s linear; /* Transición más lenta */
}

.result-panel {
    animation: fadeIn 1s;
}
#legendary-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}
.legendary-description {
    text-align: left;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
}
.legendary-description p {
    margin: 0;
    padding: 8px;
    background: #f9fafb;
    border-radius: 5px;
}
.legendary-description strong {
    color: var(--primary-color);
}

/* --- Botones y Clases de Utilidad --- */
.button-container {
    margin-top: 20px;
}
.button-container button {
    background-color: var(--secondary-color);
    color: var(--light-text);
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 10px;
}
.button-container button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}
.button-container button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}
#image-generate-btn {
    background-color: #3498db; /* Color diferente para el segundo botón */
}
#image-generate-btn:hover {
    background-color: #2980b9;
}
.hidden { display: none; }

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

/* --- NUEVO: Estilos para botones de compartir --- */
.social-share-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.social-share-container h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
}
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.social-btn {
    text-decoration: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.3s;
}
.social-btn:hover { opacity: 0.8; }
.social-btn.twitter { background-color: #1DA1F2; }
.social-btn.facebook { background-color: #1877F2; }
.social-btn.whatsapp { background-color: #25D366; }


/* --- Botones y Clases de Utilidad --- */
.button-container { margin-top: 20px; }
.button-container button { background-color: var(--secondary-color); color: var(--light-text); border: none; padding: 15px 30px; font-size: 1.2rem; font-weight: 700; border-radius: 10px; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; margin: 0 10px; }
.button-container button:hover { background-color: #c0392b; transform: translateY(-2px); }
.button-container button:disabled { background-color: #ccc; cursor: not-allowed; transform: none; }
#image-generate-btn { background-color: #3498db; }
#image-generate-btn:hover { background-color: #2980b9; }
.hidden { display: none; }

.about-section {
    background-color: #ffffff;
    padding: 60px 20px;
    border-top: 1px solid #e0e0e0;
}
.about-section h2 { font-size: 2rem; color: var(--primary-color); }
.about-section p { max-width: 1200px; margin: 15px auto 0; line-height: 1.7; }

/* --- Menú responsivo para móviles --- */
@media (max-width: 768px) {
    header {
        position: static;
        box-shadow: none;
    }
    .header-container {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
        padding: 10px 0;
    }
    .logo {
        margin-bottom: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: center;
    }
    nav a {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    /* Cambia el panel de sorteo a una sola columna en móviles */
    .slot-panel {
        grid-template-columns: 1fr !important;
    }
    .slot-row {
        grid-template-columns: 120px 1fr;
    }
    .generator-wrapper, .subtitle, .container{
        width: 85%;
    }
}