/* --- Variables CSS y Reset --- */
:root {
    --primary-blue: #2563eb;
    --dark-blue: #1e40af;
    --accent-red: #dc2626;
    --bg-light: #f3f4f6;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bsv-gold: #eab308;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Asegura que el footer baje */
}

/* --- Header --- */
.main-header {
    background-color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 3px solid var(--primary-blue);
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-blue);
}

.user-profile {
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}
.user-profile:hover {
    color: var(--primary-blue);
}

/* --- Layout Principal --- */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Columna izquierda doble de ancha */
    gap: 2rem;
    width: 100%;
    flex: 1; /* Hace que ocupe el espacio disponible */
}

/* --- Tarjeta de Encuesta (Izquierda) --- */
.poll-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border-top: 5px solid var(--primary-blue);
}

.poll-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.vote-buttons-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vote-btn {
    flex: 1; /* Ocupan el mismo ancho */
    padding: 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, background-color 0.3s, opacity 0.3s;
    box-shadow: var(--card-shadow);
}

.btn-yes {
    background-color: var(--primary-blue);
}
.btn-yes:hover:not([disabled]) {
    background-color: var(--dark-blue);
    transform: translateY(-3px);
}

.btn-no {
    background-color: var(--accent-red);
    opacity: 0.95;
}
.btn-no:hover:not([disabled]) {
        background-color: #b91c1c;
        transform: translateY(-3px);
}

.vote-btn i {
    font-size: 3rem;
}

.poll-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.poll-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* --- Widgets Laterales (Derecha) --- */
.widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Widget de Gráfica */
.chart-container {
    position: relative;
    height: 200px;
}

/* Widget de Recompensas */
.reward-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    transition: background-color 0.3s, transform 0.2s;
    cursor: pointer;
}

.reward-item:hover {
    background-color: #f9fafb;
    transform: translateX(5px);
}

.reward-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-right: 1rem;
}

.reward-details {
    flex-grow: 1;
}

.reward-title {
    font-weight: 600;
    display: block;
}
.reward-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bsv-icon {
    color: var(--bsv-gold);
    font-size: 1.2rem;
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    margin-top: auto; /* Empuja el footer al fondo si hay poco contenido */
}

/* --- Botón Flotante de Chat (La Plaza) --- */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-blue);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    z-index: 100;
}
.chat-fab:hover {
    transform: scale(1.1);
    background-color: var(--dark-blue);
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr; /* Una sola columna en móviles */
        margin: 1rem auto;
    }
    .vote-buttons-container {
        flex-direction: column;
        gap: 1rem;
    }
    .vote-btn {
        padding: 1.5rem;
    }
    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .nav-links {
        margin-top: 0.5rem;
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-links a {
        margin-left: 0;
    }
    .brand {
        width: 100%;
        justify-content: space-between;
    }
}