@import url('https://fonts.cdnfonts.com/css/sf-pro-display');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'SF Pro Display', -apple-system, sans-serif; }
body { background-color: #f5f3f9; color: #333; height: 100vh; overflow: hidden; user-select: none; }
img.no-drag { pointer-events: none; -webkit-user-drag: none; user-select: none; }

.screen { width: 100vw; height: 100vh; display: flex; }
.hidden { display: none !important; }
.flex-center { justify-content: center; align-items: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 10px; }

[data-tooltip] { position: relative; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: white; padding: 6px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 1000; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); }

button { cursor: pointer; border: none; outline: none; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.95rem; }
.btn-primary, .btn-blue, .btn-light-blue, .btn-admit, .btn-join-lobby { border-radius: 30px !important; }
.btn-primary, .btn-blue { background: #0A83FF; color: white; padding: 12px 24px; }
.btn-primary:hover, .btn-blue:hover { background: #0070e0; }
.btn-light-blue { background: #abcfff; color: #004ba8; padding: 12px 20px; font-weight: 600; }

.login-box { background: white; padding: 40px; border-radius: 20px; text-align: center; }
.login-logo { height: 50px; margin-bottom: 20px; }
.sidebar { width: 280px; background: #ffffff; padding: 20px; display: flex; flex-direction: column; border-right: 1px solid #eaeaea; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.user-profile { display: flex; align-items: center; gap: 12px; background: #f9f9f9; padding: 10px; border-radius: 40px; margin-bottom: 20px; }
.avatar { width: 35px; height: 35px; border-radius: 50%; }
.input-code { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 10px; text-align: center; font-weight: bold; }
.main-content { flex: 1; padding: 40px; background: #ffffff; margin: 15px; border-radius: 20px; }
.invite-card { background: #f9f9f9; padding: 10px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #eaeaea; }

.integrated-top { position: absolute; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; z-index: 100; height: 70px; pointer-events: none; }
.header-left { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.header-left img { height: 30px; }
.logo-text { color: white; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.5px; }
.header-right { pointer-events: auto; }
.header-avatar { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.header-avatar:hover { border-color: #0A83FF; }
.user-profile-menu { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 50px; background: #2b2d31; border-radius: 12px; padding: 15px; min-width: 180px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,0.7); }
.dropdown-name { margin: 0 0 10px 0; font-weight: bold; color: white; text-align: center; }
.btn-dropdown { width: 100%; padding: 8px; background: none; border: none; color: white; cursor: pointer; border-radius: 5px; text-align: left; }
.btn-dropdown.text-danger { color: #ff4757; }
.btn-dropdown:hover { background: rgba(255, 255, 255, 0.1); }

.dark-mode { background-color: #030604; position: relative; flex-direction: column; align-items: center; justify-content: center; display:flex; }
.lobby-container { display: flex; gap: 40px; max-width: 900px; width: 100%; align-items: center; justify-content: center; padding: 20px; }
.lobby-video-section { flex: 1.2; position: relative; }
.lobby-wrapper { border-radius: 16px; overflow: hidden; background: #202124; aspect-ratio: 16/9; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.lobby-wrapper video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.lobby-controls { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 15px; z-index: 50; }
.lobby-info-section { flex: 0.8; color: white; display: flex; flex-direction: column; gap: 20px; }
.lobby-info-section h2 { font-size: 2rem; font-weight: 500; }
.lobby-code-label { color: #aaa; }
.lobby-code-label span { font-weight: bold; color: white; }
.lobby-people-box { background: #1e1f22; padding: 15px; border-radius: 12px; display: flex; flex-direction: column; gap: 10px; color: #aaa; border: 1px solid #333; }
.btn-join-lobby { padding: 15px; font-size: 1.1rem; font-weight: bold; }

.call-workspace { display: flex; flex: 1; width: 100%; height: calc(100vh - 80px); padding: 80px 20px 95px 20px; gap: 15px; overflow: hidden; transition: 0.4s; position:relative;}
.main-video-wrapper { flex: 1; position: relative; border-radius: 12px; transition: 0.4s; }

.right-sidebar { width: 0; opacity: 0; background-color: #1e1f22; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; transform: translateX(100px); transition: all 0.4s; }
.call-workspace.sidebar-open .right-sidebar { width: 360px; opacity: 1; transform: translateX(0); }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; color: white; min-width: 360px; }
.close-sidebar { background: transparent; color: #aaa; width: 30px; height: 30px; }
.sidebar-panel { flex: 1; padding: 0 20px 20px 20px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; color: white; min-width: 360px; }
.meeting-code-section, .people-list-container { background: #2b2d31; border-radius: 10px; padding: 15px; }
.section-label { font-size: 0.8rem; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.code-box { display: flex; justify-content: space-between; align-items: center; background: #1e1f22; padding: 10px 15px; border-radius: 8px; font-weight: bold; letter-spacing: 1px; }
.icon-btn-small { background: transparent; color: #aaa; padding: 5px; border-radius: 5px; }
.people-count { font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.people-bubbles { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.bubble { width: 35px; height: 35px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; color: white; overflow: hidden; }
.bubble img { width: 100%; height: 100%; object-fit: cover; }

.video-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 15px; width: 100%; height: 100%; position: relative; }
.video-wrapper, .local-pip { position: relative; background: #202124; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.3); outline: 3px solid transparent; transition: outline 0.2s; }
.video-wrapper { aspect-ratio: 16/9; }
.video-wrapper.speaking, .local-pip.speaking { outline-color: white; } 
.video-wrapper video, .local-pip video { width: 100%; height: 100%; object-fit: cover; }
.name-badge { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 5px; color: white; font-size: 12px; pointer-events: none; z-index: 10; }

.video-grid[data-remotes="1"] .video-wrapper { width: 75%; max-width: 1000px; }
.video-grid[data-remotes="2"] .video-wrapper { width: 48%; max-width: 800px; }
.video-grid[data-remotes="3"] .video-wrapper, .video-grid[data-remotes="4"] .video-wrapper { width: 45%; max-width: 500px; }
.video-grid.has-presentation { justify-content: flex-start; align-items: flex-start; }
.video-grid.has-presentation .presentation-wrapper { width: 75%; height: 100%; max-width: none; order: -1; aspect-ratio: auto; }
.video-grid.has-presentation .presentation-wrapper video { object-fit: contain; }
.video-grid.has-presentation .video-wrapper:not(.presentation-wrapper) { width: 22%; height: auto; margin-left: 10px; }

.local-pip { position: absolute; bottom: 20px; right: 20px; width: 260px; aspect-ratio: 16/9; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,0.6); cursor: grab; background: #222; margin: 0; }
.local-pip video { transform: scaleX(-1); pointer-events: none; }
.local-pip.dragging { cursor: grabbing; box-shadow: 0 15px 40px rgba(0,0,0,0.8); }
.hidden-unless-hover { opacity: 0; position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: white; border: none; padding: 8px; border-radius: 50%; z-index: 20; transition: 0.2s; }
.local-pip:hover .hidden-unless-hover { opacity: 1; }

.avatar-overlay { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; z-index: 5; border-radius: 12px; transition: background-color 0.5s ease; }
.avatar-overlay img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.overlay-mic-off { position: absolute; top: 15px; right: 15px; color: #ff5252; background: rgba(0,0,0,0.6); padding: 5px; border-radius: 50%; width: 28px; height: 28px; }
.empty-state-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: white; text-align: center; width: 450px; display: flex; flex-direction: column; gap: 10px; z-index: 10; background: transparent; box-shadow: none; align-items: center; }

.video-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; opacity: 0; transition: opacity 0.2s; z-index: 20; }
.video-wrapper:hover .video-controls { opacity: 1; }
.hover-btn { background: rgba(0,0,0,0.6); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hover-btn:hover { background: rgba(0,0,0,0.9); }

/* SLIDER VOLUMEN MODERNO */
.modern-slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 5px; background: #444; outline: none; opacity: 0.8; transition: .2s; }
.modern-slider:hover { opacity: 1; }
.modern-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #0A83FF; cursor: pointer; }
.modern-dots-menu { position: absolute; top: 40px; right: 10px; background: rgba(43, 45, 49, 0.85); backdrop-filter: blur(20px); border-radius: 12px; padding: 8px; min-width: 240px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 1000; opacity: 0; transform: scale(0.9) translateY(-10px); pointer-events: none; transition: 0.2s ease; display:flex; flex-direction:column; }
.modern-dots-menu.show { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }

.call-bottom-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 80px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 100; background: #030604; }
.bottom-left-group, .bottom-right-group, .center-group { display: flex; align-items: center; gap: 15px; }
.bottom-left-group { flex: 1; } .bottom-right-group { flex: 1; justify-content: flex-end; } .center-group { justify-content: center; }
.control-pill { background: #1e1f22; padding: 6px; display: flex; gap: 4px; align-items: center; position: relative; transition: border-radius 0.3s ease; }
.left-pill { border-radius: 40px; } .left-pill.deaf-off { border-radius: 16px 40px 40px 16px; } 
.center-pill { border-radius: 40px 16px 16px 40px; padding-right: 6px; } .center-pill.mic-off { border-radius: 16px 16px 16px 16px; } .right-pill { border-radius: 40px; }

.icon-btn { width: 44px; height: 44px; background: transparent; color: #fff; transition: 0.3s; border-radius: 50%; }
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.icon-btn.circle { background: #2b2d31; } .icon-btn.squircle-left { border-radius: 12px; } .icon-btn.squircle-always { border-radius: 12px; background: #2b2d31; }
.state-danger { background: #6d1b38 !important; color: #ff8a8a !important; }

/* ESTADO ACTIVO BOTONES (SHARE, MANO) */
.icon-btn.active-sq { background: #ABCFFF !important; color: #004BA8 !important; border-radius: 12px !important; }

.ai-ring-btn { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #0F2D31, #171E2F); border: none; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.4); cursor: pointer; transition: 0.3s; }
.ai-ring-btn:hover { transform: scale(1.05); } .ai-icon { width: 38px; height: 38px; object-fit: contain; }

.device-wrapper { position: relative; display: inline-flex; align-items: center; }
.mini-arrow { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: #333; color: white; display: flex; justify-content: center; align-items: center; opacity: 0; transition: 0.2s; z-index: 10; border: 2px solid #1e1f22; }
.device-wrapper:hover .mini-arrow { opacity: 1; background: #555; } .mini-arrow.open i { transform: rotate(180deg); }
.device-menu { position: absolute; bottom: 65px; left: 0; background: rgba(43, 45, 49, 0.85); backdrop-filter: blur(20px); border-radius: 12px; padding: 8px; min-width: 280px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 200; opacity: 0; transform: scale(0.9) translateY(10px); pointer-events: none; transition: 0.2s ease; display:flex; flex-direction:column; }
.device-menu.show { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.device-item { color: white; padding: 10px 15px; border-radius: 8px; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.2s; }
.device-item i { width: 16px; height: 16px; flex-shrink: 0; } .device-item:hover { background: rgba(255,255,255,0.1); }
.device-item .check-icon { margin-left: auto; color: #4ade80; display: none; } .device-item.active .check-icon { display: block; }
.filter-item { width: 60px; height: 60px; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 10px; text-align: center; background-size: cover; border: 2px solid transparent; }
.filter-item:hover { border-color: #0A83FF; }

/* REACCIONES Y EMOJIS */
.emoji-picker { position: absolute; bottom: 60px; left: 0; background: rgba(43, 45, 49, 0.85); backdrop-filter:blur(20px); padding: 10px; border-radius: 12px; display: flex; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); z-index: 200; align-items: center; }
.emoji-item { font-size: 24px; cursor: pointer; transition: 0.2s; position: relative; padding: 5px; border-radius: 8px; }
.emoji-item:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
.emoji-del { position: absolute; top: -5px; right: -5px; background: red; color: white; border-radius: 50%; width: 14px; height: 14px; display: none; justify-content: center; align-items: center; font-size: 10px; padding: 2px; }
.emoji-item:hover .emoji-del { display: flex; }
.add-emoji-btn { background: rgba(255,255,255,0.1); border: none; color: white; border-radius: 8px; width: 35px; height: 35px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.add-emoji-btn:hover { background: rgba(255,255,255,0.2); }

@keyframes reaction-pop { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(2.5); opacity: 1; } 80% { transform: translate(-50%, -50%) scale(2.5); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; } }
.reaction-pop { position: absolute; top:50%; left:50%; pointer-events: none; animation: reaction-pop 2s forwards; z-index: 1000; display:flex; justify-content:center; align-items:center; font-size:40px; text-shadow: 0 0 20px rgba(0,0,0,0.5); }

/* LEVANTAR LA MANO */
.hand-notifications { position: absolute; top: 80px; left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.hand-pill { display: flex; align-items: center; background: white; color: black; border-radius: 30px; height: 40px; padding: 5px; width: 40px; overflow: hidden; transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1); box-shadow: 0 5px 15px rgba(0,0,0,0.4); }
.hand-pill img { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.hand-pill span { white-space: nowrap; margin-left: 10px; opacity: 0; font-weight: bold; transition: opacity 0.3s ease; }
.hand-pill.expanded { width: auto; padding-right: 15px; } .hand-pill.expanded span { opacity: 1; transition-delay: 0.4s; }

/* ESTILOS APPLE PARA AJUSTES */
.settings-group { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 0 15px; border: 1px solid rgba(255,255,255,0.1); }
.apple-radio { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); cursor: pointer; color: white; font-size: 0.95rem; }
.apple-radio input { display: none; }
.radio-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #555; display: flex; justify-content: center; align-items: center; transition: 0.2s; }
.apple-radio input:checked + .radio-mark { border-color: #0A83FF; }
.apple-radio input:checked + .radio-mark::after { content: ''; width: 12px; height: 12px; background: #0A83FF; border-radius: 50%; display: block; }
.apple-radio input[disabled] ~ * { opacity: 0.5; }

.apple-switch-label { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); cursor: pointer; color: white; font-size: 0.95rem; width: 100%; }
.apple-switch { position: relative; width: 50px; height: 28px; } .apple-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #444; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.apple-switch input:checked + .slider { background-color: #34C759; } .apple-switch input:checked + .slider:before { transform: translateX(22px); }

/* TIMER PILL & SCROL */
.timer-pill { position: absolute; right: 20px; top: -60px; background: #2b2d31; color: #fff; padding: 8px 15px; border-radius: 30px; display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 1.1rem; box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 100; border: 1px solid rgba(255,255,255,0.1); }
.timer-picker-container { display: flex; justify-content: center; gap: 15px; position: relative; height: 150px; background: rgba(0,0,0,0.3); border-radius: 12px; overflow: hidden; }
.picker-col { display: flex; flex-direction: column; align-items: center; width: 60px; z-index: 2; }
.picker-label { font-size: 10px; color: #aaa; text-transform: uppercase; margin-top: 5px; }
.scroll-picker { height: 120px; overflow-y: auto; scroll-snap-type: y mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.scroll-picker::-webkit-scrollbar { display: none; }
.scroll-item { height: 40px; display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: bold; color: white; scroll-snap-align: center; }
.scroll-picker .pad { height: 40px; }
.picker-highlight { position: absolute; top: 60px; left: 0; width: 100%; height: 40px; background: rgba(255,255,255,0.1); z-index: 1; pointer-events: none; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); }

/* MODALES Y ANIMACIONES */
.waiting-full-screen { background: #030604 !important; flex-direction: column; text-align: center; position: absolute; inset: 0; z-index: 50; padding-top: 70px; }
.waiting-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 500; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; }
.blur-overlay { background: rgba(0,0,0,0.5) !important; backdrop-filter: blur(10px); }
.blur-modal-box { background: rgba(30, 31, 34, 0.85); padding: 40px; border-radius: 24px; text-align: center; max-width: 420px; box-shadow: 0 15px 50px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); }
@keyframes smooth-spin-pause { 0% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); } 50% { transform: rotate(360deg); } 100% { transform: rotate(360deg); } }
.spinning-icon { animation: smooth-spin-pause 2.5s infinite; }
@keyframes subtle-shake { 0% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(1px, 1px) rotate(1deg); } 50% { transform: translate(0, 0) rotate(0deg); } 75% { transform: translate(-1px, 1px) rotate(-1deg); } 100% { transform: translate(0, 0) rotate(0deg); } }
.soft-shake { animation: subtle-shake 3s ease-in-out infinite; }
.admit-toast { position: absolute; top: 80px; right: 20px; background-color: #1a1e1c; padding: 8px 12px 8px 20px; border-radius: 30px; display: flex; align-items: center; gap: 15px; z-index: 1000; border: 1px solid #333; }
.toast-info { color: white; font-size: 0.9rem; }
.pip-bottom-bar { position: fixed; bottom: 0; left: 0; width: 100%; display: flex; justify-content: center; padding: 15px; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 1000; }

@media (max-width: 768px) {
    .call-bottom-bar { justify-content: center; align-items: flex-end; padding-bottom: 20px; background: transparent; pointer-events: none; }
    .center-group { pointer-events: auto; }
    .bottom-left-group { position: fixed; top: 80px; left: 10px; pointer-events: auto; flex-direction: column; z-index: 100; }
    .bottom-right-group { position: fixed; top: 80px; right: 10px; pointer-events: auto; flex-direction: column; z-index: 100; }
    .control-pill { flex-direction: column; } .center-pill { flex-direction: row; } 
    .local-pip { width: 120px; bottom: 120px; right: 10px; }
    .right-sidebar { position: absolute; height: 100%; right: 0; z-index: 200; }
    .call-workspace { padding-top: 60px; padding-bottom: 100px; }
    .timer-pill { top: auto; bottom: -50px; left: 0; }
}
