/* ============================================
   RULETA DE NOMBRES - CSS ESPECTACULAR
   ============================================ */

/* Google Font: Righteous para títulos impactantes */
@import url('https://fonts.googleapis.com/css2?family=Righteous&display=swap');

/* Container */
.container-ruleta {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Title Section */
.title-section {
    text-align: center;
    margin: 2rem 0 3rem;
    animation: fadeInDown 0.8s ease;
}

.title-main {
    font-family: 'Righteous', cursive;
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    animation: titlePulse 3s ease-in-out infinite;
}

.title-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 500;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ruleta Container */
.ruleta-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0;
    min-height: 600px;
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Ruleta Wrapper */
.ruleta-wrapper {
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 20px 60px rgba(102, 126, 234, 0.4));
}

.ruleta-pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    z-index: 100;
    color: #ef4444;
    text-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    animation: pointerBounce 1s ease-in-out infinite;
}

@keyframes pointerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

#ruletaCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2),
                0 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Botón Girar */
.btn-girar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 6px solid white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6),
                inset 0 -4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    font-family: 'Righteous', cursive;
    z-index: 50;
}

.btn-girar:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.8);
}

.btn-girar:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

.btn-girar:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-girar-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.btn-girar-icon {
    font-size: 2rem;
    animation: iconRotate 2s linear infinite;
}

@keyframes iconRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-girar:disabled .btn-girar-icon {
    animation: none;
}

/* Winner Display */
.winner-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    border-radius: 32px;
    padding: 3rem;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    text-align: center;
    min-width: 400px;
    animation: popIn 0.5s ease forwards;
    border: 4px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.winner-display::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    border-radius: 32px;
    z-index: -1;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.winner-icon {
    font-size: 5rem;
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.winner-title {
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
}

.winner-name {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1f2937;
    margin: 1rem 0;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-cerrar-ganador {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #6b7280;
}

.btn-cerrar-ganador:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Controls Panel */
.controls-panel {
    max-width: 900px;
    margin: 3rem auto;
    display: grid;
    gap: 2rem;
}

.panel-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #f3f4f6;
    transition: all 0.3s ease;
}

.panel-section:hover {
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.panel-section h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
    font-weight: 700;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nombre-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.nombre-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.btn-add {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-add:active {
    transform: translateY(0);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-quick {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9375rem;
}

.btn-quick:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-quick.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Lista Container */
.lista-container {
    max-height: 300px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
}

.lista-container::-webkit-scrollbar {
    width: 8px;
}

.lista-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.lista-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.lista-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-hint {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.nombre-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nombre-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.nombre-text {
    font-weight: 600;
    color: #1f2937;
}

.btn-eliminar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2;
    border: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.btn-eliminar:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.config-item label:hover {
    background: #f3f4f6;
    border-color: #667eea;
}

.config-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.config-item span {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.9375rem;
}

/* Historial */
.historial-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.historial-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.historial-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

.historial-medal {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.historial-info {
    flex: 1;
}

.historial-nombre {
    font-weight: 700;
    color: #1f2937;
}

.historial-hora {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Templates Section */
.templates-section {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 20px;
}

.templates-section h2 {
    font-size: 1.5rem;
    color: #78350f;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.template-btn {
    padding: 1.25rem;
    background: white;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #92400e;
}

.template-btn:hover {
    background: #fbbf24;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
}

/* Info Section */
.info-section {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2rem;
}

.info-section h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 2rem;
    text-align: center;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
    position: relative;
}

.info-number {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.info-card h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 1rem 0 0.75rem 0;
}

.info-card p {
    color: #6b7280;
    line-height: 1.6;
}

.usos-section,
.tips-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.usos-section h3,
.tips-section h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0 0 1.5rem 0;
}

.usos-list,
.tips-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.usos-list li,
.tips-list li {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    color: #4b5563;
    line-height: 1.6;
}

.tips-list {
    grid-template-columns: 1fr;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
}

.modal-header {
    padding: 2rem;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.textarea-multiple {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.textarea-multiple:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    padding: 2rem;
    border-top: 2px solid #f3f4f6;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-modal-cancel,
.btn-modal-add {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-modal-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-modal-cancel:hover {
    background: #e5e7eb;
}

.btn-modal-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-modal-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .title-main {
        font-size: 2.5rem;
    }

    .winner-display {
        min-width: 90%;
        padding: 2rem 1.5rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .usos-list {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2rem;
    }

    .btn-girar {
        width: 100px;
        height: 100px;
    }

    .btn-girar-text {
        font-size: 1rem;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }
}