* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: center/cover no-repeat fixed;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.menu-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    padding: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.menu-title {
    color: rgba(255, 255, 255, 1);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    cursor: grab;
    user-select: none;
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.menu-title:active {
    cursor: grabbing;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.change-bg-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.change-bg-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.change-bg-btn:hover::before {
    opacity: 1;
}

.change-bg-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.change-bg-btn:active {
    transform: scale(0.95);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.change-bg-btn svg {
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

.glass-button {
    width: 100%;
    height: 44px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 11px;
    color: rgba(255, 255, 255, 1);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 13px 13px 0 0;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.glass-button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-button .icon {
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    opacity: 0.95;
    flex-shrink: 0;
}

.glass-button .text {
    flex: 1;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.2px;
}

.glass-button.danger {
    background: rgba(255, 69, 58, 0.1);
    border-color: rgba(255, 100, 100, 0.15);
}

.glass-button.danger:hover {
    background: rgba(255, 69, 58, 0.15);
    border-color: rgba(255, 100, 100, 0.2);
}

.glass-button:last-child {
    margin-bottom: 0;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .menu-glass {
        padding: 20px;
    }
    
    .glass-button {
        height: 52px;
        font-size: 15px;
    }
}

.background-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bg-icon {
    font-size: 48px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.bg-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bg-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    padding: 24px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    min-width: 350px;
    max-width: 90%;
    animation: slideUp 0.3s ease;
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    user-select: none;
}

.modal-header h3 {
    color: rgba(255, 255, 255, 1);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: grab;
    user-select: none;
    flex: 1;
}

.modal-header h3:active {
    cursor: grabbing;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.minimize-btn,
.maximize-btn,
.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.minimize-btn:hover {
    background: rgba(255, 200, 0, 0.3);
    transform: scale(1.05);
}

.maximize-btn:hover {
    background: rgba(0, 200, 0, 0.3);
    transform: scale(1.05);
}

.close-btn:hover {
    background: rgba(255, 59, 48, 0.4);
    transform: scale(1.05);
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    margin-left: auto;
    transition: all 0.3s ease;
}

.indicator.active {
    background: rgba(0, 255, 100, 0.8);
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.6);
}

.glass-button {
    position: relative;
}

.modal-content {
    color: white;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.app-icon {
    font-size: 24px;
}

.app-name {
    font-size: 15px;
    font-weight: 500;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.toggle {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.profile-info h4 {
    font-size: 18px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.profile-info p {
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.profile-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}


/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.3) 50%);
    border-bottom-right-radius: 20px;
    z-index: 10;
}

.resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%);
}

.modal-glass {
    position: relative;
    overflow: hidden;
}

.menu-glass {
    position: relative;
    overflow: hidden;
}

.modal-content {
    overflow-y: auto;
    max-height: calc(100% - 60px);
}

/* Modal con página web */
.modal-web {
    min-width: 600px;
    min-height: 500px;
    width: 800px;
    height: 600px;
}

.modal-iframe-content {
    padding: 0;
    margin: 0;
    height: calc(100% - 60px);
    max-height: none;
    overflow: hidden;
}

.web-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 18px 18px;
    background: white;
}


/* Animación de entrada */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Búsqueda */
.search-container {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Notificaciones */
.notifications-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 14px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: slideInRight 0.3s ease-out;
    min-width: 250px;
    pointer-events: auto;
}

.notification.success {
    border-color: rgba(0, 255, 100, 0.4);
}

.notification.error {
    border-color: rgba(255, 59, 48, 0.4);
}

.notification-icon {
    font-size: 18px;
    font-weight: bold;
}

.notification-text {
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.buttons-container {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 280px);
    padding-right: 8px;
    margin-right: -8px;
}

/* Ocultar scrollbar pero mantener funcionalidad */
.buttons-container::-webkit-scrollbar {
    display: none;
}

.buttons-container {
    -ms-overflow-style: none;  /* IE y Edge */
    scrollbar-width: none;  /* Firefox */
}


/* Drag handle mejorado */
.drag-handle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: grab;
    margin-right: 8px;
    user-select: none;
    padding: 4px;
    transition: all 0.2s ease;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
}

.glass-button[draggable="true"] {
    cursor: grabbing;
}


/* Ajustes para menú con scroll */
.section-title {
    flex-shrink: 0;
}

.search-input {
    font-size: 13px;
    padding: 8px 12px;
}

.config-buttons {
    flex-shrink: 0;
    margin-top: 10px;
}

/* Modo compacto mejorado */
.menu-glass.compact .glass-button {
    height: 38px;
    font-size: 12px;
    padding: 0 12px;
    margin-bottom: 4px;
}

.menu-glass.compact .icon {
    font-size: 14px;
}

.menu-glass.compact .buttons-container {
    max-height: calc(100vh - 240px);
}
