/* ============================================================
 * assets/css/style.css 
 * Sistema de diseño Glassmorphism — Encuentro Textil 2026
 * Arquitectura: Secciones apiladas verticalmente (no fixed bg)
 * ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;600;700;800;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    --brand-blue: #0B2050;
    --brand-orange: #F26522;
    --brand-teal: #1E987F;
    --brand-dark: #060D1F;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-blur: 20px;
    --glass-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ---- Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.1;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: var(--brand-teal); border-radius: 3px; }

/* ============================
   GLASSMORPHISM COMPONENTS
   ============================ */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Navbar glass */
.glass-nav {
    background: rgba(6, 13, 31, 0.6);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: background 0.4s ease;
}

.glass-nav.scrolled {
    background: rgba(6, 13, 31, 0.85);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Inputs */
.glass-input {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-input:focus {
    border-color: rgba(242, 101, 34, 0.5);
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.12);
}

.glass-input:-webkit-autofill,
.glass-input:-webkit-autofill:hover,
.glass-input:-webkit-autofill:focus,
.glass-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0a1128 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Buttons glass */
.glass-btn {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
    cursor: pointer;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.glass-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ============================
   MODAL / POPUP
   ============================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

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

.modal-content {
    background: rgba(11, 32, 80, 0.65);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 1.5rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    padding: 2.5rem;
    width: 90%;
    max-width: 440px;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(242, 101, 34, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.modal-content::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -40%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(30, 152, 127, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: rotate(90deg);
}

/* ============================
   ROLE CARDS
   ============================ */

.role-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.role-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.role-card .role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.role-card .role-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.role-card .role-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Login form section */
.login-form-section {
    display: none;
    animation: fadeSlideUp 0.35s ease forwards;
}

.login-form-section.active {
    display: block;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   BUTTON GLOW EFFECT
   ============================ */

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.08), transparent 30%);
    animation: glowSpin 4s linear infinite;
}

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

.btn-glow > span {
    position: relative;
    z-index: 1;
}

/* ============================
   VIDEO RESPONSIVE (live.php)
   ============================ */

.video-responsive {
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 */
    position: relative;
    height: 0;
    border-radius: 1rem;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.video-responsive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Video controls */
.video-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(6, 13, 31, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.video-controls button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
}

.video-controls button:hover {
    background: rgba(242, 101, 34, 0.25);
    border-color: rgba(242, 101, 34, 0.4);
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--brand-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(242, 101, 34, 0.3);
}

/* ============================
   LIVE CHAT
   ============================ */

.chat-container {
    background: rgba(6, 13, 31, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.chat-header .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 300px;
    max-height: 500px;
}

.chat-message {
    animation: messageSlideIn 0.3s ease forwards;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.chat-message .msg-author {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.chat-message .msg-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    color: white;
    font-size: 0.85rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s ease;
    min-height: 44px;
}

.chat-input-area input:focus {
    border-color: rgba(30, 152, 127, 0.4);
}

.chat-input-area button {
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-blue));
    border: none;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    min-width: 44px;
    min-height: 44px;
}

.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(30, 152, 127, 0.25);
}

/* ============================
   SORTEO PANEL
   ============================ */

.sorteo-panel {
    background: rgba(6, 13, 31, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
}

.sorteo-wheel {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    margin: 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(
        from 0deg,
        var(--brand-orange) 0deg 60deg,
        var(--brand-teal) 60deg 120deg,
        var(--brand-blue) 120deg 180deg,
        var(--brand-orange) 180deg 240deg,
        var(--brand-teal) 240deg 300deg,
        var(--brand-blue) 300deg 360deg
    );
}

.sorteo-wheel.spinning {
    animation: wheelSpin 3s cubic-bezier(0.17, 0.67, 0.12, 0.99) forwards;
}

@keyframes wheelSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}

.sorteo-winner {
    background: linear-gradient(135deg, rgba(30, 152, 127, 0.15), rgba(11, 32, 80, 0.35));
    border: 1px solid rgba(30, 152, 127, 0.25);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1rem;
    animation: winnerReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes winnerReveal {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================
   ADMIN PANEL
   ============================ */

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.25s ease;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.participant-badge {
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-blue));
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================
   FLOATING PARTICLES
   ============================ */

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

/* ============================
   UTILITY ANIMATIONS
   ============================ */

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================
   REDUCED MOTION
   ============================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .video-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .chat-messages {
        min-height: 200px;
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .role-card {
        padding: 1.25rem 0.75rem;
    }
}

/* ============================
   ENHANCED FORM FIELDS
   ============================ */

.form-field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .glass-input {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper .glass-input:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.input-wrapper .glass-input:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(30, 152, 127, 0.5);
    box-shadow: 0 0 0 4px rgba(30, 152, 127, 0.1);
}

.input-check-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.input-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

@keyframes scaleIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.5); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* ============================
   ANIMATED ORBS (BACKGROUNDS)
   ============================ */

.registro-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: 0;
}

.registro-orb-1 {
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(11,32,80,0.8) 0%, rgba(30,152,127,0.2) 100%);
    animation: orbFloat 25s ease-in-out infinite alternate;
}

.registro-orb-2 {
    bottom: -30%;
    left: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(6,13,31,0.9) 0%, rgba(242,101,34,0.15) 100%);
    animation: orbFloat 30s ease-in-out infinite alternate-reverse;
}

.registro-orb-3 {
    top: 30%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(30,152,127,0.15) 0%, transparent 100%);
    animation: orbPulse 15s ease-in-out infinite alternate;
}

.modal-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
}

.modal-orb-1 {
    top: -30%;
    right: -30%;
    width: 250px;
    height: 250px;
    background: var(--brand-orange);
    animation: orbFloat 10s ease-in-out infinite alternate;
}

.modal-orb-2 {
    bottom: -30%;
    left: -30%;
    width: 300px;
    height: 300px;
    background: var(--brand-teal);
    animation: orbFloat 12s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, -5%) scale(1.05); }
    100% { transform: translate(-5%, 5%) scale(0.95); }
}

@keyframes orbPulse {
    0% { transform: scale(0.9); opacity: 0.2; }
    100% { transform: scale(1.1); opacity: 0.4; }
}

/* ============================
   ROLE CARDS UPDATES
   ============================ */

.role-card-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.admin-glow {
    background: radial-gradient(circle at center, rgba(242, 101, 34, 0.15) 0%, transparent 70%);
}

.participant-glow {
    background: radial-gradient(circle at center, rgba(30, 152, 127, 0.15) 0%, transparent 70%);
}

.role-card:hover .role-card-glow {
    opacity: 1;
}

.login-error-msg {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    color: rgb(248, 113, 113);
    font-size: 0.75rem;
    margin-bottom: 1rem;
}