/**
 * EasyDesktop - Taskbar Styles
 * 
 * @author Alberto Luque Rivas
 * @version 1.0.0
 */

/* ============================================
   Taskbar Container
   ============================================ */
#easydesktop-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--ed-taskbar-height);
    background: var(--ed-taskbar-bg);
    backdrop-filter: var(--ed-taskbar-blur);
    -webkit-backdrop-filter: var(--ed-taskbar-blur);
    border-top: 1px solid var(--ed-border-color);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: var(--ed-z-taskbar);
    pointer-events: auto;
    transition: transform var(--ed-transition-normal);
}

#easydesktop-taskbar.taskbar-hidden {
    transform: translateY(100%);
}

/* ============================================
   Taskbar Sections
   ============================================ */
#taskbar-start {
    flex-shrink: 0;
    margin-right: 8px;
}

#taskbar-search {
    flex-shrink: 0;
    margin-right: 12px;
}

#taskbar-windows {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    margin: 0 8px;
}

#taskbar-windows::-webkit-scrollbar {
    height: 4px;
}

#taskbar-tray {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.taskbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    flex-shrink: 0;
}

#taskbar-widgets {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   Taskbar Buttons Base
   ============================================ */
.taskbar-btn,
.taskbar-widget-btn,
#taskbar-start-btn,
#taskbar-search-btn,
#taskbar-lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--ed-text-primary);
    cursor: pointer;
    transition: background-color var(--ed-transition-fast);
    font-size: 16px;
}

.taskbar-btn:hover,
.taskbar-widget-btn:hover,
#taskbar-start-btn:hover,
#taskbar-search-btn:hover,
#taskbar-lock-btn:hover {
    background: var(--ed-bg-hover);
}

.taskbar-btn:active,
.taskbar-widget-btn:active,
#taskbar-start-btn:active,
#taskbar-search-btn:active,
#taskbar-lock-btn:active {
    background: var(--ed-bg-active);
}

/* Start Button */
#taskbar-start-btn {
    width: 48px;
    height: 40px;
    font-size: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

#taskbar-start-btn::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--ed-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.2s ease;
}

#taskbar-start-btn:hover::before {
    width: 20px;
}

#taskbar-start-btn.active {
    background: var(--ed-bg-active);
}

#taskbar-start-btn.active::before {
    width: 24px;
    background: var(--ed-primary);
}

#taskbar-start-btn i {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#taskbar-start-btn:hover i {
    transform: scale(1.1);
}

#taskbar-start-btn.active i {
    transform: scale(1.15) rotate(180deg);
}

/* ============================================
   Window Buttons in Taskbar
   ============================================ */
.taskbar-window-btn {
    display: flex;
    align-items: center;
    height: 40px;
    min-width: 160px;
    max-width: 200px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    background: var(--ed-bg-hover);
    color: var(--ed-text-primary);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
    gap: 8px;
    overflow: hidden;
}

.taskbar-window-btn:hover {
    background: var(--ed-bg-active);
}

.taskbar-window-btn.active {
    background: var(--ed-primary);
    color: white;
}

.taskbar-window-btn.minimized {
    opacity: 0.7;
}

.taskbar-window-btn .window-icon {
    flex-shrink: 0;
    font-size: 16px;
}

.taskbar-window-btn .window-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    text-align: left;
}

.taskbar-window-btn .window-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 10px;
    opacity: 0;
    transition: opacity var(--ed-transition-fast);
}

.taskbar-window-btn:hover .window-close {
    opacity: 1;
}

.taskbar-window-btn .window-close:hover {
    background: var(--ed-danger);
    color: white;
}

/* ============================================
   Drag and Drop for Window Buttons
   ============================================ */
.taskbar-window-btn.taskbar-dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.taskbar-window-btn.taskbar-placeholder {
    background: var(--ed-border-color);
    border: 2px dashed var(--ed-primary);
    opacity: 0.5;
}

.taskbar-window-btn:not(.taskbar-dragging):not(.taskbar-placeholder) {
    cursor: grab;
}

.taskbar-window-btn.taskbar-dragging * {
    pointer-events: none;
}

/* ============================================
   System Tray
   ============================================ */
#taskbar-clock {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--ed-text-primary);
    cursor: default;
    user-select: none;
    border-radius: 4px;
    transition: background-color var(--ed-transition-fast);
}

#taskbar-clock:hover {
    background: var(--ed-bg-hover);
}

/* ============================================
   Start Menu (Windows 11 Premium Style)
   ============================================ */
#easydesktop-startmenu {
    position: fixed;
    bottom: calc(var(--ed-taskbar-height) + 12px);
    left: 12px;
    width: 640px;
    max-width: calc(100vw - 32px);
    max-height: min(740px, calc(100vh - var(--ed-taskbar-height) - 40px));
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.85) 100%
    );
    border-radius: 16px;
    box-shadow: 
        0 32px 64px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 80px -20px rgba(0, 120, 212, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: var(--ed-z-startmenu);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    
    /* Animation */
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: 
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        visibility 0.2s ease;
}

/* Dark theme */
.easydesktop-dark #easydesktop-startmenu,
[data-ed-theme="dark"] #easydesktop-startmenu {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 45, 0.95) 0%,
        rgba(30, 30, 35, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 32px 64px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 80px -20px rgba(0, 120, 212, 0.2);
}

/* Visible state */
#easydesktop-startmenu:not(.easydesktop-hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Start Menu Search (Top Section)
   ============================================ */
#startmenu-search {
    padding: 28px 32px 20px 32px;
    position: relative;
}

#startmenu-search::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ed-border-color), transparent);
}

#startmenu-search-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    border: 2px solid transparent;
    border-radius: 28px;
    background: var(--ed-bg-secondary);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

#startmenu-search-wrapper:hover {
    background: var(--ed-bg-tertiary);
}

#startmenu-search-wrapper:focus-within {
    border-color: var(--ed-primary);
    background: var(--ed-bg-primary);
    box-shadow: 
        0 0 0 4px rgba(0, 120, 212, 0.1),
        0 4px 16px rgba(0, 120, 212, 0.1);
}

#startmenu-search-wrapper i {
    color: var(--ed-text-muted);
    font-size: 16px;
    transition: color 0.2s ease;
}

#startmenu-search-wrapper:focus-within i {
    color: var(--ed-primary);
}

#startmenu-search-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--ed-text-primary);
    font-size: 15px;
    font-weight: 400;
    outline: none;
}

#startmenu-search-input::placeholder {
    color: var(--ed-text-muted);
}

/* ============================================
   Start Menu Apps Container
   ============================================ */
#startmenu-apps {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 32px 24px 32px;
    scroll-behavior: smooth;
}

#startmenu-apps::-webkit-scrollbar {
    width: 6px;
}

#startmenu-apps::-webkit-scrollbar-track {
    background: transparent;
}

#startmenu-apps::-webkit-scrollbar-thumb {
    background: var(--ed-border-color);
    border-radius: 3px;
}

#startmenu-apps::-webkit-scrollbar-thumb:hover {
    background: var(--ed-text-muted);
}

/* ============================================
   Start Menu Sections
   ============================================ */
.startmenu-section {
    margin-bottom: 28px;
    animation: ed-fade-slide-up 0.3s ease backwards;
}

.startmenu-section:nth-child(1) { animation-delay: 0.05s; }
.startmenu-section:nth-child(2) { animation-delay: 0.1s; }
.startmenu-section:nth-child(3) { animation-delay: 0.15s; }

.startmenu-section:last-child {
    margin-bottom: 0;
}

.startmenu-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.startmenu-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--ed-text-primary);
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.startmenu-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: var(--ed-bg-secondary);
    color: var(--ed-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.startmenu-more-btn:hover {
    background: var(--ed-primary);
    color: white;
    transform: translateX(2px);
}

.startmenu-more-btn i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.startmenu-more-btn:hover i {
    transform: translateX(3px);
}

/* ============================================
   Quick Actions Grid (Pinned Apps)
   ============================================ */
.startmenu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.startmenu-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.startmenu-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px 12px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    min-width: 0;
    position: relative;
    background: transparent;
}

.startmenu-app::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--ed-bg-hover);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.startmenu-app:hover::before {
    opacity: 1;
}

.startmenu-app:hover {
    transform: translateY(-4px) scale(1.02);
}

.startmenu-app:active {
    transform: translateY(-2px) scale(0.98);
}

.startmenu-app:active::before {
    background: var(--ed-bg-active);
}

.startmenu-app-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-bottom: 10px;
    font-size: 24px;
    color: white;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 1;
}

.startmenu-app:hover .startmenu-app-icon {
    transform: scale(1.1);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

.startmenu-app-label {
    position: relative;
    font-size: 12px;
    font-weight: 500;
    color: var(--ed-text-primary);
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    z-index: 1;
}

/* ============================================
   Applications List Style (Recommended)
   ============================================ */
.startmenu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.startmenu-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.startmenu-list-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ed-bg-hover);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.startmenu-list-item:hover::before {
    opacity: 1;
}

.startmenu-list-item:hover {
    transform: translateX(4px);
}

.startmenu-list-item:active::before {
    background: var(--ed-bg-active);
}

.startmenu-list-item .startmenu-app-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    font-size: 18px;
    border-radius: 10px;
    flex-shrink: 0;
}

.startmenu-list-item .startmenu-app-label {
    flex: 1;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    -webkit-line-clamp: 1;
}

.startmenu-list-item .startmenu-app-desc {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--ed-text-muted);
}

/* ============================================
   Start Menu Footer
   ============================================ */
#startmenu-footer {
    padding: 16px 24px;
    background: linear-gradient(to top, var(--ed-bg-secondary) 0%, transparent 100%);
    border-top: 1px solid var(--ed-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

#startmenu-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ed-border-color), transparent);
}

#startmenu-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#startmenu-user::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ed-bg-hover);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#startmenu-user:hover::before {
    opacity: 1;
}

#startmenu-user:hover {
    transform: translateX(4px);
}

#startmenu-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#startmenu-avatar.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

#startmenu-avatar img,
#startmenu-avatar .user-avatar-img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid var(--ed-bg-primary) !important;
}

#startmenu-avatar.user-avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ed-primary) 0%, var(--ed-primary-hover) 100%);
}

#startmenu-avatar.user-avatar-icon i {
    font-size: 20px;
    color: white;
}

#startmenu-username {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--ed-text-primary);
}

#startmenu-footer-actions {
    display: flex;
    gap: 6px;
}

#startmenu-footer-actions button,
#startmenu-footer button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ed-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#startmenu-footer-actions button::before,
#startmenu-footer button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ed-bg-hover);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#startmenu-footer-actions button:hover::before,
#startmenu-footer button:hover::before {
    opacity: 1;
}

#startmenu-footer-actions button:hover,
#startmenu-footer button:hover {
    color: var(--ed-primary);
    transform: translateY(-2px);
}

#startmenu-footer-actions button i,
#startmenu-footer button i {
    position: relative;
    z-index: 1;
}

/* Power button special styling */
#startmenu-toggle-desktop:hover {
    color: var(--ed-danger);
}

/* ============================================
   All Apps View (Expanded)
   ============================================ */
#easydesktop-startmenu.all-apps-view #startmenu-pinned-section {
    display: none;
}

#easydesktop-startmenu.all-apps-view #startmenu-apps-section {
    flex: 1;
}

#easydesktop-startmenu.all-apps-view .startmenu-more-btn i {
    transform: rotate(180deg);
}

/* ============================================
   Animations
   ============================================ */
@keyframes ed-fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ed-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* App icons staggered animation */
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app {
    animation: ed-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(1) { animation-delay: 0.02s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(2) { animation-delay: 0.04s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(3) { animation-delay: 0.06s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(4) { animation-delay: 0.08s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(5) { animation-delay: 0.1s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-app:nth-child(6) { animation-delay: 0.12s; }

#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item {
    animation: ed-fade-slide-up 0.25s ease backwards;
}

#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item:nth-child(1) { animation-delay: 0.05s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item:nth-child(2) { animation-delay: 0.08s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item:nth-child(3) { animation-delay: 0.11s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item:nth-child(4) { animation-delay: 0.14s; }
#easydesktop-startmenu:not(.easydesktop-hidden) .startmenu-list-item:nth-child(5) { animation-delay: 0.17s; }

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 680px) {
    #easydesktop-startmenu {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(20px) scale(0.95);
        border-radius: 12px;
    }
    
    #easydesktop-startmenu:not(.easydesktop-hidden) {
        transform: translateX(0) translateY(0) scale(1);
    }
    
    #startmenu-search,
    #startmenu-apps {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .startmenu-grid-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .startmenu-app-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}

/* ============================================
   Show Desktop Button
   ============================================ */
#taskbar-show-desktop {
    min-width: 40px;
    padding: 0 8px;
    margin-left: 4px;
    color: var(--ed-text-secondary);
}

#taskbar-show-desktop:hover {
    color: var(--ed-text-primary);
    background: var(--ed-bg-hover);
}

#taskbar-show-desktop i {
    font-size: 16px;
}

/* ============================================
   Clock Area (Clickable for Calendar)
   ============================================ */
#taskbar-clock-area {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--ed-transition-fast);
}

#taskbar-clock-area:hover {
    background: var(--ed-bg-hover);
}

/* ============================================
   Notifications Button
   ============================================ */
#taskbar-notifications-btn {
    position: relative;
    cursor: pointer;
}

#taskbar-notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--ed-danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Calendar Popup
   ============================================ */
#easydesktop-calendar-popup {
    position: fixed;
    bottom: calc(var(--ed-taskbar-height) + 12px);
    right: 12px;
    width: 360px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.85) 100%
    );
    border-radius: 16px;
    box-shadow: 
        0 24px 48px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: var(--ed-z-startmenu);
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    
    /* Animation */
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: 
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.easydesktop-dark #easydesktop-calendar-popup,
[data-ed-theme="dark"] #easydesktop-calendar-popup {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 45, 0.95) 0%,
        rgba(30, 30, 35, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
}

#easydesktop-calendar-popup:not(.easydesktop-hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

#calendar-popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ed-border-color);
}

#calendar-current-date {
    font-size: 24px;
    font-weight: 300;
    color: var(--ed-text-primary);
    margin-bottom: 12px;
}

#calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#calendar-nav button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ed-text-secondary);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
}

#calendar-nav button:hover {
    background: var(--ed-bg-hover);
    color: var(--ed-text-primary);
}

#calendar-month-year {
    font-size: 14px;
    font-weight: 500;
    color: var(--ed-text-primary);
}

#calendar-grid {
    padding: 16px 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    font-size: 11px;
    font-weight: 600;
    color: var(--ed-text-muted);
    text-transform: uppercase;
}

#calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    color: var(--ed-text-primary);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
    margin: 2px auto;
}

.calendar-day:hover {
    background: var(--ed-bg-hover);
}

.calendar-day.other-month {
    color: var(--ed-text-muted);
}

.calendar-day.today {
    background: var(--ed-primary);
    color: white;
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--ed-bg-hover);
    box-shadow: 0 0 0 2px var(--ed-primary);
}

.calendar-day.selected.today {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.calendar-day.has-events {
    position: relative;
}

.calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ed-primary);
}

.calendar-day.today.has-events::after {
    background: white;
}

#calendar-events {
    border-top: 1px solid var(--ed-border-color);
    max-height: 200px;
    overflow-y: auto;
}

#calendar-events-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ed-text-secondary);
    background: var(--ed-bg-secondary);
}

#calendar-events-list {
    padding: 8px 12px;
    max-height: 250px;
    overflow-y: auto;
}

#calendar-events-list::-webkit-scrollbar {
    width: 6px;
}

#calendar-events-list::-webkit-scrollbar-track {
    background: transparent;
}

#calendar-events-list::-webkit-scrollbar-thumb {
    background: var(--ed-border-color);
    border-radius: 3px;
}

.calendar-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--ed-transition-fast);
    margin-bottom: 6px;
    background: var(--ed-bg-secondary);
    border: 1px solid transparent;
}

.calendar-event-item:last-child {
    margin-bottom: 0;
}

.calendar-event-item:hover {
    background: var(--ed-bg-hover);
    border-color: var(--ed-border-color);
    transform: translateX(4px);
}

.calendar-event-item.completed {
    opacity: 0.6;
}

.calendar-event-item.completed .calendar-event-title {
    text-decoration: line-through;
}

.calendar-event-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.calendar-event-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.calendar-event-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ed-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.calendar-event-subtitle {
    font-size: 11px;
    color: var(--ed-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.calendar-event-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--ed-text-secondary);
    background: var(--ed-bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.calendar-event-time i {
    font-size: 10px;
    opacity: 0.5;
}

.calendar-events-empty,
.calendar-events-loading {
    padding: 24px;
    text-align: center;
    color: var(--ed-text-muted);
    font-size: 13px;
}

/* ============================================
   Notifications Center
   ============================================ */
#easydesktop-notifications {
    position: fixed;
    bottom: calc(var(--ed-taskbar-height) + 12px);
    right: 12px;
    width: 380px;
    max-height: 500px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.85) 100%
    );
    border-radius: 16px;
    box-shadow: 
        0 24px 48px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: var(--ed-z-startmenu);
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    display: flex;
    flex-direction: column;
    
    /* Animation */
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: 
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.easydesktop-dark #easydesktop-notifications,
[data-ed-theme="dark"] #easydesktop-notifications {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 45, 0.95) 0%,
        rgba(30, 30, 35, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
}

#easydesktop-notifications:not(.easydesktop-hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Statistics Widget (Static)
   ============================================ */
#easydesktop-stats {
    position: fixed;
    bottom: calc(var(--ed-taskbar-height) + 12px);
    right: 12px;
    width: 600px;
    max-height: 500px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.85) 100%
    );
    border-radius: 16px;
    box-shadow: 
        0 24px 48px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: var(--ed-z-startmenu);
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    display: flex;
    flex-direction: column;
    
    /* Animation */
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: 
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.easydesktop-dark #easydesktop-stats,
[data-ed-theme="dark"] #easydesktop-stats {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 45, 0.95) 0%,
        rgba(30, 30, 35, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.08);
}

#easydesktop-stats:not(.easydesktop-hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

#stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ed-border-color);
    background: var(--ed-bg-secondary);
}

#stats-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ed-text-primary);
}

#stats-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ed-text-muted);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
}

#stats-header button:hover {
    background: var(--ed-bg-hover);
    color: var(--ed-text-primary);
}

#stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

#notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ed-border-color);
    background: var(--ed-bg-secondary);
}

#notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ed-text-primary);
}

#notifications-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--ed-text-muted);
    cursor: pointer;
    transition: all var(--ed-transition-fast);
}

#notifications-header button:hover {
    background: var(--ed-bg-hover);
    color: var(--ed-danger);
}

#notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--ed-transition-fast);
    margin-bottom: 4px;
}

.notification-item:hover {
    background: var(--ed-bg-hover);
}

.notification-item.unread {
    background: rgba(0, 120, 212, 0.08);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ed-text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 12px;
    color: var(--ed-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 11px;
    color: var(--ed-text-muted);
    margin-top: 4px;
}

.notifications-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--ed-text-muted);
}

.notifications-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    #easydesktop-startmenu {
        left: 12px;
        right: 12px;
        width: auto;
        max-height: 70vh;
        /* Override animation transforms for mobile */
        transform: translateY(20px) scale(0.95);
    }
    
    #easydesktop-startmenu:not(.easydesktop-hidden) {
        transform: translateY(0) scale(1);
    }
    
    .startmenu-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .startmenu-grid-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .taskbar-window-btn {
        min-width: 44px;
        max-width: 44px;
        padding: 0;
        justify-content: center;
    }
    
    .taskbar-window-btn .window-title,
    .taskbar-window-btn .window-close {
        display: none;
    }

    #easydesktop-calendar-popup,
    #easydesktop-notifications {
        left: 8px;
        right: 8px;
        width: auto;
    }
}
/* ============================================
   All Apps View - Categories
   ============================================ */
#startmenu-all-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#startmenu-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--ed-text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--ed-border-color);
    transition: background-color var(--ed-transition-fast);
}

#startmenu-back-btn:hover {
    background: var(--ed-hover-bg);
}

#startmenu-back-btn i {
    font-size: 16px;
}

#startmenu-categories {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

#startmenu-categories::-webkit-scrollbar {
    width: 8px;
}

#startmenu-categories::-webkit-scrollbar-track {
    background: transparent;
}

#startmenu-categories::-webkit-scrollbar-thumb {
    background: var(--ed-border-color);
    border-radius: 4px;
}

#startmenu-categories::-webkit-scrollbar-thumb:hover {
    background: var(--ed-text-muted);
}

.startmenu-category {
    margin-bottom: 28px;
}

.startmenu-category:last-child {
    margin-bottom: 0;
}

.startmenu-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ed-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.startmenu-category-header i {
    font-size: 14px;
    opacity: 0.7;
}

.startmenu-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Responsive grids for categories */
@media (max-width: 768px) {
    .startmenu-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Start Menu Bookmarks Section
   ============================================ */
.startmenu-bookmarks {
    margin-top: 16px;
}

.startmenu-bookmarks .startmenu-section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.startmenu-bookmarks .startmenu-section-header h4 i {
    color: #FFB300;
}

.startmenu-bookmark {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.startmenu-bookmark-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.startmenu-bookmark-url {
    font-size: 11px;
    color: var(--ed-text-muted);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.startmenu-bookmarks-loading {
    padding: 20px;
    text-align: center;
    color: var(--ed-text-muted);
}

.startmenu-empty {
    padding: 20px;
    text-align: center;
    color: var(--ed-text-muted);
    font-size: 13px;
}

/* ============================================
   Taskbar Context Menu
   ============================================ */
#taskbar-context-menu {
    position: fixed;
    z-index: 9999999;
    min-width: 220px;
    background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 100%);
    border: 1px solid rgba(241, 196, 15, 0.3);
    border-radius: 10px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 8px 0;
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#taskbar-context-menu.visible {
    display: block;
    animation: contextMenuFadeIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.taskbar-context-menu-header {
    padding: 10px 16px 8px;
    color: #f1c40f;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.taskbar-context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    margin: 2px 6px;
    border-radius: 6px;
}

.taskbar-context-menu-item:hover {
    background: linear-gradient(135deg, #f1c40f 0%, #e8b709 100%);
    color: #111;
    transform: translateX(3px);
}

.taskbar-context-menu-item:hover i {
    color: #111 !important;
}

.taskbar-context-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #f1c40f;
    transition: color 0.15s ease;
}

.taskbar-context-menu-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 8px 12px;
}
