/**
 * ========================================
 * IA4Os - Dock with Start Menu Styles
 * Estilos para el Dock con Menú de Inicio
 * ========================================
 */

/* Contenedor principal del dock */
.dock {
    position: fixed;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 300ms ease;
    user-select: none;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.dock-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

/* ================================
   BOTÓN DE INICIO ESPECIAL
   ================================ */

.start-button {
    width: 52px !important;
    height: 52px !important;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 50%, #003DA6 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4) !important;
    margin-right: 12px !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.start-button .start-icon {
    font-size: 24px !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    transition: all 0.2s ease !important;
    z-index: 1 !important;
    position: relative !important;
}

/* Estados hover del botón de inicio */
.start-button:hover {
    transform: translateY(-8px) scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.6) !important;
    background: linear-gradient(135deg, #0088FF 0%, #0066FF 50%, #0044CC 100%) !important;
}

.start-button:hover .start-icon {
    transform: scale(1.1) !important;
}

/* Animación de click del botón de inicio */
.start-button:active {
    transform: translateY(-8px) scale(1.05) !important;
    transition: all 0.1s ease !important;
}

.start-button:active .start-icon {
    transform: scale(0.9) !important;
}

/* Tooltip del botón de inicio */
.start-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.start-button:hover .start-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* ================================
   SEPARADOR ESPECIAL DEL INICIO
   ================================ */

.start-separator {
    width: 2px !important;
    height: 40px !important;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.3) 80%, transparent 100%) !important;
    margin: 0 8px !important;
    flex-shrink: 0 !important;
    border-radius: 1px !important;
}

/* ================================
   ITEMS REGULARES DEL DOCK
   ================================ */

.dock-item {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dock-item:hover {
    transform: translateY(-8px) scale(1.2);
    background: rgba(255, 255, 255, 0.2);
}

.dock-item.active {
    background: rgba(0, 122, 255, 0.2);
    border: 1px solid rgba(0, 122, 255, 0.4);
}

.dock-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: all 0.2s ease;
}

/* Indicador de aplicación activa */
.dock-indicator {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #007AFF;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dock-item.active .dock-indicator {
    opacity: 1;
}

/* Tooltip de aplicaciones */
.dock-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
    z-index: 1000;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

/* ================================
   SEPARADORES REGULARES
   ================================ */

.dock-separator {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    flex-shrink: 0;
}

/* ================================
   MENÚ CONTEXTUAL
   ================================ */

.dock-context-menu {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 150px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    animation: contextMenuAppear 0.2s ease-out;
}

@keyframes contextMenuAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dock-context-menu > div {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dock-context-menu > div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ================================
   MENÚ DE INICIO BÁSICO
   ================================ */

#basic-start-menu {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 5000;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    animation: startMenuAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes startMenuAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#basic-start-menu h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

#basic-start-menu .app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 4px 8px;
}

#basic-start-menu .app-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#basic-start-menu .app-item .app-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

#basic-start-menu .app-item .app-info {
    flex: 1;
}

#basic-start-menu .app-item .app-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

#basic-start-menu .app-item .app-description {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
}

/* ================================
   EFECTOS DE MAGNIFICATION
   ================================ */

.dock-item {
    transform-origin: bottom center;
}

.dock:hover .dock-item {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ================================
   POSICIONES DEL DOCK
   ================================ */

/* Dock en la parte superior */
.dock.position-top {
    top: 60px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
}

.dock.position-top .dock-item {
    transform-origin: top center;
}

.dock.position-top .dock-tooltip {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

.dock.position-top .start-tooltip {
    bottom: auto;
    top: 120%;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Dock en el lado izquierdo */
.dock.position-left {
    left: 20px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.dock.position-left .dock-inner {
    flex-direction: column;
}

.dock.position-left .dock-separator,
.dock.position-left .start-separator {
    width: 32px;
    height: 1px;
    margin: 8px 0;
}

/* Dock en el lado derecho */
.dock.position-right {
    right: 20px;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.dock.position-right .dock-inner {
    flex-direction: column;
}

.dock.position-right .dock-separator,
.dock.position-right .start-separator {
    width: 32px;
    height: 1px;
    margin: 8px 0;
}

/* ================================
   TAMAÑOS DEL DOCK
   ================================ */

.dock.size-small .dock-item,
.dock.size-small .start-button {
    width: 40px;
    height: 40px;
}

.dock.size-small .start-button {
    width: 44px !important;
    height: 44px !important;
}

.dock.size-small .dock-icon,
.dock.size-small .start-icon {
    font-size: 20px;
}

.dock.size-large .dock-item,
.dock.size-large .start-button {
    width: 56px;
    height: 56px;
}

.dock.size-large .start-button {
    width: 60px !important;
    height: 60px !important;
}

.dock.size-large .dock-icon,
.dock.size-large .start-icon {
    font-size: 28px;
}

/* ================================
   AUTO-HIDE FUNCTIONALITY
   ================================ */

.dock.auto-hide {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dock.auto-hide.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(calc(100% - 20px));
}

.dock.position-top.auto-hide.hidden {
    transform: translateX(-50%) translateY(calc(-100% + 20px));
}

.dock.position-left.auto-hide.hidden {
    transform: translateY(-50%) translateX(calc(-100% + 20px));
}

.dock.position-right.auto-hide.hidden {
    transform: translateY(-50%) translateX(calc(100% - 20px));
}

/* ================================
   ANIMACIONES Y TRANSICIONES
   ================================ */

@keyframes dockItemBounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

.dock-item.launching {
    animation: dockItemBounce 0.6s ease-in-out;
}

.start-button.launching {
    animation: dockItemBounce 0.6s ease-in-out;
}

/* Efecto de ondas al hacer click */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.dock-item::after,
.start-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.dock-item.ripple::after,
.start-button.ripple::after {
    animation: ripple 0.6s ease-out;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .dock {
        width: calc(100% - 40px);
        left: 20px;
        transform: none;
        border-radius: 16px;
    }
    
    .dock-inner {
        justify-content: center;
        gap: 6px;
        padding: 6px;
    }
    
    .dock-item,
    .start-button {
        width: 44px !important;
        height: 44px !important;
    }
    
    .dock-icon,
    .start-icon {
        font-size: 20px !important;
    }
    
    .start-button {
        margin-right: 8px !important;
    }
    
    #basic-start-menu {
        width: calc(100vw - 40px);
        left: 20px;
        bottom: 70px;
    }
}

@media (max-width: 480px) {
    .dock-inner {
        gap: 4px;
        padding: 4px;
    }
    
    .dock-item,
    .start-button {
        width: 40px !important;
        height: 40px !important;
    }
    
    .dock-icon,
    .start-icon {
        font-size: 18px !important;
    }
    
    .start-button {
        margin-right: 6px !important;
    }
}

/* ================================
   ESTADOS DE ACCESIBILIDAD
   ================================ */

.dock-item:focus,
.start-button:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .dock,
    .dock-item,
    .start-button,
    .dock-tooltip,
    .start-tooltip {
        transition: none;
        animation: none;
    }
    
    .dock-item:hover,
    .start-button:hover {
        transform: none;
    }
}

/* ================================
   MODO OSCURO MEJORADO
   ================================ */

@media (prefers-color-scheme: dark) {
    .dock {
        background: rgba(40, 40, 40, 0.9);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .dock-tooltip,
    .start-tooltip {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ================================
   TEMA PERSONALIZADO
   ================================ */

.dock.theme-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dock.theme-solid {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dock.theme-colorful .start-button {
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #45B7D1 100%);
}

.dock.theme-colorful .start-button:hover {
    background: linear-gradient(135deg, #FF5252 0%, #26C6DA 50%, #2196F3 100%);
}