body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background-image: url("../img/content/fondo.jpg");
    background-size: cover; 
    background-repeat: no-repeat; 
    background-position: center;
    color: #333333;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    /* Evita scroll en el fondo */
    overflow: hidden;
}

.header {
    width: 100px; 
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    padding: 5px;
    background-color: #27272783; 
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 4px 0 6px rgba(0, 0, 0, 0.1);
}


.header .top-icons {
    margin-top: 50px; 
    display: flex;
    flex-direction: column;
    gap: 20px; 
}

.header .top-icons .icon img {
    width: 55px; 
    height: auto;
}

.header .bottom-icons {
    display: flex;
    justify-content: center; 
    align-items: center;     
    width: 100%;            
}


.header .bottom-icons .grid-icon img {
    width: 120px;
    height: auto;
}

.header2 {
    width: 100%; 
    height: 40px; 
    display: flex;
    padding: 0 20px; 
    background-color: #1b1b1bf3; 
    color: white; 
    position: fixed; 
    top: 0; 
    left: 0; 
    z-index: 1000; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
}

.header h1 {
    margin-bottom: 20px;
}

.header a {
    color: white; 
    text-decoration: none; 
    margin-bottom: 10px; 
}

.header a:hover {
    text-decoration: underline; 
}

.content {
    margin-left: 220px; 
    padding: 20px; 
}

.time {
    display: block; 
    text-align: center; 
    margin: 0 auto; 
}

.power-menu {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 20px; 
    text-align: center;
    z-index: 1100;
}

.power-menu .power-icon img {
    width: 24px;  
    height: auto;
    margin-top: -2px;  
}

.power-menu .submenu {
    position: absolute;
    top: 100%; 
    right: 0;
    transform: translateX(-0%); 
    display: none; 
    background: #1b1b1bf3;;
    color: #fff;
    border-radius: 5px;
    margin-top: 5px;
    padding: 10px;
    min-width: 200px;
}

.submenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.submenu ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.submenu ul li:last-child {
    border-bottom: none;
}

.submenu ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
}

.power-menu.active .submenu {
    display: block;
}

.calendar {
    position: absolute;
    top: 120%;
    right: 820px;
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; 
    min-width: 250px;
    z-index: 1200; 
}

.calendar.active {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-header .prev,
.calendar-header .next {
    cursor: pointer;
    font-size: 1.2em;
}

.calendar-body table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.calendar-body th,
.calendar-body td {
    padding: 5px;
    border: 1px solid #ddd;
    font-size: 0.9em;
}



.power-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.power-modal.active {
    display: flex;
    opacity: 1;
}

.power-modal-content {
    display: flex;
    flex-direction: column;
    position: relative; 
    background-color: #242424;
    border-radius: 8px;
    min-height: 100px;
    padding: 20px 20px 60px; 
    width: 300px;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.041);
    color: #fff; 
}

.power-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.power-modal-title {
    font-size: 1.2em;
    font-weight: bold;
}

.power-modal h3 {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.power-modal-body {
    flex-grow: 1; 
}

.power-modal-body p {
    margin: 10px 0;
    font-size: 1.4em; 
}

.power-modal-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #fff;
    background-color: rgba(0, 0, 0, 0.4); 
    padding: 10px 0;
}

.power-modal-actions button {
    flex: 1; 
    margin: 0 5px; 
    padding: 8px 12px;
    border: none;
    border-color: #494949;
    cursor: pointer;
    font-size: 0.9em;
}

#power-modal-confirm {
    background-color: #494949;
    color: #fff;
}

#power-modal-cancel {
    background-color: #494949;
    color: #fff;
}

.volume-image {
    display: inline-block;
    vertical-align: middle;
    margin-right: 65px;
    position: relative;
    top: 7px;
}

.volume-image img {
    width: 25px; 
    height: auto;
    cursor: pointer;
}


@media (max-width: 768px) {
    body {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        justify-content: flex-start !important;
        align-items: stretch !important;
        overflow: auto !important;
        padding-bottom: 64px;
        background-size: cover;
    }

    .header {
        width: 100vw !important;
        height: 56px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 8px !important;
        position: fixed;
        bottom: 0; left: 0; right: 0; top: unset;
        z-index: 1200;
        box-shadow: 0 -2px 6px rgba(0,0,0,0.08);
        background-color: #272727eb;
        gap: 0;
    }
    
    .header .top-icons, .header .bottom-icons {
        flex-direction: row !important;
        gap: 8px !important;
        margin: 0 !important;
    }
    

    .header2 > p,
    .volume-image {
        display: none !important;
    }

    .header .bottom-icons {
        justify-content: flex-end !important;
        width: 100vw !important;
        padding-right: 10px !important;
    }
    .header .bottom-icons .grid-icon img {
        margin-right: 0 !important;
        width: 55px !important;
        height: 55px !important;
        max-width: 64px !important;
        max-height: 64px !important;
    }
    
    .header .top-icons .icon img {
        width: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
    }
    
    .header h1 { font-size: 1.2em !important; }

    .header2 {
        position: relative !important;
        width: 100vw !important;
        left: 0 !important;
        top: 0 !important;
        height: 48px !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 0 !important;
        font-size: 0.98em;
        z-index: 1100;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        display: flex !important;
        justify-content: flex-end !important;
    }
    
    .header2 .time {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        font-size: 1.03em !important;
        text-align: center !important;
        width: max-content !important;
        z-index: 1 !important;
        color: #e6e6e6 !important;
        background: transparent !important;
        padding: 0 4px !important;
        pointer-events: none;
    }
    
    .header2 p { margin: 0 !important; font-size: 1em;}

    .calendar {
        position: static !important;
        top: unset !important;
        right: unset !important;
        width: 100vw !important;
        min-width: unset !important;
        margin: 0 auto 4px auto;
        font-size: 0.95em;
        box-shadow: none !important;
    }

    .header2 > .power-menu {
        margin-left: auto !important;
        position: relative !important;
        right: 0 !important;
        left: unset !important;
        margin-right: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 32px !important;
        z-index: 1300;
    }
    
    .power-menu .submenu {
        left: unset !important;
        right: 0 !important;
        transform: none !important;
    }
    
    .header2 > *:not(.time):not(.power-menu) {
        display: none !important;
    }
    
    .apps-header-inline,
    .apps-header,
    .apps-header2,
    .apps-header3 {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .volume-image { margin: 0 !important; top: 0 !important;}
    .volume-image img { width: 20px !important; top: 0; }

    .content {
        margin-left: 0 !important;
        padding: 16px !important;
        width: 100vw !important;
        box-sizing: border-box !important;
    }

    .terminal-modal, .tasks-modal, .firefox-modal, .files-modal,
    .ubuntu-store, .spotify-modal, .discord-modal, .calculadora-modal,
    .snake-modal, .tetris-modal, .monitor-modal, .editor-modal,
    .settings-modal {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
        font-size: 1em !important;
        z-index: 2001 !important;
        box-shadow: 0 0 6px rgba(0,0,0,0.08);
        overflow-y: auto !important;
        display: none; 
    }

    .terminal-modal-header, .tasks-modal-header, .calendar-header,
    .files-modal-header, .store-modal-header, .discord-modal-header,
    .spotify-modal-header, .calculadora-header, .snake-header,
    .tetris-header, .monitor-header, .editor-header, .settings-modal-header {
        font-size: 1.08em !important;
        min-height: 44px !important;
        padding: 8px 12px !important;
        box-sizing: border-box;
        border-radius: 0 !important;
    }


    button, .store-close-button, .discord-close, .spotify-close,
    .calculadora-close, .tasks-close, .terminal-close, .files-close, .window-close,
    .settings-close, .editor-close {
        min-width: 44px; min-height: 44px; font-size: 1.1em !important;
        padding: 6px 12px !important;
        border-radius: 6px !important;
    }

    table, .monitor-procesos-table, .calendar-body table {
        font-size: 0.95em !important;
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
    }

    .app-grid, .apps-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        padding: 10px !important;
    }

    .app-grid .app-card, .apps-grid .app-item {
        max-width: 96vw !important;
        min-width: 0 !important;
        width: 95% !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }
    
    .apps-grid .app-item,
    .app-grid .app-card {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        height: 130px !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        border-radius: 11px !important;
        padding: 16px 8px !important;
    }
    
    .apps-grid .app-item img,
    .app-grid .app-card .app-icon img {
        max-width: 60px !important;
        max-height: 60px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        margin-bottom: 10px !important;
    }
    
    .apps-grid .app-item p,
    .app-grid .app-card h3,
    .app-grid .app-card p {
        text-align: center !important;
        margin: 0 !important;
        font-size: 1.06em !important;
    }
    
    .apps-modal, .app-grid-container, .apps-container {
        max-width: 100vw !important;
        padding: 0 !important;
    }

    input, select, textarea {
        font-size: 1.09em !important;
        padding: 10px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .badge, .categories-bar nav, .categories-bar a {
        font-size: 1.05em !important;
        padding: 6px 0 !important;
        margin: 2px 0 !important;
        text-align: center !important;
    }

    .servers-sidebar, .channels-sidebar {
        width: 48px !important;
        min-width: 48px !important;
        padding: 3px !important;
        font-size: 0.9em !important;
    }
    
    .channels-sidebar { width: 120px !important; }

    /* Ajustes para editor y monitor */
    .editor-main-area, .monitor-content, .apps-header-inline {
        flex-direction: column !important;
        gap: 4px !important;
    }
    
    .editor-sidebar, .editor-workarea {
        width: 100% !important; 
        min-width: unset !important; 
        max-width: 100vw !important; 
        padding: 0 !important;
    }

    .editor-footer, .power-modal-actions, .settings-sidebar {
        flex-direction: row !important;
        gap: 4px !important;
        padding: 8px !important;
        font-size: 1em !important;
    }
    
    .section-title, .apps-header-inline {
        text-align: center !important;
        margin: 14px 0 9px 0 !important;
    }

    body, html { overflow-x: hidden !important; }

    [style*="position:fixed"], [style*="position:absolute"] {
        max-width: 100vw !important;
        max-height: 100vh !important;
        left: 0 !important;
        right: unset !important;
    }
    
    .power-modal-content {
        width: 90% !important;
        max-width: 350px !important;
    }
}

