/* ============================================================ */
/* File: css/style.css                                          */
/* Description: Stylesheet chính cho Win10 Sim (Full Pro)       */
/* Location: Vietnam                                            */
/* Date: Wednesday, January 14, 2026                            */
/* ============================================================ */

/* ============================================================
   1. VARIABLES & GLOBAL RESET
   ============================================================ */
:root {
    /* --- Background & Dimensions --- */
    --desktop-bg: url('../images/default-background.jpg');
    --desktop-bg-size: cover;
    --desktop-bg-repeat: no-repeat;
    --desktop-bg-position: center center;
    
    /* --- Icon Sizing --- */
    --desktop-icon-container-width: 96px;
    --desktop-icon-container-height: 96px;
    --taskbar-icon-width: 24px;
    --taskbar-icon-height: 24px;
    --start-menu-tile-min-width: 80px;
    --start-menu-tile-min-height: 80px;

    /* --- Colors --- */
    --taskbar-bg: rgba(32, 32, 32, 0.9);
    --window-header-bg: rgba(238, 238, 238, 1);
    --accent-color: #0078d4; /* Windows Blue */
    --text-color: #212529;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #000;
    overflow: hidden;
    user-select: none;
    font-size: 14px;
    color: var(--text-color);
    min-height: 100vh;
}

a { text-decoration: none; color: var(--accent-color); }
a:hover { text-decoration: underline; }

/* ============================================================
   2. LOADING SCREEN
   ============================================================ */
#loading-screen {
    position: fixed; inset: 0;
    background-color: #eff6fc;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 10000; opacity: 1;
    transition: opacity 0.5s ease-out .1s;
}

.windows-logo {
    width: 50px; height: 50px;
    background-color: var(--accent-color);
    margin-bottom: 20px;
    animation: logo-spin 2s linear infinite;
}

img.loading-logo {
    max-width: 80px; max-height: 80px;
    margin-bottom: 20px; object-fit: contain;
    animation: logo-pulse 1.5s infinite ease-in-out;
}

#loading-screen p { font-size: 1.1em; color: #005a9e; margin-top: 0; }
#loading-screen p.db-error { color: #dc3545; font-size: 0.9em; margin-top: 10px; padding: 0 15px; text-align: center; }

@keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes logo-pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 1; } }

/* ============================================================
   3. DESKTOP AREA
   ============================================================ */
#desktop {
    position: absolute; top: 0; left: 0;
    width: 100%; height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    flex-wrap: wrap; align-content: flex-start; align-items: flex-start;
    gap: 10px; overflow: hidden;
    
    background-image: var(--desktop-bg);
    background-size: var(--desktop-bg-size);
    background-repeat: var(--desktop-bg-repeat);
    background-position: var(--desktop-bg-position);
    transition: background-image 0.7s ease-in-out;
}

/* --- Desktop Icons --- */
.desktop-icon {
    width: var(--desktop-icon-container-width, 96px);
    height: var(--desktop-icon-container-height, 96px);
    color: #fff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    padding: 5px; border-radius: 4px;
    text-align: center; cursor: pointer;
    display: flex; flex-direction: column;
    justify-content: flex-start; align-items: center;
    transition: background-color 0.1s ease, transform 0.1s ease;
    background-color: transparent; border: 1px solid transparent;
    overflow: hidden;
}

.desktop-icon:hover { background-color: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }
.desktop-icon:active { background-color: rgba(255, 255, 255, 0.25); transform: scale(0.97); }

.desktop-icon i, .desktop-icon img {
    font-size: min(48px, calc(var(--desktop-icon-container-height, 96px) * 0.4));
    width: calc(var(--desktop-icon-container-width, 96px) - 20px);
    max-height: calc(var(--desktop-icon-container-height, 96px) - 45px);
    margin-bottom: 5px; display: block; object-fit: contain;
}
.desktop-icon i { color: #fff; }

.desktop-icon p {
    font-size: 0.85em; margin: 0; padding-top: 2px;
    width: 100%; word-wrap: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.25;
}

.desktop-icon.category-icon i, .app-tile.category-tile i { color: #ffe187; }

/* ============================================================
   4. TASKBAR
   ============================================================ */
#taskbar {
    position: fixed; bottom: 0; left: 0;
    width: 100%; height: 40px;
    background-color: var(--taskbar-bg);
    border-top: 1px solid rgba(180, 180, 180, 0.4);
    display: flex; align-items: stretch; justify-content: space-between;
    z-index: 100; box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.15); color: #fff;
}

#start-button {
    padding: 0 12px; cursor: pointer;
    transition: background-color 0.1s ease;
    display: flex; align-items: center; justify-content: center; height: 100%;
}
#start-button:hover { background-color: rgba(255, 255, 255, 0.1); }
#start-button img { width: 20px; height: 20px; }

#taskbar-icons { display: flex; align-items: stretch; height: 100%; margin-left: 5px; }

.taskbar-icon {
    background: transparent; border: none;
    border-bottom: 3px solid transparent;
    padding: 0 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    height: 100%; min-width: 45px;
    transition: background-color 0.1s ease;
}
.taskbar-icon:hover { background-color: rgba(255, 255, 255, 0.1); }
.taskbar-icon.active { background-color: rgba(255, 255, 255, 0.2); border-bottom-color: #91c9f7; }

.taskbar-icon i, .taskbar-icon img {
    font-size: 18px;
    width: var(--taskbar-icon-width, 24px);
    height: var(--taskbar-icon-height, 24px);
    object-fit: contain; color: #f0f0f0;
}

#notification-area { display: flex; align-items: stretch; height: 100%; }

#clock {
    display: flex; align-items: center; padding: 0 10px;
    font-size: 0.85em; cursor: default; white-space: nowrap;
}

#event-ticker {
    display: none; align-items: center; padding: 0 10px;
    font-size: 0.85em; cursor: default; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 200px;
    border-left: 1px solid rgba(255, 255, 255, 0.2); margin-left: 5px;
}

.notification-icons, .notification-chevron {
    display: flex; align-items: center; padding: 0 8px;
    cursor: pointer; transition: background-color 0.1s ease;
}
.notification-icons:hover, .notification-chevron:hover { background-color: rgba(255, 255, 255, 0.1); }
#notification-area i { font-size: 15px; margin-left: 8px; color: #f0f0f0; opacity: 0.9; }

/* ============================================================
   5. START MENU (Desktop Default)
   ============================================================ */
#start-menu {
    position: fixed; bottom: 40px; left: 0;
    width: 600px; height: 65vh; max-height: 700px;
    background-color: rgba(40, 40, 40, 0.92);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    box-shadow: 3px -3px 15px rgba(0, 0, 0, 0.25);
    z-index: 101; display: flex; color: #fff;
    border-radius: 5px 5px 0 0;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease;
}
#start-menu.show { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }

.start-menu-left {
    background-color: rgba(30, 30, 30, 0.8);
    width: 240px; padding: 10px 0;
    display: flex; flex-direction: column;
    border-radius: 5px 0 0 0;
}

.user-info { display: flex; align-items: center; padding: 15px 20px; margin-bottom: 10px; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; border: 1px solid #666; }
.user-info span { font-weight: 500; }

ul.left-menu-icons, ul.power-options { list-style: none; padding: 0; margin: 0; }
ul.left-menu-icons { flex-grow: 1; overflow-y: auto; }
ul.power-options { border-top: 1px solid #555; margin-top: 10px; padding-top: 5px; }

ul.left-menu-icons li, ul.power-options li {
    padding: 9px 25px; cursor: pointer; display: flex; align-items: center;
    transition: background-color 0.1s ease;
}
ul.left-menu-icons li:hover, ul.power-options li:hover { background-color: rgba(255, 255, 255, 0.1); }
ul.left-menu-icons li i, ul.power-options li i { font-size: 17px; margin-right: 15px; color: #eee; width: 1.2em; text-align: center; }
ul.left-menu-icons li span, ul.power-options li span { font-size: 0.9em; }

.start-menu-right { flex-grow: 1; padding: 15px; overflow-y: auto; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--start-menu-tile-min-width, 80px), 1fr)); gap: 8px; }

.app-tile {
    min-height: var(--start-menu-tile-min-height, 80px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px; border-radius: 3px; cursor: pointer; text-align: center;
    background-color: var(--accent-color);
    transition: background-color 0.1s ease, transform 0.1s ease;
    overflow: hidden; color: #fff;
}
.app-tile:hover { background-color: #106ebe; transform: scale(1.03); z-index: 1; }
.app-tile:active { background-color: #005a9e; transform: scale(1); }

.app-tile i, .app-tile img {
    font-size: 26px; max-width: 60%; max-height: 50%;
    margin-bottom: 5px; object-fit: contain; color: #fff;
}
.app-tile span {
    font-size: 0.85em; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   6. WINDOW MANAGEMENT
   ============================================================ */
#window-container {
    position: absolute; top: 0; left: 0;
    width: 100%; height: calc(100% - 40px);
    z-index: 50; pointer-events: none; overflow: hidden;
}

.window {
    position: absolute; background-color: #fdfdfd;
    border: 1px solid #a0a0a0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 51; pointer-events: auto; overflow: hidden;
    transition: transform 0.15s ease, opacity 0.15s ease;
    min-width: 250px; min-height: 150px;
    display: flex; flex-direction: column; border-radius: 5px;
}
.window.active { border-color: var(--accent-color); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.window.maximized {
    border-radius: 0; border: none; box-shadow: none;
    left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
    transition: none !important;
}

.window-header {
    background-color: var(--window-header-bg); padding: 0 4px 0 10px;
    border-bottom: 1px solid #ccc;
    display: flex; justify-content: space-between; align-items: center;
    cursor: grab; height: 32px; flex-shrink: 0; user-select: none;
}
.window.active .window-header { background-color: color-mix(in srgb, var(--window-header-bg) 85%, #a0a0a0); }
.window.maximized .window-header { cursor: default; border-radius: 0; }
.window:active .window-header, .window.dragging .window-header { cursor: grabbing; }

.window-title {
    font-weight: 400; font-size: 0.9em; color: #111;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 10px;
}

.window-controls { display: flex; }
.window-controls button {
    background: transparent; border: none; padding: 0;
    width: 40px; height: 32px; line-height: 32px;
    cursor: pointer; color: #333; font-size: 16px;
    transition: background-color 0.1s ease, color 0.1s ease;
}
.window-controls button:hover { background-color: rgba(0, 0, 0, 0.1); }
.window-controls button:active { background-color: rgba(0, 0, 0, 0.2); }
.window-controls button.close-btn:hover { background-color: #e81123; color: white; }
.window-controls button.close-btn:active { background-color: #c30f1e; }

.window-content {
    padding: 10px; color: #333; background-color: #fff;
    flex-grow: 1; overflow: auto;
    border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;
}
.window.iframe-window .window-content { padding: 0; overflow: hidden; }
.window-content iframe { width: 100%; height: 100%; border: none; }

/* ============================================================
   7. CONTEXT MENU
   ============================================================ */
#context-menu {
    position: fixed; background-color: #f9f9f9;
    border: 1px solid #b0b0b0; box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.15);
    z-index: 130; padding: 4px 0; min-width: 180px; border-radius: 3px;
    display: none; font-size: 0.9em;
}
#context-menu ul { list-style: none; padding: 0; margin: 0; }
#context-menu li {
    padding: 7px 25px; cursor: pointer; color: #222;
    transition: background-color 0.1s ease, color 0.1s ease;
    white-space: nowrap;
}
#context-menu li:hover { background-color: var(--accent-color); color: white; }
#context-menu li.separator {
    height: 1px; background-color: #d0d0d0; margin: 4px 1px; padding: 0; cursor: default;
}

/* ============================================================
   8. EVENTS SIDEBAR
   ============================================================ */
#events-sidebar {
    position: fixed; top: 9px; right: 3px; bottom: 40px;
    width: 302px; background-color: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #e0e0e0; padding: 10px 0 10px 15px;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.25);
    z-index: 95; display: flex; flex-direction: column;
    overflow: hidden; border-left: 1px solid rgba(255, 255, 255, 0.1);
}
#events-sidebar h2 {
    font-size: 1.1em; color: #fff; margin: 5px 15px 15px 0;
    padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500; text-align: center;
}
#event-list-panel { flex-grow: 1; overflow-y: auto; padding-right: 10px; }
#event-list-panel::-webkit-scrollbar { width: 5px; }
#event-list-panel::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
#event-list-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }

.event-list-ul { margin-bottom: 0; padding-left: 0; }
.event-list-ul .event-item {
    padding: 10px 10px 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.07);
    margin-bottom: 8px; border-radius: 4px;
}
.event-list-ul .event-item:last-child { border-bottom: none; }
.event-list-ul .event-item-today {
    background-color: rgba(255, 0, 0, 0.34);
    border-left: 3px solid #ffc107; padding-left: 12px;
}
.event-list-ul .event-item-upcoming {
    background-color: rgba(79, 169, 161, 0.19);
    border-left: 3px solid #17a2b8; padding-left: 12px;
}
.event-list-ul .event-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.event-list-ul .event-item-title { font-weight: 500; font-size: 0.95rem; line-height: 1.3; }
.event-list-ul .event-item-date { font-size: 0.8rem; margin-bottom: 4px; color: #9eebeb; }
.event-list-ul .event-item-desc { font-size: 0.8rem; margin-top: 3px; color: #86ff85; }
.text-pink { color: #e83e8c; }

/* ============================================================
   9. CATEGORY POPUP MODAL
   ============================================================ */
#category-popup {
    display: none; position: fixed; z-index: 110; inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center; align-items: center; padding: 20px;
}
#category-popup .category-popup-content {
    background-color: #f8f9fa; width: 90%; max-width: 777px; max-height: 85vh;
    border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    display: flex; flex-direction: column;
    animation: animatetop 0.3s; position: relative;
}
@keyframes animatetop { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

#category-popup h2 {
    margin: 0; padding: 15px 20px; font-size: 1.3em; color: #333;
    border-bottom: 1px solid #ccc; background-color: #e9ecef; border-radius: 6px 6px 0 0;
}
#category-popup .category-popup-close {
    color: #888; position: absolute; top: 8px; right: 15px;
    font-size: 28px; font-weight: bold; line-height: 1; cursor: pointer;
}
#category-popup-icons {
    padding: 15px; display: flex; flex-wrap: wrap; gap: 15px; overflow-y: auto; flex-grow: 1;
}
#category-popup-icons .category-item-icon {
    width: var(--desktop-icon-container-width, 96px);
    height: var(--desktop-icon-container-height, 96px);
    color: #333; padding: 5px; border-radius: 4px;
    text-align: center; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    background-color: rgba(255, 255, 255, 0.6); border: 1px solid #ddd;
}
#category-popup-icons .category-item-icon:hover {
    background-color: rgba(0, 120, 215, 0.1); border-color: rgba(0, 120, 215, 0.4);
}
#category-popup-icons .category-item-icon img, #category-popup-icons .category-item-icon i {
    font-size: 32px; max-width: 80%; max-height: 60%; margin-bottom: 4px; object-fit: contain;
}

/* ============================================================
   10. WIDGETS
   ============================================================ */
/* Desktop Widget Styles */
#widget-sidebar {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 40;
}
.widget {
    position: absolute; pointer-events: auto;
    background-color: #f0f0f0; border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; display: flex; flex-direction: column;
    resize: both; min-width: 150px; min-height: 100px;
}
.widget-header {
    background-color: var(--window-header-bg, #eee); padding: 4px 8px;
    cursor: grab; border-bottom: 1px solid #ccc;
    font-size: 0.8em; color: #333; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; user-select: none;
    flex-shrink: 0; height: 25px; display: flex; align-items: center;
}
.widget.dragging .widget-header { cursor: grabbing; }
.widget.dragging { opacity: 0.8; }
.widget-content { flex-grow: 1; background-color: #fff; overflow: hidden; }
.widget-content iframe { display: block; border: none; }

/* Hide mobile controls by default */
.sidebar-header-mobile, #mobile-widget-toggle { display: none; }

/* ============================================================
   11. UTILITIES & APP SPECIFIC
   ============================================================ */
.hidden-field { display: none !important; }
.clicked { transform: scale(0.97); opacity: 0.8; }
.dragging { opacity: 0.6; cursor: grabbing !important; }
.default-icon { color: #aaa !important; }

/* Picture Viewer */
.picture-viewer-content {
    flex-grow: 1; display: flex; justify-content: center; align-items: center;
    overflow: hidden; background-color: #333; position: relative;
}
#picture-viewer-image { max-width: 100%; max-height: 100%; transition: opacity 0.25s ease; }
.picture-viewer-controls {
    position: absolute; bottom: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 15px 20px; display: flex; justify-content: space-between; opacity: 0.8;
}
.picture-nav-button {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    color: #fff; padding: 8px 15px; border-radius: 50%;
    cursor: pointer; width: 40px; height: 40px;
}
.picture-nav-button:hover:not(:disabled) { background: rgba(255,255,255,0.3); }

/* ============================================================
   12. MOBILE RESPONSIVE & LOGIN STYLES (PRO VERSION)
   ============================================================ */

/* --- A. Login Page Styles (Desktop & Mobile) --- */
body.login-body {
    background: url('../images/default-background.jpg') center/cover no-repeat fixed;
    height: 100vh; display: flex; justify-content: center; align-items: center;
    position: relative;
}
#lock-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding-bottom: 10vh; padding-left: 5vw;
    color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 20; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}
#lock-time { font-size: 6rem; font-weight: 200; line-height: 1; letter-spacing: -2px; }
#lock-date { font-size: 2rem; margin-top: 5px; font-weight: 300; opacity: 0.9; }

#login-container {
    display: flex; flex-direction: column; align-items: center;
    color: #fff; width: 320px; opacity: 0; transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s; z-index: 10;
}
#bg-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(0px); transition: backdrop-filter 0.6s ease;
    z-index: 1; pointer-events: none;
}

/* User Avatar & Input */
.user-avatar { 
    width: 140px; height: 140px; border-radius: 50%; 
    background: rgba(255,255,255,0.1); margin-bottom: 20px; 
    overflow: hidden; border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 2rem; margin-bottom: 25px; font-weight: 300; letter-spacing: 1px; }

.input-group { position: relative; width: 100%; display: flex; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.login-input { 
    width: 100%; padding: 12px 50px 12px 15px; 
    background: rgba(255,255,255,0.9); border: 2px solid transparent; 
    outline: none; font-size: 1rem; border-radius: 2px;
    transition: background 0.2s; 
}
.login-input:focus { background: #fff; border-color: var(--accent-color); }
.submit-btn { 
    position: absolute; right: 2px; top: 2px; bottom: 2px; width: 46px; 
    background: var(--accent-color); border: none; color: #fff; 
    cursor: pointer; font-size: 1.2rem; border-radius: 0 2px 2px 0;
    transition: background 0.2s;
}
.submit-btn:hover { background: #005a9e; }

.lock-icons { position: absolute; bottom: 30px; right: 30px; color: #fff; font-size: 1.8rem; z-index: 21; }
.lock-icons i { margin-left: 20px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
.lock-icons i:hover { opacity: 1; text-shadow: 0 0 10px rgba(255,255,255,0.5); }


/* --- B. Mobile Responsive (Glassmorphism Sidebar & Tablet Mode) --- */
@media (max-width: 768px) {
    
    /* 1. Mobile Taskbar Button */
    #mobile-widget-toggle {
        display: flex; align-items: center; padding: 0 15px;
        cursor: pointer; height: 100%; font-size: 1.2em;
        border-left: 1px solid rgba(255,255,255,0.1);
        transition: background 0.2s;
    }
    #mobile-widget-toggle:active { background: rgba(255,255,255,0.2); }

    /* 2. Widget Sidebar (Pro Style) - Fade In/Out */
    #widget-sidebar {
        position: fixed; top: 0; right: 0; bottom: 40px;
        width: 100%; max-width: 400px; height: auto;
        
        background-color: rgba(20, 20, 20, 0.95);
        backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
        box-shadow: -10px 0 40px rgba(0,0,0,0.5);
        border-left: 1px solid rgba(255,255,255,0.1);
        
        opacity: 0; visibility: hidden; transform: scale(0.98);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        
        z-index: 9999; overflow-y: auto; pointer-events: none;
        display: flex; flex-direction: column; padding: 20px 15px; gap: 20px;
    }
    #widget-sidebar.open { opacity: 1; visibility: visible; transform: scale(1); pointer-events: auto; }

    /* Header Sidebar */
    .sidebar-header-mobile {
        display: flex; justify-content: space-between; align-items: center;
        padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.15);
        color: #fff; margin-bottom: 10px;
    }
    .sidebar-header-mobile h3 { margin: 0; font-size: 1.3em; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
    #close-widgets-btn { 
        background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
        width: 40px; height: 40px; color: #fff; font-size: 1.2em; display: flex; justify-content: center; align-items: center; transition: background 0.2s;
    }
    #close-widgets-btn:active { background: rgba(255,255,255,0.3); }

    /* Widget Card Style */
    #widget-sidebar .widget {
        position: relative !important; top: auto !important; left: auto !important;
        width: 100% !important; height: auto !important; min-height: auto !important;
        margin: 0; flex-shrink: 0;
        
        background-color: rgba(255, 255, 255, 0.07);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); overflow: hidden;
    }
    
    #widget-sidebar .widget-header {
        background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 10px 15px; color: #ccc; font-size: 0.8em; font-weight: 600; text-transform: uppercase; cursor: default;
    }
    
    #widget-sidebar .widget-content { background: transparent; padding: 0; height: auto !important; }
    
    /* Fix Aspect Ratio for Iframe/Youtube */
    #widget-sidebar .widget-content iframe {
        width: 100%; aspect-ratio: 16/9; display: block; border: none;
    }
    /* Add padding back for custom html */
    #widget-sidebar .widget-custom_html .widget-content { padding: 15px; }

    /* 3. Start Menu Tablet Mode */
    #start-menu {
        width: 100% !important; height: calc(100% - 40px) !important;
        max-height: none !important; bottom: 40px !important; left: 0 !important;
        border-radius: 0; 
        background-color: rgba(20, 20, 20, 0.9);
        backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
        display: flex; flex-direction: row;
        transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
        transform: translateY(100%);
    }
    #start-menu.show { transform: translateY(0); }

    .start-menu-left {
        width: 60px; background: rgba(255,255,255,0.03); 
        align-items: center; padding-top: 20px; flex-shrink: 0; 
        border-right: 1px solid rgba(255,255,255,0.05);
    }
    .start-menu-left ul li span, .start-menu-left .user-info span { display: none; }
    
    .user-info { padding: 0; justify-content: center; margin-bottom: 30px; }
    .user-info img { width: 36px; height: 36px; margin: 0; border: 2px solid rgba(255,255,255,0.3); }
    
    ul.left-menu-icons li, ul.power-options li { padding: 18px 0; justify-content: center; width: 100%; }
    ul.left-menu-icons li i, ul.power-options li i { margin: 0; font-size: 1.3em; opacity: 0.8; }
    ul.power-options { margin-top: auto; border-top: none; padding-bottom: 30px; }

    .start-menu-right { padding: 20px 15px; width: 100%; overflow-y: auto; }
    .apps-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 40px; }
    
    .app-tile { 
        min-height: 100px; border-radius: 8px; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        background-color: var(--accent-color);
    }
    .app-tile span { font-size: 0.85em; margin-top: 8px; font-weight: 500; }
    .app-tile i, .app-tile img { font-size: 32px; }
    
    .app-tile.category-tile { 
        background-color: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    /* Lock screen time adjustments for mobile */
    #lock-time { font-size: 4.5rem; }
    #lock-date { font-size: 1.5rem; }
}

@media (max-width: 360px) {
    .apps-grid { grid-template-columns: repeat(2, 1fr); }
    #widget-sidebar { width: 100%; max-width: none; }
}