/* ============================================
   WEN - Windows XP Desktop Theme
   ============================================
   A nostalgic Windows XP inspired design
   for the WEN Solana memecoin website.
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
    font-size: 12px;
    color: #000;
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================
   VIDEO WALLPAPER
   ============================================ */
#wallpaper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
}

/* ============================================
   DESKTOP
   ============================================ */
#desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px; /* Space for taskbar */
    overflow: hidden;
}

/* Desktop Icons */
.desktop-icons {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    padding: 16px;
    height: 100%;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 75px;
    padding: 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.desktop-icon:focus {
    outline: 1px dotted #fff;
    outline-offset: 2px;
}

.desktop-icon.selected {
    background: rgba(49, 106, 197, 0.5);
}

.desktop-icon .icon-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.desktop-icon .icon-image svg {
    width: 100%;
    height: 100%;
}

.desktop-icon .icon-label {
    margin-top: 4px;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 11px;
    word-wrap: break-word;
    max-width: 70px;
}

/* ============================================
   WINDOWS
   ============================================ */
#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.window {
    position: absolute;
    display: none;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 60px);
    background: #ECE9D8;
    border: 1px solid #0054E3;
    border-radius: 8px 8px 0 0;
    box-shadow: 
        2px 2px 10px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    pointer-events: auto;
}

.window.active {
    box-shadow: 
        3px 3px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.window.open {
    display: flex;
}

.window.minimized {
    display: none !important;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 40px) !important;
    border-radius: 0;
    max-width: none;
    max-height: none;
}

.window-small {
    width: 320px;
    min-height: 280px;
}

/* Window Titlebar */
.window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 5px 3px 8px;
    background: linear-gradient(180deg, 
        #0A246A 0%,
        #0A246A 3%,
        #1B4EAD 10%,
        #2E6CD1 20%,
        #3688EB 50%,
        #2E6CD1 80%,
        #1B4EAD 90%,
        #0A246A 100%
    );
    border-radius: 6px 6px 0 0;
    cursor: move;
    user-select: none;
}

.window.active .window-titlebar {
    background: linear-gradient(180deg, 
        #0A246A 0%,
        #0A246A 3%,
        #1B57B5 10%,
        #3478D9 20%,
        #4A9BF5 50%,
        #3478D9 80%,
        #1B57B5 90%,
        #0A246A 100%
    );
}

.window:not(.active) .window-titlebar {
    background: linear-gradient(180deg,
        #7A96DF 0%,
        #7A96DF 3%,
        #8EAAEB 10%,
        #9BB8F0 20%,
        #A7C4F5 50%,
        #9BB8F0 80%,
        #8EAAEB 90%,
        #7A96DF 100%
    );
}

.window-title {
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-controls button {
    width: 21px;
    height: 21px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.btn-minimize, .btn-maximize {
    background: linear-gradient(180deg, #3C8CF8 0%, #0E61D5 100%);
    border-color: #3370C5 #1B47A5 #1B47A5 #3370C5;
    color: #fff;
}

.btn-minimize:hover, .btn-maximize:hover {
    background: linear-gradient(180deg, #5CA8FF 0%, #2E81F5 100%);
}

.btn-minimize:active, .btn-maximize:active {
    background: linear-gradient(180deg, #0E61D5 0%, #3C8CF8 100%);
}

.btn-close {
    background: linear-gradient(180deg, #E99D71 0%, #C73A1A 50%, #A02610 100%);
    border-color: #C54848 #8A1010 #8A1010 #C54848;
    color: #fff;
}

.btn-close:hover {
    background: linear-gradient(180deg, #FFBD91 0%, #E75A3A 50%, #C04630 100%);
}

.btn-close:active {
    background: linear-gradient(180deg, #A02610 0%, #C73A1A 50%, #E99D71 100%);
}

/* Window Content */
.window-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #fff;
    border: 2px inset #ACA899;
    margin: 2px;
}

.window-content h2 {
    font-size: 18px;
    color: #003399;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.window-content h3 {
    font-size: 14px;
    color: #003399;
    margin: 16px 0 8px 0;
}

.window-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.window-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.window-content li {
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Link Window Styling */
.link-window {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
}

.link-icon svg {
    width: 64px;
    height: 64px;
}

.link-window h3 {
    margin: 0 !important;
    font-size: 16px;
}

.link-window p {
    margin: 0 !important;
    color: #666;
}

.open-link-btn {
    display: inline-block;
    padding: 8px 24px;
    background: linear-gradient(180deg, #FFFFFF 0%, #ECE9D8 50%, #D5D2C5 100%);
    border: 1px solid;
    border-color: #ACA899 #706F64 #706F64 #ACA899;
    border-radius: 3px;
    color: #000;
    text-decoration: none;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 1px 1px 0 #fff inset, -1px -1px 0 #ACA899 inset;
}

.open-link-btn:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F3EB 50%, #E5E2D5 100%);
}

.open-link-btn:active {
    background: linear-gradient(180deg, #D5D2C5 0%, #ECE9D8 50%, #FFFFFF 100%);
    box-shadow: -1px -1px 0 #fff inset, 1px 1px 0 #ACA899 inset;
}

/* Token Table */
.token-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.token-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.token-table tr:nth-child(even) {
    background: #f8f8f8;
}

.token-table tr:hover {
    background: #e8f4ff;
}

/* Contract Box */
.contract-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.contract-box code {
    font-family: "Courier New", monospace;
    font-size: 11px;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

.copy-btn {
    padding: 4px 10px;
    background: linear-gradient(180deg, #FFFFFF 0%, #ECE9D8 100%);
    border: 1px solid #ACA899;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
}

.copy-btn:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F3EB 100%);
}

/* Quick Links */
.quick-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-links a {
    padding: 6px 12px;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 11px;
}

.quick-links a:hover {
    background: #0055aa;
}

/* Accordion */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.accordion-item {
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(180deg, #FFFFFF 0%, #ECE9D8 100%);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    text-align: left;
}

.accordion-header:hover {
    background: linear-gradient(180deg, #F0F8FF 0%, #E0E8F0 100%);
}

.accordion-icon {
    font-size: 16px;
    font-weight: bold;
    color: #0066cc;
    transition: transform 0.2s;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    display: none;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.accordion-content.open {
    display: block;
}

/* ============================================
   TASKBAR
   ============================================ */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, 
        #3168D5 0%,
        #4A8CF5 3%,
        #2E6CD1 6%,
        #1B4EAD 50%,
        #1A47A0 95%,
        #0D3580 100%
    );
    display: flex;
    align-items: center;
    padding: 2px 4px;
    z-index: 9999;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
}

/* Start Button */
#start-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    height: 32px;
    background: linear-gradient(180deg,
        #3B9C3B 0%,
        #2D8F2D 10%,
        #268426 50%,
        #1E751E 90%,
        #166616 100%
    );
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    box-shadow: 
        1px 1px 0 rgba(255, 255, 255, 0.3) inset,
        -1px -1px 0 rgba(0, 0, 0, 0.3) inset,
        2px 2px 4px rgba(0, 0, 0, 0.3);
}

#start-button:hover {
    background: linear-gradient(180deg,
        #4BAC4B 0%,
        #3D9F3D 10%,
        #369436 50%,
        #2E852E 90%,
        #267626 100%
    );
}

#start-button:active {
    background: linear-gradient(180deg,
        #166616 0%,
        #1E751E 10%,
        #268426 50%,
        #2D8F2D 90%,
        #3B9C3B 100%
    );
    box-shadow: 
        -1px -1px 0 rgba(255, 255, 255, 0.3) inset,
        1px 1px 0 rgba(0, 0, 0, 0.3) inset;
}

.start-logo {
    font-size: 18px;
}

.start-text {
    font-style: italic;
}

/* Taskbar Windows Area */
#taskbar-windows {
    flex: 1;
    display: flex;
    gap: 3px;
    padding: 0 8px;
    overflow-x: auto;
}

.taskbar-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    height: 28px;
    max-width: 180px;
    background: linear-gradient(180deg, #3C7FD8 0%, #2D68B8 50%, #1D4F98 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.taskbar-item:hover {
    background: linear-gradient(180deg, #5C9FF8 0%, #4D88D8 50%, #3D6FB8 100%);
}

.taskbar-item.active {
    background: linear-gradient(180deg, #5C9FF8 0%, #4D88D8 50%, #3D6FB8 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3);
}

.taskbar-item.minimized {
    background: linear-gradient(180deg, #2D5588 0%, #1D4568 50%, #0D3548 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Taskbar Right */
#taskbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    background: linear-gradient(180deg, #1D5099 0%, #0F3F88 50%, #0A3070 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
}

#sound-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 3px;
}

#sound-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

#clock {
    color: #fff;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    min-width: 55px;
    text-align: center;
}

/* ============================================
   START MENU
   ============================================ */
#start-menu {
    position: fixed;
    bottom: 44px;
    left: 4px;
    width: 280px;
    background: linear-gradient(180deg, #3B82D0 0%, #2E6BC1 50%, #1D5AAF 100%);
    border: 2px solid #2E6BC1;
    border-radius: 8px 8px 0 8px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    overflow: hidden;
}

#start-menu.hidden {
    display: none;
}

.start-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #2255AA 0%, #1A4590 100%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.start-menu-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.start-menu-items {
    background: #fff;
    padding: 4px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
}

.start-menu-item:hover {
    background: #316AC5;
    color: #fff;
}

.menu-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.start-menu-divider {
    height: 1px;
    background: #ddd;
    margin: 4px 8px;
}

/* ============================================
   CONTEXT MENU
   ============================================ */
#context-menu {
    position: fixed;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ACA899;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

#context-menu.hidden {
    display: none;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 6px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    text-align: left;
}

.context-menu-item:hover {
    background: #316AC5;
    color: #fff;
}

.context-menu-divider {
    height: 1px;
    background: #ddd;
    margin: 2px 0;
}

/* ============================================
   TOOLTIP
   ============================================ */
.desktop-icon::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #FFFFE1;
    border: 1px solid #000;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s 0.5s;
    z-index: 100;
}

.desktop-icon:hover::after {
    opacity: 1;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .desktop-icon {
        width: 80px;
    }

    .desktop-icon .icon-image {
        width: 56px;
        height: 56px;
    }

    .desktop-icon::after {
        display: none; /* Hide tooltips on mobile */
    }

    /* Windows go fullscreen on mobile */
    .window.open {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 50px) !important;
        border-radius: 0;
        max-width: none;
        max-height: none;
        min-width: auto;
    }

    .window-titlebar {
        border-radius: 0;
    }

    #taskbar {
        height: 50px;
    }

    #start-button {
        height: 40px;
        padding: 4px 10px;
    }

    .start-text {
        display: none; /* Hide "Start" text on mobile */
    }

    .start-logo {
        font-size: 24px;
    }

    #taskbar-windows {
        gap: 2px;
    }

    .taskbar-item {
        max-width: 100px;
        font-size: 10px;
        padding: 4px 8px;
    }

    #clock {
        font-size: 10px;
        min-width: 45px;
    }

    #start-menu {
        width: calc(100vw - 8px);
        left: 4px;
        right: 4px;
        bottom: 54px;
    }

    .window-content {
        font-size: 14px;
    }

    .window-content h2 {
        font-size: 20px;
    }

    .token-table {
        font-size: 12px;
    }

    .contract-box {
        flex-direction: column;
    }

    .contract-box code {
        min-width: auto;
        width: 100%;
        font-size: 10px;
    }

    .quick-links {
        flex-direction: column;
    }

    .quick-links a {
        text-align: center;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */
:focus-visible {
    outline: 2px solid #316AC5;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #316AC5;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   SCROLLBAR (XP Style)
   ============================================ */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #F1EFE2;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #F4F4EE 0%, #D8D8CA 50%, #C0C0B0 100%);
    border: 1px solid #A0A090;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #FFFFFF 0%, #E8E8DA 50%, #D0D0C0 100%);
}

::-webkit-scrollbar-button {
    background: linear-gradient(180deg, #F4F4EE 0%, #D8D8CA 100%);
    border: 1px solid #A0A090;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes windowOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.window.open {
    animation: windowOpen 0.15s ease-out;
}

