/* ==========================================================================
   WinOS — Stylesheet
   A web-based Windows 11 desktop clone.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Reset & Base
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: url('./img/wallpaper.jpg') no-repeat center center fixed;
    background-size: cover;
}


/* --------------------------------------------------------------------------
   2. Lock Screen
   -------------------------------------------------------------------------- */

.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;   /* stays above everything, including taskbar (z:999) */
    background: #000;  /* solid fallback so desktop never shows through while wallpaper loads */
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s ease;
}

/* Slide-up + fade-out when unlocking */
.lock-screen.unlocking {
    transform: translateY(-100%);
    opacity: 0;
}

.lock-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./img/wallpaper.jpg') no-repeat center center;
    background-size: cover;
    filter: brightness(0.6) blur(1px);
}

.lock-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.lock-time {
    font-size: 96px;
    font-weight: 600;
    letter-spacing: -2px;
    line-height: 1;
}

.lock-date {
    font-size: 22px;
    font-weight: 400;
    margin-top: 8px;
}

.lock-hint {
    position: absolute;
    bottom: 80px;
    font-size: 14px;
    opacity: 0.7;
    animation: lockPulse 2s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   3. Desktop Icons
   -------------------------------------------------------------------------- */

.icon-column {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
    height: calc(100vh - 60px);
    width: fit-content;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    padding: 8px;
    width: 80px;
    transition: background 0.2s ease-in-out;
}

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

.app-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-icon span {
    color: white;
    font-size: 11px;
    margin-top: 4px;
    text-shadow: 1px 1px 2px black;
    text-align: center;
}


/* --------------------------------------------------------------------------
   4. Window Component
   -------------------------------------------------------------------------- */

.window {
    position: absolute;
    width: 850px;
    height: 560px;
    background: rgba(253, 253, 253, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.32), 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Title bar — draggable header with app name + window controls */
.title-bar {
    height: 32px;
    min-height: 32px;
    background: #f3f3f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 0 12px;
    cursor: move;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 10px 10px 0 0;
    user-select: none;
}

.title-bar-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
}

.title-bar-left img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.title-bar-left span {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1c1c1c;
}

/* Minimize / maximize / close button group */
.win-controls {
    display: flex;
    align-items: stretch;
    height: 100%;
    flex-shrink: 0;
}

.win-btn {
    width: 46px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #1c1c1c;
    transition: background 0.1s ease;
}

.win-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.win-btn.close {
    border-radius: 0 10px 0 0;
}

.win-btn.close:hover {
    background: #c42b1c;
    color: #fff;
}

/* Main content area inside a window */
.content {
    flex: 1;
    padding: 15px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
}


/* --------------------------------------------------------------------------
   5. Taskbar
   -------------------------------------------------------------------------- */

.taskbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: white;
    z-index: 999;   /* below lock screen (z:9999), above windows */
}

/* Left section: branding */
.tb-left {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
}

/* Center section: Start button and running app icons */
.tb-center {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.start-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.start-btn:active {
    transform: scale(0.95);
}

.start-btn img {
    display: block;
}

/* Right section: system clock */
.tb-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
}

/* Running app indicators in the taskbar */
.task-icons-container {
    display: flex;
    gap: 8px;
}

.task-item {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.task-item img {
    width: 22px;
    height: 22px;
}

/* Small blue underline to show the app is running */
.task-item::after {
    content: '';
    position: absolute;
    bottom: 1px;
    width: 12px;
    height: 2px;
    background: #0078d4;
    border-radius: 1px;
}


/* --------------------------------------------------------------------------
   6. Start Menu
   -------------------------------------------------------------------------- */

.start-menu {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    background: rgba(32, 32, 32, 0.95);
    border-radius: 8px;
    padding: 20px;
    color: white;
    z-index: 9000;   /* above windows, below lock screen */
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    padding: 10px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.menu-item span {
    font-size: 11px;
    margin-top: 8px;
    text-align: center;
    color: white;
}


/* --------------------------------------------------------------------------
   7. Settings + Paint
   -------------------------------------------------------------------------- */

.settings-shell {
    height: 100%;
    display: flex;
    background: rgba(238, 241, 245, 0.85);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1c1c1c;
}

.settings-sidebar {
    width: 280px;
    background: transparent;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.settings-search-container {
    padding: 0 12px 16px;
}

.settings-search-bar {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    font-size: 13px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24" fill="%23605e5c"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 10px center;
}

.settings-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    margin-top: 4px;
    border-radius: 8px;
    background: transparent;
    transition: background 0.1s ease;
}

.settings-profile:hover {
    background: rgba(0, 0, 0, 0.04);
}

.settings-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0078d4, #50e6ff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.settings-name {
    font-size: 12px;
    font-weight: 500;
}

.settings-mail {
    font-size: 11px;
    color: #605e5c;
    margin-top: 1px;
}

.settings-nav-btn {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #1c1c1c;
    transition: background 0.1s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.settings-nav-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.settings-nav-btn.active {
    background: rgba(0, 0, 0, 0.06);
    color: #1c1c1c;
    font-weight: 500;
}

.settings-nav-btn.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: #0078d4;
    border-radius: 4px;
}

.settings-nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.settings-main {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.settings-page-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    color: #1c1c1c;
}

.settings-page-subtitle {
    margin: 0 0 24px;
    color: #605e5c;
    font-size: 13px;
    line-height: 1.5;
}

.settings-hero-card,
.settings-card,
.settings-wallpaper-card {
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.settings-hero-card {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.settings-hero-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #1c1c1c;
}

.settings-hero-text {
    margin: 0;
    color: #605e5c;
    font-size: 13px;
    line-height: 1.6;
}

.settings-mini-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-stat {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f3f3f3;
    border: 1px solid #e5e5e5;
}

.settings-stat-label {
    font-size: 10px;
    color: #605e5c;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.settings-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1c;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.settings-card {
    padding: 18px;
}

.settings-card h4,
.settings-wallpaper-card h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1c;
}

.settings-card p,
.settings-wallpaper-card p {
    margin: 0;
    color: #605e5c;
    font-size: 12px;
    line-height: 1.6;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent;
    transition: background 0.1s;
    border-radius: 4px;
    margin: 2px 0;
    cursor: pointer;
}

.settings-row:hover {
    background: rgba(0, 0, 0, 0.02);
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-row-icon {
    color: #605e5c;
}

.settings-row:first-of-type {
    border-top: none;
    padding-top: 12px;
}

.settings-row strong {
    font-size: 13px;
    color: #1c1c1c;
    font-weight: 500;
}

.settings-row span {
    color: #605e5c;
    font-size: 12px;
}

.settings-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #0f4db8;
    font-size: 12px;
    font-weight: 600;
}

.settings-wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.settings-wallpaper-card {
    overflow: hidden;
}

.settings-wallpaper-preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #dbe4f0;
    display: block;
}

.settings-wallpaper-meta {
    padding: 10px;
}

.settings-wallpaper-meta strong {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
}

.settings-wallpaper-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.settings-apply-btn {
    border: none;
    background: #0f6cbd;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

.settings-apply-btn:hover {
    background: #115ea3;
}

.settings-selected-tag {
    color: #0f6cbd;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paint-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f3f3f3;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.paint-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #fdfdfd, #eceff3);
    border-bottom: 1px solid #d9dce2;
}

.paint-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    border-right: 1px solid #d8dde6;
}

.paint-group:last-child {
    border-right: none;
    padding-right: 0;
}

.paint-tool-btn,
.paint-action-btn {
    border: 1px solid #cdd5df;
    background: #fff;
    color: #1f2937;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

.paint-tool-btn:hover,
.paint-action-btn:hover {
    background: #f8fbff;
}

.paint-tool-btn.active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #0f4db8;
    font-weight: 600;
}

.paint-size {
    width: 110px;
}

.paint-color {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #cdd5df;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.paint-stage {
    flex: 1;
    padding: 14px;
    background: linear-gradient(180deg, #dde6f1, #edf2f7);
}

.paint-canvas-wrap {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 1px solid #cfd8e3;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 10px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.paint-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.paint-status {
    padding: 8px 14px;
    border-top: 1px solid #d9dce2;
    background: #fafafa;
    font-size: 12px;
    color: #667085;
}

@media (max-width: 900px) {
    .settings-hero-card,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        width: 190px;
    }

    .settings-wallpaper-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* --------------------------------------------------------------------------
   8. Tic Tac Toe
   -------------------------------------------------------------------------- */

.ttt-row {
    display: flex;
}

.ttt-cell {
    font-family: 'Gloria Hallelujah', cursive, sans-serif;
    color: #fff;
    background: #121a21;
    text-align: center;
    width: 90px;
    height: 90px;
    font-size: 2.5em;
    margin: 4px;
    border-radius: 10px;
    box-shadow: 5px 5px 0 0 #090d10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.ttt-cell:hover {
    color: #e74c3c;
    background: #34495e;
}

/* Mark-selection buttons (X / O picker) */
.ttt-pick {
    width: 80px;
    height: 80px;
    font-size: 2.5em;
}

/* A cell that already has a mark placed on it */
.ttt-cell-selected {
    color: #c0392b;
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 0 #000;
    background: #121a21;
    cursor: default;
}

.ttt-cell-selected:hover {
    color: #c0392b;
    background: #121a21;
}

/* Winning cells glow and pop */
.ttt-cell-win {
    color: #e74c3c;
    background: #34495e;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.6);
}

.ttt-cell-win:hover {
    background: #34495e;
}

/* Generic button style for the game */
.ttt-btn {
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    margin: 20px;
    border-radius: 8px;
    color: #fff;
    background: #d35400;
    padding: 10px 20px;
    border: 2px solid #F89406;
    cursor: pointer;
}

.ttt-btn:hover {
    background: #e67e22;
}


/* --------------------------------------------------------------------------
   8. Explorer (Files) App
   -------------------------------------------------------------------------- */
.explorer-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(238, 241, 245, 0.85); /* Mica effect */
    color: #1c1c1c;
}

.explorer-toolbar {
    display: flex;
    padding: 8px 12px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 8px;
    align-items: center;
}

.explorer-tool-btn {
    border: none;
    background: transparent;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    color: #1c1c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.explorer-tool-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.explorer-tool-btn span {
    font-size: 18px;
}

.explorer-address-bar {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 4px 10px;
    display: flex;
    background: #ffffff;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.explorer-address-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 13px;
    background: transparent;
    color: #1c1c1c;
}

.explorer-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.explorer-sidebar {
    width: 200px;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 8px;
    background: transparent;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.explorer-sidebar-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
    position: relative;
}

.explorer-sidebar-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.explorer-sidebar-item.active {
    background: rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.explorer-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: #0078d4;
    border-radius: 4px;
}

.explorer-sidebar-icon {
    font-size: 18px;
    color: #0078d4;
    font-variation-settings: 'FILL' 1;
}

.explorer-main {
    flex: 1;
    padding: 16px;
    display: flex;
    gap: 8px;
    align-content: flex-start;
    flex-wrap: wrap;
    background: #ffffff;
    overflow-y: auto;
}

.explorer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    width: 80px;
    height: 85px;
    text-align: center;
    transition: background 0.1s;
}

.explorer-item:hover {
    background: rgba(0, 120, 212, 0.08); /* Windows light blue highlight */
}

.explorer-item-name {
    font-size: 11px;
    margin-top: 6px;
    word-break: break-all;
    color: #1c1c1c;
}

.explorer-statusbar {
    padding: 4px 12px;
    background: transparent;
    font-size: 11px;
    color: #605e5c;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}


/* --------------------------------------------------------------------------
    9. Utility Classes
   -------------------------------------------------------------------------- */

.hidden {
    display: none !important;
}

.no-select {
    user-select: none;
}


/* --------------------------------------------------------------------------
    10. Keyframe Animations
   -------------------------------------------------------------------------- */

/* Blinking cursor for terminal-like elements */
@keyframes blink {
    0%   { opacity: 1; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
}

/* Gentle pulse for the lock screen "click to unlock" hint */
@keyframes lockPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50%      { opacity: 0.9; transform: translateY(-5px); }
}
