* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    transition: all 0.3s ease;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0078d4, #106ebe);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
}

.loading-content {
    text-align: center;
}

.windows-logo {
    font-size: 4rem;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop */
.desktop {
    width: 100vw;
    height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
    transition: all 0.3s ease;
}

.desktop.dark-theme {
    filter: brightness(0.7) contrast(1.2);
}

/* Desktop Icons - NORMAL SIZE WITH SMALL SQUARE HIGHLIGHTING */
.desktop-icons {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
    height: calc(100vh - 50px);
    overflow: auto;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    user-select: none;
    pointer-events: none; /* Disable clicks on container */
}

/* Remove hover effect from container */
.desktop-icon:hover {
    /* No background highlight on container */
}

/* Only the icon image is clickable with small square highlight */
.icon-image {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks only on icon */
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 6px; /* Add padding for highlight area */
}

/* Small square highlight around icon only */
.icon-image:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.icon-image:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.desktop-icon span {
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    text-align: center;
    pointer-events: none; /* Text is not clickable */
}

/* Windows */
.window {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    min-height: 300px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.8) translateY(50px);
    opacity: 0;
}

.window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.window.minimized {
    transform: scale(0.1) translateY(100vh);
    opacity: 0;
}

.window-header {
    background: linear-gradient(135deg, #0078d4, #106ebe);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.window-title {
    font-weight: 600;
    font-size: 14px;
}

.window-controls {
    display: flex;
    gap: 12px;
}

.window-control {
    width: 32px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.window-control:hover {
    background: rgba(255, 255, 255, 0.2);
}

.window-control.close:hover {
    background: #e74c3c;
}

.window-content {
    padding: 20px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 1000;
}

.start-button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Search Container */
.search-container {
    position: relative;
    margin-right: 12px;
}

#search-bar {
    width: 300px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 6px;
    padding: 0 40px 0 12px;
    font-size: 14px;
    outline: none;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result:hover {
    background: #f5f5f5;
}

/* Taskbar Icons - BIGGER SIZE WITH SMALL SQUARE HIGHLIGHTING */
.taskbar-icons {
    display: flex;
    gap: 8px;
    margin-right: auto;
}

.taskbar-icon {
    width: 48px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    pointer-events: none; /* Disable clicks on container */
}

/* Remove hover effect from taskbar container */
.taskbar-icon:hover {
    /* No background highlight on container */
}

.taskbar-icon-image {
    width: 32px;
    height: 32px;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks only on icon */
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 8px; /* Add padding for highlight area */
}

/* Small square highlight around taskbar icon only */
.taskbar-icon-image:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.taskbar-icon-image:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 12px;
}

.tray-icon {
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.tray-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.battery-icon {
    display: flex;
    align-items: center;
    gap: 4px;
}

.battery-percentage {
    font-size: 10px;
}

.clock-container {
    text-align: center;
    padding: 4px 8px;
    cursor: pointer;
}

.time {
    font-weight: 600;
    font-size: 14px;
}

.date {
    font-size: 12px;
    opacity: 0.8;
}

/* Start Menu */
.start-menu {
    position: fixed;
    bottom: 50px;
    left: 12px;
    width: 600px;
    height: 500px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    display: none;
    overflow: hidden;
    z-index: 1001;
    animation: slideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.start-menu-left {
    padding: 20px;
    color: white;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-section img {
    width: 40px;
    height: 40px;
}

.start-apps {
    display: grid;
    gap: 8px;
}

.start-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    pointer-events: none; /* Disable clicks on container */
}

/* Remove hover effect from start app container */
.start-app:hover {
    /* No background highlight on container */
}

.start-app-icon {
    width: 32px;
    height: 32px;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks only on icon */
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 6px; /* Add padding for highlight area */
}

/* Small square highlight around start menu icon only */
.start-app-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.start-app-icon:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.start-app span {
    font-size: 13px;
    pointer-events: none; /* Text is not clickable */
}

.power-options {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.power-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 11px;
}

.power-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.power-option i {
    font-size: 16px;
    margin-bottom: 4px;
}

/* Wallpaper Selector */
.wallpaper-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 20px;
    display: none;
    z-index: 1002;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.wallpaper-option {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.wallpaper-option:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.wallpaper-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#close-wallpaper {
    background: #0078d4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

#close-wallpaper:hover {
    background: #106ebe;
}

/* Dark Theme */
.dark-theme .window {
    background: rgba(30, 30, 30, 0.95);
    color: white;
}

.dark-theme .window-content {
    background: rgba(30, 30, 30, 0.95);
}

.dark-theme #search-bar {
    background: rgba(60, 60, 60, 0.9);
    color: white;
}

.dark-theme .wallpaper-selector {
    background: rgba(30, 30, 30, 0.95);
    color: white;
}

/* Dark theme icon highlights */
.dark-theme .icon-image:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.dark-theme .taskbar-icon-image:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.dark-theme .start-app-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    #search-bar {
        width: 200px;
    }
    
    .start-menu {
        width: 90vw;
        height: 70vh;
    }
    
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 70px);
        gap: 15px;
        padding: 15px;
    }
    
    .icon-image {
        width: 40px;
        height: 40px;
        padding: 5px;
    }
    
    .desktop-icon span {
        font-size: 11px;
    }
    
    .taskbar-icon {
        width: 44px;
        height: 36px;
    }
    
    .taskbar-icon-image {
        width: 28px;
        height: 28px;
        padding: 6px;
    }
    
    .start-app-icon {
        width: 28px;
        height: 28px;
        padding: 5px;
    }
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    background: transparent;
}

.resize-handle.n {
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    cursor: n-resize;
}

.resize-handle.s {
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    cursor: s-resize;
}

.resize-handle.e {
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    cursor: e-resize;
}

.resize-handle.w {
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    cursor: w-resize;
}

.resize-handle.ne {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
}

.resize-handle.nw {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
}

.resize-handle.se {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

.resize-handle.sw {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}
