/* ================================
   Panel de Control Global
   ================================ */

.control-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 999;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.panel-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6B7280;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-toggle:hover,
.panel-toggle.active {
    background: #374151;
    transform: rotate(90deg);
}

.panel-content {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 16px;
    transition: opacity 0.3s, transform 0.3s;
}

.panel-content.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.panel-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    padding-bottom: 8px;
    border-bottom: 1px solid #E2E8F0;
}

.panel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #475569;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #CBD5E1;
    transition: 0.3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: #10B981;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* Controles de tamaño de texto */
.text-size-controls {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.text-size-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #E2E8F0;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.text-size-controls button:hover,
.text-size-controls button.active {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

/* Selector de idioma de voz */
.voice-select {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 12px;
    background: white;
}

/* Atajos */
.panel-shortcuts {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E2E8F0;
    color: #94A3B8;
}

.panel-shortcuts kbd {
    background: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    border: 1px solid #CBD5E1;
}

/* ================================
   MODO OSCURO - Panel
   ================================ */
.control-panel.dark .panel-content {
    background: #1E293B;
    color: #E2E8F0;
}

.control-panel.dark .panel-title {
    color: #F1F5F9;
    border-color: #334155;
}

.control-panel.dark .panel-option {
    color: #CBD5E1;
}

.control-panel.dark .text-size-controls button {
    background: #334155;
    border-color: #475569;
    color: #E2E8F0;
}

.control-panel.dark .voice-select {
    background: #334155;
    border-color: #475569;
    color: #E2E8F0;
}

.control-panel.dark .panel-shortcuts {
    border-color: #334155;
    color: #64748B;
}

.control-panel.dark .panel-shortcuts kbd {
    background: #334155;
    border-color: #475569;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 480px) {
    .control-panel {
        bottom: 80px;
        right: 12px;
    }
    
    .panel-content {
        width: 240px;
        right: -10px;
    }
}

/* ================================
   ACCESIBILIDAD
   ================================ */
@media (prefers-reduced-motion: reduce) {
    .panel-toggle,
    .panel-content,
    .slider,
    .text-size-controls button {
        transition: none !important;
    }
}