/* Basic reset - always start with this, learned in class */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS variables for theming - makes life so much easier */
:root {
    --win10-blue: #0078d4;
    --win10-dark-blue: #005a9e;
    --win10-bg: #1e1e1e;
    --win10-taskbar: rgba(26, 26, 26, 0.95);
    --win10-window: rgba(32, 32, 32, 0.95);
    --win10-accent: #0078d4;
    --win10-hover: rgba(255, 255, 255, 0.1);
    --win10-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden; /* no scrollbars on desktop - looks cleaner */
    background: var(--win10-bg);
    color: var(--text-primary);
}

/* Loading Screen - shows before login, copied the animation from codepen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    transition: opacity 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    text-align: center;
}

.loading-logo {
    font-size: 80px;
    color: #0078d4;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-in;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.spinner-dot {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    animation: spinnerPulse 1.4s infinite ease-in-out;
}

.spinner-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.spinner-dot:nth-child(3) {
    animation-delay: 0s;
}

.spinner-dot:nth-child(4) {
    animation-delay: 0.16s;
}

.spinner-dot:nth-child(5) {
    animation-delay: 0.32s;
}

@keyframes spinnerPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 300;
    animation: fadeIn 0.8s ease-in;
}

/* Login Screen - Windows 10 style */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/black.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s, transform 0.5s;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.login-screen.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.login-container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-avatar {
    font-size: 120px;
    color: white;
    margin-bottom: 20px;
}

.login-name {
    font-size: 32px;
    color: white;
    margin-bottom: 30px;
    font-weight: 300;
}

.login-input-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    padding: 4px;
    margin-bottom: 15px;
}

.login-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: white;
    font-size: 16px;
    outline: none;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-submit {
    width: 40px;
    height: 40px;
    background: var(--win10-blue);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.login-submit:hover {
    background: var(--win10-dark-blue);
}

.login-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.login-footer {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 1;
}

.login-power {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-power:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Shutdown Menu */
.shutdown-menu {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(32, 32, 32, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win10-border);
    border-radius: 8px;
    padding: 8px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.2s;
}

.shutdown-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.shutdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
}

.shutdown-option:hover {
    background: var(--win10-hover);
}

.shutdown-option i {
    width: 20px;
    text-align: center;
}

/* Desktop - main background area where everything happens */
.desktop {
    width: 100vw;
    height: 100vh;
    background: url('img/1278459.png') center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

.desktop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1); /* slight overlay for better text readability */
    pointer-events: none;
}

/* Desktop Icons - draggable shortcuts, took forever to get the positioning right */
.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    z-index: 1;
    pointer-events: none; /* let clicks pass through to desktop */
}

.desktop-icon {
    width: 60px; /* reduced from 70px */
    text-align: center;
    cursor: move;
    padding: 4px; /* reduced from 6px */
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
    position: absolute;
    pointer-events: all;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.desktop-icon.selected {
    background: rgba(0, 120, 212, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 120, 212, 0.8);
}

.desktop-icon.dragging {
    opacity: 0.7;
    z-index: 1000;
}

.icon-image {
    font-size: 28px; /* reduced from 36px */
    color: white;
    margin-bottom: 3px; /* reduced from 4px */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.icon-label {
    font-size: 10px; /* reduced from 11px */
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    font-weight: 500;
    line-height: 1.1; /* reduced from 1.2 */
}

/* Windows - floating application windows */
.windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 48px); /* leave space for taskbar */
    pointer-events: none;
}

.window {
    position: absolute;
    background: var(--win10-window);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win10-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    min-width: 400px;
    min-height: 300px;
    overflow: hidden;
    transition: opacity 0.2s;
}

.window.minimized {
    opacity: 0;
    pointer-events: none;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 48px) !important;
    border-radius: 0;
}

.window-titlebar {
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: move;
    user-select: none;
}

.window-title {
    flex: 1;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-title i {
    font-size: 14px;
    color: var(--win10-blue);
}

.window-controls {
    display: flex;
}

.window-control-btn {
    width: 46px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 10px;
}

.window-control-btn:hover {
    background: var(--win10-hover);
}

.window-control-btn.close:hover {
    background: #e81123;
}

.window-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

/* Taskbar - bottom bar with start menu, apps, system tray etc */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--win10-taskbar);
    backdrop-filter: blur(30px); /* this makes it look glassy */
    border-top: 1px solid var(--win10-border);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 1000;
}

.start-btn {
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.start-btn:hover {
    background: var(--win10-hover);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--win10-border);
    border-radius: 4px;
    padding: 0 12px;
    height: 32px;
    width: 300px;
    margin-left: 8px;
    cursor: text;
}

.search-box i {
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.taskbar-apps {
    flex: 1;
    display: flex;
    gap: 4px;
    margin-left: 8px;
    overflow-x: auto;
}

.taskbar-app {
    min-width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.taskbar-app:hover {
    background: var(--win10-hover);
}

.taskbar-app.active {
    border-bottom-color: var(--win10-blue);
}

.taskbar-app.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--win10-blue);
    border-radius: 50%;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tray-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
}

.tray-icon:hover {
    background: var(--win10-hover);
}

.tray-clock {
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    text-align: right;
}

.tray-clock:hover {
    background: var(--win10-hover);
}

.clock-time {
    font-size: 12px;
    line-height: 1.2;
}

.clock-date {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.action-center-btn {
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 16px;
}

.action-center-btn:hover {
    background: var(--win10-hover);
}

/* Start Menu - left side popup menu */
.start-menu {
    position: fixed;
    bottom: 56px;
    left: 8px;
    width: 640px;
    height: 600px;
    background: var(--win10-window);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win10-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* smooth animation */
    z-index: 999;
}

.start-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.start-menu-sidebar {
    width: 48px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.sidebar-btn {
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 16px;
}

.sidebar-btn:hover {
    background: var(--win10-hover);
}

.sidebar-btn.power-btn {
    margin-top: auto;
}

.start-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.start-menu-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--win10-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.user-avatar-small {
    font-size: 32px;
    color: var(--win10-blue);
}

.start-menu-apps {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.app-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.app-tile {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 12px;
}

.app-tile:hover {
    background: var(--win10-hover);
    transform: scale(1.05);
}

.app-tile i {
    font-size: 32px;
    color: var(--win10-blue);
}

.app-list {
    display: flex;
    flex-direction: column;
}

.app-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
    text-align: left;
}

.app-list-item:hover {
    background: var(--win10-hover);
}

.app-list-item i {
    width: 20px;
    color: var(--win10-blue);
}

/* Action Center */
.action-center {
    position: fixed;
    bottom: 56px;
    right: 8px;
    width: 400px;
    height: 600px;
    background: var(--win10-window);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win10-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.action-center.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.action-center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--win10-border);
}

.action-center-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.clear-all {
    background: transparent;
    border: none;
    color: var(--win10-blue);
    cursor: pointer;
    font-size: 13px;
}

.clear-all:hover {
    text-decoration: underline;
}

.notifications {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.notification {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
}

.notification-icon {
    width: 32px;
    height: 32px;
    background: var(--win10-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--win10-border);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.quick-action-btn:hover {
    background: var(--win10-hover);
}

.quick-action-btn i {
    font-size: 20px;
    color: var(--win10-blue);
}

/* Calendar Panel */
.calendar-panel {
    position: fixed;
    bottom: 56px;
    right: 8px;
    width: 320px;
    background: var(--win10-window);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win10-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.calendar-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.calendar-header {
    padding: 20px;
    border-bottom: 1px solid var(--win10-border);
}

.calendar-date {
    font-size: 24px;
    font-weight: 300;
}

.calendar-body {
    padding: 20px;
}

/* Custom scrollbar styling - looks better than default */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive design - mobile/tablet adjustments */
@media (max-width: 768px) {
    .start-menu {
        width: calc(100vw - 16px);
        height: calc(100vh - 64px);
    }
    
    .action-center {
        width: calc(100vw - 16px);
    }
    
    .search-box {
        width: 150px; /* smaller search on mobile */
    }
    
    .window {
        min-width: 300px; /* smaller min width for mobile */
    }
}
/* Window Resize Handles - for dragging window edges */
.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
    transition: background 0.2s;
}

/* Individual resize directions */
.resize-n {
    top: 0;
    left: 8px;
    right: 8px;
    height: 4px;
    cursor: n-resize;
}

.resize-s {
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 4px;
    cursor: s-resize;
}

.resize-e {
    top: 8px;
    right: 0;
    bottom: 8px;
    width: 4px;
    cursor: e-resize;
}

.resize-w {
    top: 8px;
    left: 0;
    bottom: 8px;
    width: 4px;
    cursor: w-resize;
}

/* Corner resize handles */
.resize-ne {
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: ne-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: nw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: se-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: sw-resize;
}

/* Visual feedback on hover */
.resize-handle:hover {
    background: rgba(0, 120, 212, 0.2);
}

.resize-handle:active {
    background: rgba(0, 120, 212, 0.4);
}

/* Corner handles get slightly bigger hover area */
.resize-ne:hover,
.resize-nw:hover,
.resize-se:hover,
.resize-sw:hover {
    background: rgba(0, 120, 212, 0.3);
}

/* Prevent text selection during resize operations */
.window.resizing {
    user-select: none;
}

.window.resizing * {
    user-select: none;
    pointer-events: none;
}

.window.resizing .resize-handle {
    pointer-events: all; /* keep resize handles clickable */
}

/* Hide resize handles on maximized windows - can't resize when full screen */
.window.maximized .resize-handle {
    display: none !important;
}

/* Terminal cursor animation - found this online */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Theme transition animations - makes switching themes smooth */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}