/* Reset y configuración base */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Variables de color */
    --primary-color: #667eea;
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --primary-shadow-color: rgba(102, 126, 234, 0.4);

    /* Tema Claro (predeterminado) */
    --section-bg: rgba(255, 255, 255, 0.85); /* Más transparente */
    --item-bg: rgba(247, 250, 252, 0.8); /* Transparente */
    --item-bg-hover: rgba(237, 242, 247, 0.9); /* Un poco más opaco en hover */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-dashed-color: #cbd5e0;
    --header-bg: rgba(255, 255, 255, 0.95);

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-color); /* Color de fondo base */
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.5s ease;
}

/* Estilo para el fondo difuminado */
.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Combinamos un gradiente oscuro con la imagen para mejorar la legibilidad */
    background: 
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url('background.jpg');
    background-size: cover; /* Asegura que la imagen cubra todo el espacio */
    background-position: center; /* Centra la imagen */
    background-color: var(--primary-color);
    filter: blur(6px); /* Reducimos el valor para un difuminado menos intenso */
    transform: scale(1.1); /* Evita bordes duros por el blur */
    z-index: -1; /* Lo pone detrás de todo */
}

body.dark-theme {
    /* Tema Oscuro */
    --section-bg: rgba(26, 32, 44, 0.75); /* Más transparente */
    --item-bg: rgba(45, 55, 72, 0.7); /* Transparente */
    --item-bg-hover: rgba(74, 85, 104, 0.8); /* Un poco más opaco en hover */
    --text-primary: #edf2f7;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --border-dashed-color: #4a5568;
    --header-bg: rgba(26, 32, 44, 0.8);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Estilo para el contenedor en modo pantalla completa */
.container.full-width {
    max-width: 100%;
    padding: 20px 40px; /* Más padding horizontal */
}

/* Ajuste para que la cabecera también se expanda */
.container.full-width .header {
    max-width: none;
}

/* Header */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 2.5rem;
    font-weight: 700;
    cursor: pointer; /* Indica que el título es interactivo */
}

.header h1 i {
    /* Aplicamos un gradiente al ícono en lugar de un color sólido */
    background: linear-gradient(45deg, var(--primary-gradient-start), var(--primary-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Añadimos una sombra sutil para darle profundidad */
    text-shadow: 2px 2px 10px var(--primary-shadow-color);

    margin-right: 10px;
    animation: ticket-sway 5s ease-in-out infinite;
    display: inline-block; /* Necesario para que transform funcione correctamente */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
}

/* Nueva animación más fluida y orgánica */
@keyframes ticket-sway {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-6px) rotate(-8deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(-4px) rotate(6deg); }
}

/* Nuevo efecto al pasar el mouse: más rebote y un ligero brillo */
.header h1:hover i { 
    transform: translateY(-5px) rotate(-15deg) scale(1.25); 
    filter: brightness(1.15);
}

/* Navegación */
.nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    color: white;
    background: var(--primary-color);
    box-shadow: 0 8px 25px var(--primary-shadow-color);
    transform: translateY(-3px);
}

.nav-btn:hover i {
    color: white;
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    border-color: var(--primary-gradient-end);
    animation: pulse-animation 2.5s infinite;
}

.nav-btn.active:hover {
    animation-play-state: paused; /* Pausar la animación en hover para que no interfiera */
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    box-shadow: 0 8px 25px var(--primary-shadow-color);
}

/* Keyframes para la animación de pulso */
@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 var(--primary-shadow-color);
    }
    70% {
        box-shadow: 0 0 0 15px transparent;
    }
}

/* Secciones */
.section {
    display: none;
    background: var(--section-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.section.active {
    display: block;
    animation: section-appear 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes section-appear {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Ancho mínimo de 300px */
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px; /* Establecemos una altura mínima */
    display: flex; /* Usamos flexbox para centrar el contenido */
    flex-direction: column;
    justify-content: center;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0) 80%);
    transform: skewX(-25deg);
    transition: left 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px var(--primary-shadow-color);
}

.card:hover::before {
    left: 150%;
}
.card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.recent-raffles h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.raffles-list {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr; /* Cambiado a una sola columna para una lista vertical */
}

/* Estilo de Tarjeta para Rifas Recientes */
.raffle-card {
    background: var(--item-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex; /* Mantenemos flex para la estructura general */
    flex-direction: row; /* Cambiado a 'row' para la vista vertical */
}

.raffle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 0 12px var(--primary-shadow-color); /* Añadimos un resplandor */
    border-color: var(--primary-color);
}

.raffle-item-image, .raffle-card-image { /* Compatibilidad */
    width: 220px; /* Aumentamos el ancho para una imagen más grande */
    height: auto; /* Altura automática para mantener la proporción */
    background-size: cover;
    background-position: center;
    flex-shrink: 0; /* Evita que la imagen se encoja */
}

.raffle-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio entre elementos internos */
}

.raffle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.raffle-card-header h3 {
    color: var(--primary-color); /* Usamos el color primario para destacar */
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif; /* Nueva fuente para los títulos */
    line-height: 1.3;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15); /* Sombra sutil para el texto */
}

.raffle-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-left: 10px;
}

.raffle-status.active {
    background-color: rgba(72, 187, 120, 0.15);
    color: #38a169; /* Verde */
}

.raffle-status.completed {
    background-color: rgba(113, 128, 150, 0.15);
    color: #718096; /* Gris */
}

.raffle-card-stats {
    display: flex;
    justify-content: space-around;
    background-color: var(--item-bg-hover);
    padding: 10px;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.stat-item i {
    color: var(--primary-color);
}

.stat-item span {
    font-weight: 600;
}

.stat-item small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-item .high-percentage {
    color: #38a169; /* Verde éxito */
    font-weight: 700; /* Más grueso para destacar */
    animation: pulse-green 1.5s infinite;
}

.progress-section {
    width: 100%;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-gradient-start), var(--primary-gradient-end));
    height: 8px;
    width: 0;
    border-radius: 25px;
    transition: width 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative; /* Para la animación de brillo */
    overflow: hidden; /* Para la animación de brillo */
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine-animation 2.5s infinite 1s; /* Inicia después de 1s */
    transform: translateX(-100%);
}

.progress-bar.progress-high {
    background: linear-gradient(90deg, #48bb78, #38a169); /* Gradiente verde para éxito */
}

/* Animación para el texto de alto porcentaje */
@keyframes pulse-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Nueva animación de brillo para la barra de progreso */
@keyframes shine-animation {
    100% {
        transform: translateX(100%);
    }
}

.raffle-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Empuja los botones hacia abajo */
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-card-action {
    flex-grow: 1;
    background: var(--item-bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-card-action.edit-raffle-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-card-action.delete-raffle-btn:hover {
    background-color: #e53e3e;
    border-color: #e53e3e;
    color: white;
}

/* Estilos antiguos para limpiar */
.raffle-item-body, .raffle-item-header .controls, .raffle-item p, .progress-bar-container, .progress-text {
    display: none;
}

.raffle-item-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-section {
    margin-top: 15px;
    position: relative; /* Necesario para el tooltip */
}

.progress-bar-container:hover .progress-tooltip {
    visibility: visible;
    opacity: 1;
}


.progress-text {
    font-size: 0.8rem !important;
    color: var(--text-muted);
}

/* Tarjeta del Campeón en el Dashboard */
#latest-winner-announcement {
    margin-bottom: 30px;
    perspective: 1000px; /* Para el efecto 3D en hover */
}

.champion-card {
    background: linear-gradient(135deg, #fceabb, #f8b500);
    color: #4a3300;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(248, 181, 0, 0.4);
    border: 2px solid #ffd700;
    text-align: center;
    animation: fall-in-and-bounce 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.champion-card:hover {
    transform: rotateY(10deg) rotateX(5deg) scale(1.02);
    box-shadow: 0 15px 40px rgba(248, 181, 0, 0.5);
}

@keyframes fall-in-and-bounce {
    0% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
    70% { transform: translateY(30px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.champion-header {
    background: rgba(0,0,0,0.1);
    padding: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.champion-header .fa-crown {
    color: #ffc107;
}

.champion-body {
    padding: 25px;
}

.champion-prize-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-bottom: 15px;
}

.champion-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.champion-prize {
    font-size: 1.1rem;
    margin-top: 5px;
}

.champion-raffle {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 20px;
}

.champion-number {
    background: rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

/* Formularios */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="file"] {
    padding: 8px;
    background-color: var(--item-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.form-group input,
.form-group textarea,
.form-group select {
    background-color: var(--item-bg);
    color: var(--text-primary);
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    transform: scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-shadow-color);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-shadow-color);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #a0aec0, #718096);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(113, 128, 150, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.4);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* Participantes */
.participants-container h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.raffle-selector {
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.raffle-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 10px;
}

.raffle-selector select,
.draw-selector select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--item-bg);
    color: var(--text-primary);
    padding: 12px 40px 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.raffle-selector select:focus,
.draw-selector select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-shadow-color);
    outline: none;
}

.participant-search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto 30px;
}

.participant-search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#participant-search {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    background-color: var(--item-bg);
    color: var(--text-primary);
}

.participants-content {
    margin-bottom: 30px;
}

.list-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    padding: 40px;
}

.participants-list {
    display: grid;
    gap: 15px;
}

.participant-item {
    background: var(--item-bg);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    display: grid;
    justify-content: space-between;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: item-fade-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Animación para los items de la lista */
@keyframes item-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.participant-info .status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.participant-info .status-badge.paid {
    background-color: rgba(72, 187, 120, 0.1);
    color: #38a169;
}

.participant-info .status-badge.pending {
    background-color: rgba(237, 137, 54, 0.1);
    color: #dd6b20;
}

.participant-info h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.participant-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.participant-info .screenshot-link {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 8px;
}

.participant-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 300px;
}

.number-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.participant-actions {
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
    margin-left: 20px;
    display: flex;
    gap: 10px;
}

.btn-toggle-status {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-edit-participant {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: rgba(113, 128, 150, 0.15);
    color: #718096;
}

.btn-toggle-status.paid { /* Botón para cambiar a 'Pagado' */
    background-color: rgba(72, 187, 120, 0.15);
    color: #38a169;
}
.btn-toggle-status.pending { /* Botón para cambiar a 'Pendiente' */
    background-color: rgba(237, 137, 54, 0.15);
    color: #dd6b20;
}

.add-participant-form {
    background: var(--item-bg);
    padding: 25px;
    border-radius: 10px;
    border: 2px dashed var(--border-dashed-color);
}

.prize-item textarea {
    resize: vertical;
    min-height: 60px;
}

.reference-example-link {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    margin-left: 5px;
}

.add-participant-form h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

/* Sorteo */
.draw-container h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.draw-selector {
    margin-bottom: 30px;
    text-align: center;
}

.draw-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 10px;
}

.draw-interface {
    text-align: center;
}

.raffle-info {
    background: var(--item-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.raffle-info h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.raffle-info p {
    color: #718096;
    margin-bottom: 15px;
}

.raffle-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.raffle-stats span {
    color: var(--text-secondary);
    font-weight: 500;
}

.draw-controls {
    margin-bottom: 30px;
}

/* Estilos para la animación de la ruleta */
.draw-animation-container {
    text-align: center;
    margin: 30px 0;
}

.draw-animation-container p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 15px;
    font-weight: 600;
}

.roulette {
    background: var(--item-bg);
    border: 4px solid var(--primary-color);
    border-radius: 15px;
    padding: 20px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 0 15px rgba(0,0,0,0.1);
}

.roulette-number {
    font-family: 'Poppins', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 200px;
    text-align: center;
    animation: number-pop 0.1s ease-out;
}

@keyframes number-pop {
    from { transform: scale(0.8); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

.draw-result {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(72, 187, 120, 0.3);
    position: relative;
    z-index: 1;
}

.winner-announcement h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.winners-list {
    display: grid;
    gap: 10px;
}

.winner-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: item-fade-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.winner-card.main-winner {
    transform: scale(1.05);
    border: 2px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    position: relative;
    overflow: hidden; /* Para que el banner no se salga */
}

.winner-card.main-winner:hover {
    transform: scale(1.07);
}

.main-prize-banner {
    position: absolute;
    top: 15px;
    right: -45px;
    background: #ffd700;
    color: #4a3300;
    padding: 5px 40px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.winner-card.main-winner .prize-description {
    margin-top: 20px; /* Espacio para que no choque con el banner */
    font-size: 1.5rem;
    justify-content: center;
}

.winner-card .prize-description {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.winner-card .prize-description i {
    color: #ffd700; /* Color dorado para el trofeo */
}

.winner-details {
    display: grid;
    gap: 8px;
}

.winner-details p {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.winner-details p i {
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.winner-details .number-badge {
    font-weight: bold;
}

/* Estilos para la cuenta regresiva */
#countdown-timer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#countdown-timer h4 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.countdown-blocks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.countdown-block {
    background: var(--item-bg-hover);
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}

.countdown-block span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.countdown-block small {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.countdown-separator {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: bold;
    transform: translateY(-5px); /* Alineación vertical */
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    padding: 15px 20px; 
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    border-left: 4px solid #48bb78;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.toast {
    background: var(--section-bg);
    color: var(--text-primary);
}

.toast.error {
    border-left-color: #e53e3e;
}

.toast.warning {
    border-left-color: #ed8936;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estados vacíos */
.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px;
    background: var(--item-bg);
    border-radius: 10px;
    border: 2px dashed var(--border-dashed-color);
}

/* Settings Section */
.settings-container h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.settings-container .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.color-presets {
    display: flex;
    gap: 10px;
}

.color-preset {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
}

.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .raffle-card {
        flex-direction: column; /* Apila la imagen y el contenido en móvil */
    }

    .raffle-card-image {
        width: 100%; /* La imagen ocupa todo el ancho de la tarjeta */
        height: 150px; /* Altura fija para la imagen en móvil */
    }

    .nav-btn {
        width: 100%;
        max-width: 250px; /* Un poco más de ancho para los botones de navegación */
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .raffle-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .participant-item {
        grid-template-columns: 1fr;
        align-items: flex-start;
        /* Se elimina el text-align: center para mejorar la legibilidad */
        gap: 15px;
    }
    
    .toast-container {
        left: 10px;
        right: 10px;
    }
    
    .participant-numbers {
        justify-content: center;
        max-width: 100%;
    }

    .participant-actions {
        padding-left: 0;
        margin-left: 0;
        border-left: none;
        margin-top: 15px;
        justify-content: center; /* Centra los botones de acción en móvil */
        width: 100%;
    }

    .support-fab {
        bottom: 15px;
        right: 15px;
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .form-container h2,
    .participants-container h2,
    .draw-container h2 {
        font-size: 1.5rem;
    }

    .pin-settings-wrapper {
        grid-template-columns: 1fr; /* Apila los campos de PIN en móvil */
    }

    .modal-actions {
        flex-direction: column; /* Apila los botones de acción en modales */
        gap: 15px;
    }

    /* --- Estilos responsivos para las tablas de administración --- */
    .admin-table thead {
        display: none; /* Ocultamos los encabezados de la tabla */
    }

    .admin-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .admin-table td {
        display: block;
        text-align: right; /* Alineamos el contenido a la derecha */
        padding-left: 50%; /* Dejamos espacio para la etiqueta */
        position: relative;
        border-bottom: 1px solid var(--border-color);
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label); /* Mostramos la etiqueta del data-label */
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .admin-table .actions {
        justify-content: flex-end; /* Alineamos los botones a la derecha */
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    opacity: 0; 
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%; 
    transform: translate(-50%, -60%) scale(0.95);
    background: var(--section-bg);
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    z-index: 1001;
    width: 90%;
    max-width: 600px;
    display: none;
    opacity: 0; 
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color); 
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted); 
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.close-modal-btn:hover {
    background-color: var(--item-bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-body p.warning-text {
    color: #e53e3e;
    font-weight: 600;
    margin-top: 10px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.image-preview {
    margin-top: 10px;
}

.image-preview img {
    max-width: 100px;
    border-radius: 8px;
}

.pin-settings-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.pin-actions {
    display: flex;
    gap: 10px;
}

/* Estilos para los items de premio en los formularios */
.prizes-container .prize-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--item-bg);
    position: relative;
}

.prize-item-content {
    flex-grow: 1;
}

.prize-item-content textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* Nuevo estilo para el campo de carga de imagen */
.prize-image-upload {
    flex-shrink: 0;
}

.prize-image-input {
    display: none; /* Ocultamos el input por defecto */
}

.prize-image-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-dashed-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--item-bg-hover);
    position: relative; /* Necesario para el texto superpuesto */
}

.prize-image-label:hover {
    border-color: var(--primary-color);
    border-style: solid;
    background-color: var(--section-bg);
    transform: scale(1.05);
}

.prize-image-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Para que la imagen no se salga del borde redondeado */
}

.prize-image-preview i {
    font-size: 2rem;
    color: var(--text-muted);
}

.prize-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra la imagen completa sin recortar */
}

.prize-image-text {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
/* Payment History Section */
.payment-history-container h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.prize-image-label:hover .prize-image-text {
    opacity: 1; /* Mostrar el texto al pasar el mouse */
}

.history-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.history-filters .participant-search-container {
    flex-grow: 1;
    margin-bottom: 0;
}

.history-filters select {
    padding: 12px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    background-color: var(--item-bg);
    color: var(--text-primary);
    min-width: 200px;
}

#history-search {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    background-color: var(--item-bg);
    color: var(--text-primary);
}

#payment-history-list {
    display: grid;
    gap: 15px;
}

.payment-history-item {
    background: var(--item-bg);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.payment-details {
    background: var(--item-bg-hover);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 1.6;
}
/* Botón para eliminar premio */
.btn-remove-prize {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-prize:hover {
    background-color: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    transform: scale(1.1);
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.btn-remove-item:hover {
    color: #e53e3e; /* Rojo para eliminar */
    transform: scale(1.1);
}

/* --- Panel de Administración --- */
.admin-container h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--item-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--item-bg-hover);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.admin-table th .sort-indicator {
    margin-left: 5px;
    color: var(--text-muted);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: var(--item-bg-hover);
}

.admin-table .actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--item-bg-hover);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: white;
    transform: scale(1.1);
}
.btn-icon.view:hover { background-color: var(--primary-color); }
.btn-icon.edit:hover { background-color: #F59E0B; } /* Naranja */
.btn-icon.delete:hover { background-color: #e53e3e; } /* Rojo */

.payment-details p {
    margin-bottom: 5px;
}

/* Ajuste para alinear el botón de eliminar método de pago */
#payment-methods-container .prize-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}


/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Botón de Soporte Flotante (WhatsApp) */
.support-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25D366; /* Color de WhatsApp */
    color: white;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.support-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Estilos para la edición manual del precio del dólar */
.dollar-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

#dollar-price-display {
    font-size: 2.5rem;
    font-weight: bold;
}

.edit-icon-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-icon-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

#dollar-price-edit {
    display: flex;
    gap: 5px;
}

#dollar-price-edit input {
    width: 100px;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background: var(--item-bg);
    color: var(--text-primary);
}

#dollar-price-edit button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
