/* ===================================
   DevOS Portfolio - Modern OS Interface
   =================================== */

:root {
    /* Windows 7 Inspired Colors */
    --primary: #3399ff;
    --secondary: #0078d7;
    --accent: #ffb900;
    --success: #00cc6a;
    --bg-primary: #1a1d29;
    --bg-secondary: #252837;
    --bg-tertiary: #2d3142;
    --text-primary: #ffffff;
    --text-secondary: #b8c1db;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: rgba(0, 0, 0, 0.5);
    --windows-blue: #0078d7;
    --windows-hover: #1e90ff;
    
    /* Spacing */
    --taskbar-height: 40px;
    --window-header-height: 32px;
    --border-radius: 8px;
    --gap: 16px;
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    user-select: none;
    width: 100vw;
    height: 100vh;
}

/* ===================================
   Boot Screen
   =================================== */

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        #0078d7 0%, 
        #0066cc 30%,
        #0052a3 60%,
        #004080 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.boot-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.boot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 100px;
}

.boot-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: lightSweep 8s ease-in-out infinite alternate;
}

.boot-screen.active {
    opacity: 1;
    visibility: visible;
}

.desktop {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.desktop.loaded {
    opacity: 1;
}

.boot-logo {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

.logo-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.logo-profile-pic {
    width: 128px;
    height: 128px;
    margin: 0 auto 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.logo-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.boot-logo h1 {
    font-size: 24px;
    font-weight: 400;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.version {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.boot-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    margin: 2rem 0;
}

.windows-busy-cursor {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.boot-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.boot-windows-logo {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
    z-index: 1;
}

.windows-flag {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: 
        linear-gradient(to right, #00A1F1 0%, #00A1F1 49%, #7CBB00 49%, #7CBB00 100%),
        linear-gradient(to right, #F65314 0%, #F65314 49%, #FFBB00 49%, #FFBB00 100%);
    background-size: 100% 50%;
    background-position: 0 0, 0 50%;
    background-repeat: no-repeat;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    overflow: hidden;
}

.windows-flag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0%, transparent 30%),
        linear-gradient(to right, transparent 49%, rgba(0, 0, 0, 0.1) 49.5%, rgba(0, 0, 0, 0.1) 50.5%, transparent 51%);
    pointer-events: none;
}

.windows-flag::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-50%);
    pointer-events: none;
}

.windows-text {
    font-size: 24px;
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.windows-version {
    font-size: 11px;
    opacity: 0.9;
    margin-left: 4px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}


/* ===================================
   Desktop Environment
   =================================== */

.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(13, 17, 23, 0.4) 0%, rgba(26, 29, 41, 0.3) 50%, rgba(13, 17, 23, 0.4) 100%),
        url('../assets/background.jpg') center center / cover no-repeat;
    z-index: 0;
    filter: blur(0.5px);
}

.wallpaper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(0, 120, 215, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(51, 153, 255, 0.1) 0%, transparent 50%);
    animation: auroraShift 25s ease-in-out infinite alternate;
}

.wallpaper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

@keyframes auroraShift {
    0% { 
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }
    100% { 
        opacity: 0.8;
        transform: scale(1.1) rotate(5deg);
    }
}

@keyframes lightSweep {
    0%, 100% { 
        opacity: 0.3;
    }
    50% { 
        opacity: 0.6;
    }
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ===================================
   Desktop Icons
   =================================== */

.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: row;
    gap: 16px 20px;
    z-index: 10;
    /* Prevent desktop icons from interfering with windows */
    width: auto;
    max-width: 280px;
    overflow: visible;
    align-items: start;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 90px;
    user-select: none;
    position: relative;
    background: transparent;
    border: 2px solid transparent;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(100, 181, 246, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.desktop-icon:active {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(100, 181, 246, 0.6);
    transform: translateY(0);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.desktop-icon.selected {
    background: rgba(74, 158, 255, 0.25);
    border: 1px solid rgba(74, 158, 255, 0.6);
    box-shadow: 
        0 0 0 1px rgba(74, 158, 255, 0.4),
        0 2px 8px rgba(74, 158, 255, 0.3);
}

.desktop-icon.selected .icon {
    transform: scale(1.05);
}

.desktop-icon.selected span {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.desktop-icon .icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Selection Box (Rubber Band) */
.selection-box {
    position: fixed;
    border: 1px solid rgba(51, 153, 255, 0.8);
    background: rgba(51, 153, 255, 0.2);
    pointer-events: none;
    z-index: 999;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 10px rgba(51, 153, 255, 0.4);
}

.desktop-icon span {
    font-size: 0.75rem;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

/* Recycle Bin Icon Styling - Windows 7 Style */
.recycle-bin-icon {
    position: relative;
    font-size: 0;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

/* Recycle Symbol - Add recycling arrows */
.recycle-bin-icon::before {
    content: '♻';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    color: #0066cc;
    opacity: 0.85;
    z-index: 3;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.5),
        0 -1px 1px rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

#recycleBinIcon .icon {
    background-image: 
        linear-gradient(to right, 
            rgba(255, 255, 255, 0.3) 0%,
            transparent 20%),
        linear-gradient(to bottom,
            rgba(220, 220, 220, 0.95) 0%,
            rgba(200, 200, 200, 0.95) 20%,
            rgba(180, 180, 180, 0.95) 50%,
            rgba(160, 160, 160, 0.95) 80%,
            rgba(140, 140, 140, 0.95) 100%);
    border-radius: 8px 8px 4px 4px;
    padding: 0;
    position: relative;
    width: 50px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        inset -2px 0 2px rgba(0, 0, 0, 0.2),
        inset 2px 0 2px rgba(255, 255, 255, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#recycleBinIcon .icon::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 6px;
    background: linear-gradient(to bottom,
        rgba(200, 200, 200, 0.95) 0%,
        rgba(180, 180, 180, 0.95) 50%,
        rgba(160, 160, 160, 0.95) 100%);
    border-radius: 3px;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

#recycleBinIcon .icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 8px;
    background: linear-gradient(to bottom,
        rgba(240, 240, 240, 0.98) 0%,
        rgba(220, 220, 220, 0.98) 30%,
        rgba(200, 200, 200, 0.98) 60%,
        rgba(180, 180, 180, 0.98) 100%);
    border-radius: 6px 6px 2px 2px;
    box-shadow: 
        inset 0 2px 3px rgba(255, 255, 255, 0.7),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2),
        0 2px 5px rgba(0, 0, 0, 0.4),
        0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* ===================================
   Windows
   =================================== */

.windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--taskbar-height));
    z-index: 100;
    pointer-events: none;
}

.window {
    position: absolute;
    background: linear-gradient(to bottom,
        rgba(248, 252, 255, 0.35) 0%,
        rgba(240, 248, 255, 0.3) 50%,
        rgba(232, 244, 255, 0.25) 100%);
    backdrop-filter: blur(12px) saturate(200%);
    -webkit-backdrop-filter: blur(12px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 0;
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 0 30px rgba(100, 181, 246, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    min-width: 300px;
    min-height: 200px;
    max-width: 100vw;
    max-height: 100vh;
    box-sizing: border-box;
}

.window:hover {
    box-shadow: 
        0 16px 64px rgba(0, 0, 0, 0.6),
        0 6px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 0 40px rgba(100, 181, 246, 0.3);
}

.window.minimized {
    display: none !important;
    pointer-events: none;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - var(--taskbar-height)) !important;
    border-radius: 0;
}

.window-header {
    height: 32px;
    background: linear-gradient(to bottom,
        rgba(240, 248, 255, 0.4) 0%,
        rgba(230, 240, 255, 0.3) 50%,
        rgba(220, 232, 255, 0.2) 100%);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    cursor: move;
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 15px rgba(100, 181, 246, 0.15);
    position: relative;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.window-title-icon {
    font-size: 1.2rem;
}

.window-controls {
    display: flex;
    gap: 1px;
}

.window-btn {
    width: 46px;
    height: 29px;
    border: none;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 30%,
        rgba(220, 220, 220, 0.3) 70%,
        rgba(200, 200, 200, 0.4) 100%);
    color: #1a1a1a;
    font-size: 12px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-weight: 600;
    line-height: 1;
    margin: 0;
    border: 1px solid rgba(150, 150, 150, 0.4);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 1px rgba(255, 255, 255, 0.4),
        0 0 1px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.window-btn:hover {
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(240, 240, 240, 0.4) 70%,
        rgba(220, 220, 220, 0.5) 100%);
    border-color: rgba(150, 150, 150, 0.5);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(255, 255, 255, 0.5),
        0 0 2px rgba(0, 0, 0, 0.15);
}

.window-btn:active {
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.2) 100%);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.window-btn.close {
    color: #1a1a1a;
}

.window-btn.close:hover {
    background: linear-gradient(to bottom,
        #e81123 0%,
        #c50e1f 50%,
        #a00d1a 100%);
    color: #fff;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.window-btn.close:active {
    background: linear-gradient(to bottom,
        #c50e1f 0%,
        #a00d1a 50%,
        #8a0b17 100%);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.window-btn.minimize:hover {
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(0, 0, 0, 0.1) 100%);
}

.window-btn.maximize:hover {
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(0, 0, 0, 0.1) 100%);
}

.window-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.2) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1e293b;
    margin: 0;
    /* Ensure content is scrollable and doesn't overflow */
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
}

.window-content * {
    color: #000000;
}

.window-content h1,
.window-content h2,
.window-content h3,
.window-content h4,
.window-content h5,
.window-content h6 {
    color: #0f172a;
    font-weight: 700;
}

.window-content p {
    color: #1a1a1a;
}

.window-content span {
    color: #1a1a1a;
}

.window-content a {
    color: #2171d6;
}

.window-content a:hover {
    color: #4a9eff;
}

/* Custom Scrollbar */
.window-content::-webkit-scrollbar {
    width: 17px;
}

.window-content::-webkit-scrollbar-track {
    background: linear-gradient(to bottom,
        rgba(240, 240, 240, 0.8) 0%,
        rgba(230, 230, 230, 0.8) 100%);
    border-left: 1px solid rgba(200, 200, 200, 0.8);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.5);
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom,
        rgba(200, 200, 200, 0.9) 0%,
        rgba(180, 180, 180, 0.9) 50%,
        rgba(160, 160, 160, 0.9) 100%);
    border: 1px solid rgba(140, 140, 140, 0.8);
    border-radius: 0;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom,
        rgba(180, 180, 180, 0.95) 0%,
        rgba(160, 160, 160, 0.95) 50%,
        rgba(140, 140, 140, 0.95) 100%);
}

.window-content::-webkit-scrollbar-button {
    display: none;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 10;
    background: transparent;
    transition: background 0.15s ease;
}

/* Hover effect for better visibility */
.resize-handle:hover {
    background: rgba(33, 113, 214, 0.3);
}

/* Edge handles - thin but clickable */
.resize-handle.n { 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 4px; 
    cursor: n-resize; 
}
.resize-handle.s { 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 4px; 
    cursor: s-resize; 
}
.resize-handle.e { 
    top: 0; 
    right: 0; 
    width: 4px; 
    height: 100%; 
    cursor: e-resize; 
}
.resize-handle.w { 
    top: 0; 
    left: 0; 
    width: 4px; 
    height: 100%; 
    cursor: w-resize; 
}

/* Corner handles - larger and more visible */
.resize-handle.ne { 
    top: 0; 
    right: 0; 
    width: 12px; 
    height: 12px; 
    cursor: ne-resize; 
    border-radius: 0 8px 0 0;
}
.resize-handle.nw { 
    top: 0; 
    left: 0; 
    width: 12px; 
    height: 12px; 
    cursor: nw-resize; 
    border-radius: 8px 0 0 0;
}
.resize-handle.se { 
    bottom: 0; 
    right: 0; 
    width: 12px; 
    height: 12px; 
    cursor: se-resize; 
    border-radius: 0 0 8px 0;
}
.resize-handle.sw { 
    bottom: 0; 
    left: 0; 
    width: 12px; 
    height: 12px; 
    cursor: sw-resize; 
    border-radius: 0 0 0 8px;
}

/* Disable resize handles when maximized */
.window.maximized .resize-handle {
    display: none;
}

/* ===================================
   Taskbar
   =================================== */

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, 
        rgba(30, 60, 100, 0.75) 0%,
        rgba(40, 80, 140, 0.70) 50%,
        rgba(50, 100, 180, 0.65) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 -1px 0 rgba(0, 0, 0, 0.15),
        0 -2px 6px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    z-index: 1000;
}

.taskbar-start, .taskbar-center, .taskbar-end {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.taskbar-center {
    flex: 1;
    justify-content: flex-start;
    gap: 2px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

.taskbar-center::-webkit-scrollbar {
    display: none;
}

.start-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 36px;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.15) 25%,
        rgba(70, 130, 200, 0.85) 50%,
        rgba(50, 110, 180, 0.90) 70%,
        rgba(40, 90, 160, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(70, 130, 200, 0.3);
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}


.start-button:hover {
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 25%,
        rgba(80, 140, 210, 0.9) 50%,
        rgba(60, 120, 190, 0.95) 70%,
        rgba(50, 100, 170, 1) 100%);
    box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.25),
        0 2px 5px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(80, 140, 210, 0.5);
    transform: scale(1.02);
}

.start-button:active {
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.2) 0%,
        rgba(42, 107, 165, 0.9) 50%,
        rgba(31, 90, 149, 1) 70%,
        rgba(26, 79, 133, 1) 100%);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(42, 107, 165, 0.3);
    transform: scale(0.98);
}

.start-button.active {
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(91, 160, 242, 0.95) 50%,
        rgba(64, 136, 205, 1) 70%,
        rgba(53, 122, 189, 1) 100%);
    box-shadow: 
        inset 0 1px 4px rgba(255, 255, 255, 0.6),
        inset 0 -1px 3px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(91, 160, 242, 0.6);
}

.start-icon {
    font-size: 1.2rem;
    z-index: 1;
    position: relative;
}

/* Windows logo in Start button - SVG-based for perfect scaling */
.windows-flag-start {
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    position: relative;
    z-index: 2;
    /* Ensure crisp rendering on all devices */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Strong 3D shadow for depth and authenticity */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) 
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 1px rgba(255, 255, 255, 0.3));
    /* Smooth scaling */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Ensure SVG scales properly on mobile */
@media (max-width: 768px) {
    .windows-flag-start {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }
}

@media (max-width: 480px) {
    .windows-flag-start {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
}

.taskbar-app {
    position: relative;
    padding: 2px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #ffffff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 200px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    height: 32px;
    min-height: 32px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.taskbar-app .app-icon {
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.taskbar-app .app-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-app:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-app:active {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-app.active {
    background: linear-gradient(to top,
        rgba(255, 255, 255, 0.20) 0%,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(255, 255, 255, 0.10) 70%,
        rgba(255, 255, 255, 0.06) 100%);
    color: #fff;
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.taskbar-app.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

.taskbar-app {
    position: relative;
}

.taskbar-app::after {
    content: attr(data-app-name);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.taskbar-app:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.tray-item {
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    font-size: 12px;
    padding: 2px;
}

.tray-chevron {
    width: 18px;
    height: 22px;
    font-size: 10px;
    padding: 0 2px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.tray-chevron .chevron-icon {
    color: #ffffff;
    opacity: 0.9;
    font-size: 9px;
    line-height: 1;
    display: block;
    transform: translateY(-1px);
}

.tray-chevron:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.tray-chevron:hover .chevron-icon {
    opacity: 1;
}

.tray-chevron:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Hidden Icons Popup */
.tray-hidden-icons {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 4px;
    background: linear-gradient(to bottom,
        rgba(30, 40, 60, 0.98) 0%,
        rgba(25, 35, 55, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 200px;
    max-width: 300px;
    display: none;
    z-index: 10000;
    overflow: hidden;
}

.tray-hidden-icons.active {
    display: block;
    animation: slideUpFade 0.2s ease-out;
}

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

.tray-hidden-header {
    padding: 8px 12px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.tray-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.tray-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.tray-hidden-content {
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.tray-hidden-content .tray-item {
    width: 32px;
    height: 32px;
    font-size: 14px;
    padding: 4px;
}

.tray-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tray-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.tray-clock {
    padding: 3px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: center;
    cursor: default;
    transition: background 0.15s ease;
    min-width: 65px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 10px;
}

.tray-clock:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tray-clock .time {
    font-size: 11px;
    font-weight: 400;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tray-clock .date {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===================================
   Start Menu
   =================================== */

.start-menu {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 2px);
    left: 8px;
    width: 520px;
    max-height: 650px;
    background: linear-gradient(to bottom,
        rgba(240, 248, 255, 0.25) 0%,
        rgba(230, 240, 255, 0.2) 50%,
        rgba(220, 232, 255, 0.15) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 0 20px rgba(100, 181, 246, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.start-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.start-menu-left {
    width: 280px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.3);
}

.start-menu-right {
    width: 240px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.start-menu-right::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 10%,
        rgba(255, 255, 255, 0.3) 90%,
        transparent 100%);
    box-shadow: -1px 0 2px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.start-menu-header {
    padding: 0;
    border-bottom: none;
    background: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 100%);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.user-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    margin-top: 2px;
}

.start-menu-apps {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    background: transparent;
}

.start-menu-apps .app-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.start-menu-apps h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0 8px 4px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.app-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-icon canvas {
    width: 32px;
    height: 32px;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.app-tile {
    padding: 10px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a1a;
    text-align: left;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    font-weight: 500;
}

.app-tile:hover {
    background: linear-gradient(to right,
        rgba(0, 120, 215, 0.15) 0%,
        rgba(0, 120, 215, 0.1) 100%);
    border: 1px solid rgba(0, 120, 215, 0.3);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.app-tile:active {
    background: rgba(0, 120, 215, 0.2);
}

.start-menu-search {
    padding: 8px;
    border-top: 1px solid #e0e0e0;
}

.search-box {
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 248, 248, 0.95) 100%);
    border: 1px solid rgba(180, 180, 180, 0.6);
    border-radius: 0;
    padding: 6px 10px;
    gap: 8px;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 -1px 1px rgba(255, 255, 255, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.6);
}

.search-icon {
    font-size: 14px;
    color: #666;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    color: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.search-input::placeholder {
    color: #999;
}

.start-menu-links {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.15s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

.menu-link .link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu-link:hover {
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.start-menu-footer {
    padding: 8px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.shutdown-btn {
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.shutdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.shutdown-btn .arrow {
    font-size: 10px;
    opacity: 0.7;
}

.app-icon {
    font-size: 1.8rem;
}

.app-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.start-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 8px;
}

.footer-btn {
    flex: 1;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* ===================================
   Context Menu
   =================================== */

.context-menu {
    position: fixed;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
    border: 1px solid #b0b0b0;
    border-radius: 4px;
    padding: 4px;
    min-width: 200px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: all 0.15s ease;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.context-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.context-item {
    width: 100%;
    padding: 6px 32px 6px 28px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #1a1a1a;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    white-space: nowrap;
}

.context-item .icon {
    position: absolute;
    left: 8px;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.context-item:hover {
    background: #316ac5;
    color: #fff;
}

.context-item:active {
    background: #2952a3;
}

.context-item[disabled] {
    color: #808080;
    cursor: default;
}

.context-item[disabled]:hover {
    background: transparent;
    color: #808080;
}

.context-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #d0d0d0 10%, #d0d0d0 90%, transparent);
    margin: 3px 2px;
    border-top: 1px solid #fff;
}

/* ===================================
   Laptop & Tablet Responsive
   =================================== */

/* Laptop screens (1366px - 1920px width) */
@media (max-width: 1920px) and (min-width: 1024px) {
    /* Reduce desktop icon column width on laptops */
    .desktop-icons {
        max-width: 110px;
    }
    
    .desktop-icon {
        width: 100px;
        font-size: 0.85rem;
    }
    
    .desktop-icon .icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }
    
    /* Ensure windows don't overflow */
    .window {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    /* Adjust window content for better readability */
    .window-content {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    /* Smaller headings on laptops */
    .window-content h2 {
        font-size: 1.75rem !important;
    }
    
    .window-content h3 {
        font-size: 1.3rem !important;
    }
    
    /* Compact skill tags */
    .window-content [style*="skill-tag"],
    .window-content span[style*="padding: 0.5rem"] {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    /* Compact stats/highlights */
    .window-content [style*="highlight-number"] {
        font-size: 1.5rem !important;
    }
}

/* Smaller laptops (1024px - 1366px) */
@media (max-width: 1366px) and (min-width: 1024px) {
    /* Further reduce desktop icon space */
    .desktop-icons {
        max-width: 100px;
    }
    
    .desktop-icon {
        width: 90px;
        font-size: 0.8rem;
    }
    
    .desktop-icon .icon {
        font-size: 2.2rem;
        width: 55px;
        height: 55px;
    }
    
    /* Ensure windows fit within viewport */
    .window {
        max-width: 98vw;
        max-height: 92vh;
    }
    
    /* More compact content */
    .window-content {
        font-size: 0.9rem;
        padding: 0.875rem;
    }
    
    .window-content h2 {
        font-size: 1.5rem !important;
    }
    
    .window-content h3 {
        font-size: 1.2rem !important;
    }
    
    /* Even more compact tags */
    .window-content [style*="skill-tag"],
    .window-content span[style*="padding: 0.5rem"] {
        font-size: 0.8rem !important;
        padding: 0.35rem 0.7rem !important;
    }
}

/* Tablet screens (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Hide desktop icons on tablets or make them very compact */
    .desktop-icons {
        max-width: 80px;
        opacity: 0.7;
    }
    
    .desktop-icon {
        width: 70px;
        font-size: 0.75rem;
    }
    
    .desktop-icon .icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    /* Windows should be more flexible */
    .window {
        max-width: 98vw;
        max-height: 95vh;
    }
}

/* ===================================
   Mobile Responsive
   =================================== */

@media (max-width: 768px) {
    /* Hide desktop icons on mobile */
    .desktop-icons {
        display: none;
    }

    /* Full screen windows on mobile */
    .window {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - var(--taskbar-height)) !important;
        border-radius: 0;
    }

    /* Larger window content padding */
    .window-content {
        padding: 20px;
        font-size: 16px;
        line-height: 1.6;
    }

    /* Larger headings on mobile */
    .window-content h1 {
        font-size: 1.8rem !important;
    }

    .window-content h2 {
        font-size: 1.5rem !important;
    }

    .window-content h3 {
        font-size: 1.2rem !important;
    }

    .window-content p {
        font-size: 1rem !important;
    }

    /* Larger buttons on mobile */
    .window-content button,
    .window-content a[style*="padding"] {
        font-size: 1rem !important;
        padding: 1rem 1.5rem !important;
        min-height: 48px;
    }

    /* Touch-friendly demo buttons */
    .open-demo-btn {
        font-size: 1.1rem !important;
        padding: 1rem 1.5rem !important;
        min-height: 54px !important;
    }

    /* Start menu mobile */
    .start-menu {
        left: 0;
        right: 0;
        width: 100%;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
    }

    .start-menu-header {
        padding: 24px;
    }

    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .user-name {
        font-size: 1.1rem;
    }

    .user-title {
        font-size: 0.95rem;
    }

    /* Larger app grid on mobile */
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .app-tile {
        padding: 20px;
        min-height: 90px;
    }

    .app-icon {
        font-size: 2.5rem;
    }

    .app-name {
        font-size: 1rem;
    }

    /* Taskbar mobile */
    .taskbar {
        height: 65px;
        padding: 0 12px;
    }

    .taskbar-center .taskbar-app .app-name {
        display: none;
    }

    .taskbar-app {
        padding: 10px;
        min-width: 48px;
        min-height: 48px;
    }

    .start-button {
        padding: 10px 14px;
        min-height: 48px;
    }

    .start-text {
        display: none;
    }

    .start-icon {
        font-size: 1.5rem;
    }

    .tray-item {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .tray-clock {
        padding: 6px 12px;
    }

    .tray-clock .time {
        font-size: 1rem;
    }

    .tray-clock .date {
        font-size: 0.8rem;
    }

    /* Boot screen mobile */
    .boot-logo h1 {
        font-size: 2.5rem;
    }

    .logo-icon {
        font-size: 4rem;
    }

    .boot-text {
        font-size: 1rem;
    }

    /* Skills/Tags mobile */
    .window-content [style*="skill-tag"],
    .window-content span[style*="padding: 0.5rem"] {
        font-size: 0.95rem !important;
        padding: 0.6rem 1rem !important;
    }

    /* Contact items mobile */
    .window-content [style*="contact-icon"] {
        font-size: 2.5rem !important;
    }

    /* Stats/Highlights mobile */
    .window-content [style*="highlight-number"],
    .window-content [style*="font-size: 2rem"] {
        font-size: 2.2rem !important;
    }
}

@media (max-width: 480px) {
    :root {
        --taskbar-height: 70px;
    }

    /* Even larger text on small phones */
    .window-content {
        padding: 16px;
        font-size: 17px;
    }

    .window-content h1 {
        font-size: 1.6rem !important;
    }

    .window-content h2 {
        font-size: 1.4rem !important;
    }

    .window-content h3 {
        font-size: 1.15rem !important;
    }

    /* Single column app grid on small phones */
    .app-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .app-tile {
        padding: 24px;
        min-height: 100px;
    }

    /* Larger touch targets */
    .start-button,
    .taskbar-app,
    .tray-item {
        min-height: 52px;
    }

    /* Taskbar adjustments */
    .taskbar {
        height: 70px;
    }

    .tray-clock {
        padding: 8px 10px;
    }

    .system-tray {
        gap: 6px;
    }
}

/* ===================================
   Demo Button Styles
   =================================== */

.open-demo-btn {
    position: relative;
    overflow: hidden;
}

.open-demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.open-demo-btn:active {
    transform: translateY(0);
}

.open-demo-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.open-demo-btn:hover::before {
    left: 100%;
}

/* Certificate Module Badges */
.view-cert-btn {
    transition: all 0.2s;
}

.view-cert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
    border-color: var(--primary);
}

/* ===================================
   Certificate Modal
   =================================== */

.cert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.cert-modal.active {
    display: flex;
}

.cert-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.cert-modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: rgba(30, 36, 66, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

.cert-modal-header {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cert-modal-header h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.cert-modal-close {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cert-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.cert-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000;
}

.cert-modal-body > div {
    width: 100%;
    height: 100%;
}

.cert-modal-body iframe,
.cert-modal-body embed {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.cert-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.cert-modal-footer {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
}

.cert-download-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cert-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(100, 255, 218, 0.3);
}

@media (max-width: 768px) {
    .cert-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .cert-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .cert-modal-body {
        padding: 1rem;
        overflow: auto;
    }
    
    .cert-modal-body iframe,
    .cert-modal-body embed {
        min-height: 400px !important;
    }
}

/* ===================================
   Windows 7 Dialog
   =================================== */

.windows-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.windows-dialog.active {
    opacity: 1;
    visibility: visible;
}

.dialog-content {
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 248, 248, 0.95) 100%);
    border: 1px solid rgba(180, 180, 180, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    min-width: 400px;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.windows-dialog.active .dialog-content {
    transform: scale(1);
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(to bottom,
        rgba(240, 248, 255, 0.5) 0%,
        rgba(230, 240, 255, 0.3) 100%);
    border-bottom: 1px solid rgba(200, 200, 200, 0.6);
}

.dialog-icon {
    font-size: 32px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dialog-body {
    padding: 20px;
}

.dialog-body p {
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.dialog-message {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(to bottom,
        rgba(248, 248, 248, 0.8) 0%,
        rgba(240, 240, 240, 0.8) 100%);
    border-top: 1px solid rgba(200, 200, 200, 0.6);
}

.dialog-btn {
    padding: 6px 20px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(240, 240, 240, 0.9) 50%,
        rgba(220, 220, 220, 0.9) 100%);
    border: 1px solid rgba(150, 150, 150, 0.6);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 1px 1px rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 75px;
}

.dialog-btn:hover {
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 1) 0%,
        rgba(248, 248, 248, 1) 50%,
        rgba(240, 240, 240, 1) 100%);
    border-color: rgba(100, 181, 246, 0.6);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(255, 255, 255, 0.6),
        0 0 4px rgba(100, 181, 246, 0.3);
}

.dialog-btn:active {
    background: linear-gradient(to bottom,
        rgba(220, 220, 220, 0.9) 0%,
        rgba(200, 200, 200, 0.9) 50%,
        rgba(180, 180, 180, 0.9) 100%);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

.dialog-btn-primary {
    background: linear-gradient(to bottom,
        rgba(100, 181, 246, 0.9) 0%,
        rgba(64, 169, 255, 0.9) 50%,
        rgba(53, 122, 189, 0.9) 100%);
    color: #fff;
    border-color: rgba(53, 122, 189, 0.8);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.dialog-btn-primary:hover {
    background: linear-gradient(to bottom,
        rgba(120, 201, 255, 0.95) 0%,
        rgba(84, 179, 255, 0.95) 50%,
        rgba(73, 142, 209, 0.95) 100%);
    border-color: rgba(73, 142, 209, 0.9);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(255, 255, 255, 0.4),
        0 0 8px rgba(100, 181, 246, 0.5);
}

.dialog-btn-primary:active {
    background: linear-gradient(to bottom,
        rgba(53, 122, 189, 0.9) 0%,
        rgba(43, 109, 169, 0.9) 50%,
        rgba(33, 96, 149, 0.9) 100%);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

/* ===================================
   AI Assistant Widget
   =================================== */

.ai-assistant-widget {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 280px;
    background: linear-gradient(135deg,
        rgba(30, 36, 66, 0.95) 0%,
        rgba(25, 32, 58, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(100, 255, 218, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    z-index: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.5s ease-out;
}

.ai-assistant-widget:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(100, 255, 218, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 255, 218, 0.5);
}

.ai-assistant-widget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-assistant-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.ai-assistant-title {
    color: #64ffda;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.ai-assistant-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
}

.ai-stat-number {
    color: #64ffda;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.ai-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-assistant-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid #64ffda;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .ai-assistant-widget {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 80px;
    }
}

