/* Windows 7 Aero Colors and Global Variables */
:root {
    --aero-bg: rgba(185, 209, 234, 0.45);
    --aero-border: rgba(255, 255, 255, 0.6);
    --aero-glow: rgba(255, 255, 255, 0.3);
    --aero-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    
    --taskbar-bg: linear-gradient(to bottom, rgba(162, 189, 219, 0.7) 0%, rgba(132, 168, 205, 0.8) 50%, rgba(100, 142, 186, 0.9) 51%, rgba(119, 159, 199, 0.8) 100%);
    
    --text-color: #000;
    --text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    --font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    
    --start-menu-left-bg: #fff;
    --start-menu-right-bg: rgba(69, 128, 196, 0.8);
}

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

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: var(--font-family);
    background-color: #000;
    color: var(--text-color);
    width: 100vw;
    height: 100vh;
}

/* Boot Screen */
#boot-screen {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: pulse 2s infinite ease-in-out;
}

.windows-logo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    width: 100px;
    height: 100px;
    transform: skew(-15deg, -5deg);
}

.win-sq { width: 100%; height: 100%; border-radius: 2px; }
.win-sq.red { background-color: #F85731; }
.win-sq.green { background-color: #79C229; }
.win-sq.blue { background-color: #01A3EE; }
.win-sq.yellow { background-color: #FCBC1F; }

#boot-screen h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 400;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.7; transform: scale(0.98); }
}

/* Desktop Environment */
#desktop-environment {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #005a9e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
}

/* Aero Glass Utility */
.aero-glass {
    background: var(--aero-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--aero-border);
    box-shadow: inset 0 1px rgba(255,255,255,0.5), inset 0 0 5px var(--aero-glow), var(--aero-shadow);
}

/* Desktop Grid */
#desktop-grid {
    flex: 1;
    position: relative; /* Context for absolute icon placement */
    width: 100%;
    height: 100%;
}

.desktop-icon {
    width: 74px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: default;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.desktop-icon.selected {
    background-color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    pointer-events: none;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.desktop-icon span {
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 2px #000, 0 1px 2px #000;
    text-align: center;
    word-break: break-word;
    pointer-events: none;
}

/* Taskbar */
#taskbar {
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--taskbar-bg);
    z-index: 1000;
    position: relative;
}

#start-button {
    width: 50px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

#start-button:hover::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
}

.windows-logo-small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 24px;
    height: 24px;
    transform: skew(-15deg, -5deg);
}

#taskbar-items {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    gap: 5px;
}

.taskbar-item {
    height: 34px;
    min-width: 40px;
    max-width: 160px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 0 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-item img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.taskbar-item:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5);
}

.taskbar-item.active {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 15px rgba(255,255,255,0.5);
}

#system-tray {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #fff;
    font-size: 12px;
    text-shadow: 1px 1px 2px #000;
}

#clock {
    padding: 0 10px;
    cursor: default;
    display: flex;
    align-items: center;
    height: 100%;
}

#clock:hover {
    background: rgba(255, 255, 255, 0.2);
}

#show-desktop {
    width: 15px;
    height: 100%;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

#show-desktop:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Clock and Calendar Widget */
#clock-widget {
    position: absolute;
    bottom: 40px;
    right: 0;
    width: 320px;
    height: 380px;
    border-radius: 5px 5px 0 0;
    box-shadow: -2px -2px 10px rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.clock-widget-container {
    background: #fff;
    flex: 1;
    margin: 5px 5px 0 5px;
    border-radius: 3px 3px 0 0;
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
}

/* Analog Clock */
.analog-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.clock-face {
    width: 120px;
    height: 120px;
    border: 3px solid #666;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, #fff 0%, #f0f0f0 100%);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1), 0 2px 5px rgba(0,0,0,0.1);
}

.clock-face::after {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: #333;
    border-radius: 4px;
    z-index: 2;
}

.hour-hand {
    width: 4px;
    height: 35px;
    margin-left: -2px;
}

.min-hand {
    width: 3px;
    height: 45px;
    margin-left: -1.5px;
}

.second-hand {
    width: 1px;
    height: 50px;
    margin-left: -0.5px;
    background: #d32f2f;
    z-index: 3;
}

.center-dot {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    z-index: 4;
}

.digital-time {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* Calendar */
.calendar-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.calendar-header {
    text-align: center;
    color: #003399;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: bold;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.day-name {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

.cal-day {
    padding: 4px 0;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    border: 1px solid transparent;
}

.cal-day:hover {
    background: rgba(185, 209, 234, 0.4);
    border: 1px solid #a2bddb;
}

.cal-day.other-month {
    color: #aaa;
}

.cal-day.today {
    background: #cce4f7;
    border: 1px solid #84a8cd;
    font-weight: bold;
}

.current-date-footer {
    margin-top: auto;
    text-align: left;
    color: #003399;
    font-size: 13px;
    padding-top: 10px;
    cursor: pointer;
}

.current-date-footer:hover, .calendar-header:hover {
    text-decoration: underline;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 380px;
    height: 450px;
    border-radius: 5px 5px 0 0;
    display: flex;
    box-shadow: 2px -2px 10px rgba(0,0,0,0.5);
    z-index: 2000;
}

.start-menu-left {
    flex: 1.2;
    background: var(--start-menu-left-bg);
    border-radius: 5px 0 0 0;
    display: flex;
    flex-direction: column;
    padding: 5px;
}

#start-programs-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.start-program-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 3px;
    border: 1px solid transparent;
}

.start-program-item:hover {
    background: rgba(185, 209, 234, 0.5);
    border: 1px solid rgba(162, 189, 219, 0.8);
}

.start-program-item img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.start-program-item span {
    font-size: 12px;
    color: #000;
}

.start-search {
    padding: 10px 5px 5px 5px;
    border-top: 1px solid #ddd;
}

.start-search input {
    width: 100%;
    padding: 5px 10px 5px 25px;
    border: 1px solid #999;
    border-radius: 15px;
    outline: none;
    font-family: var(--font-family);
}

.start-menu-right {
    flex: 0.8;
    background: var(--start-menu-right-bg);
    border-left: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
}

.user-profile {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-right: 10px;
}

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

.start-menu-links {
    list-style: none;
    padding: 10px 0;
}

.start-menu-links li {
    padding: 8px 15px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.start-menu-links li:hover {
    background: rgba(255,255,255,0.2);
}

.start-menu-links .separator {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 5px 15px;
    padding: 0;
}

#shutdown-btn {
    font-weight: bold;
}

/* Shutdown Screen */
#shutdown-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #005a9e;
    background-image: radial-gradient(circle, #0078D7 0%, #003666 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: wait;
}

.shutdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.shutdown-content h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Powered Off Screen */
#powered-off-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #050505;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.off-content {
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.off-content h2 {
    color: #888;
    font-size: 28px;
    font-family: monospace;
    font-weight: normal;
}

.off-content p {
    font-size: 14px;
    font-family: monospace;
    margin-bottom: 20px;
}

#power-on-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: 2px solid #333;
    border-radius: 30px;
    background: #111;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#power-on-btn svg {
    width: 20px;
    height: 20px;
    stroke: #ff4444;
    transition: all 0.3s;
}

#power-on-btn:hover {
    background: #222;
    border-color: #555;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

#power-on-btn:hover svg {
    stroke: #ff6666;
    filter: drop-shadow(0 0 5px rgba(255, 68, 68, 0.5));
}
