/* --- 1. GLOBAL & ATMOSPHERE --- */
body {
    background-color: #0b0f19;
    /* Removed static background-image to allow JS to control it */
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: #cdd6f4;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 14px;
    cursor: url('/assets/normal.png') 0 0, auto;
    margin: 0;
    padding: 0;
    min-height: 94vh;
    overflow-x: hidden;
    transition: background-image 1s ease-in-out;
    /* Smooth transition */
}

::selection {
    background: #ca9ee6;
    color: #111;
}

a {
    color: #f5c2e7;
    text-decoration: none;
    border-bottom: 1px dashed #f5c2e7;
}

a:hover {
    background: #f5c2e7;
    color: #111;
    cursor: url('/assets/hover.png') 0 0, pointer;
}

body::before,
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='50' cy='50' r='40' fill='%23313244' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 800px 400px;
    animation: drift-clouds 60s linear infinite;
}

body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cline x1='50' y1='10' x2='45' y2='30' stroke='%236c7086' stroke-width='1' opacity='0.3'/%3E%3Cline x1='20' y1='50' x2='15' y2='70' stroke='%236c7086' stroke-width='1' opacity='0.2'/%3E%3Cline x1='80' y1='40' x2='75' y2='60' stroke='%236c7086' stroke-width='1' opacity='0.3'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    animation: fall-rain 0.6s linear infinite;
}

@keyframes drift-clouds {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 800px 0;
    }
}

@keyframes fall-rain {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -50px 150px;
    }
}

/* --- 2. LAYOUT --- */
#layout {
    width: 800px;
    margin: 40px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    box-sizing: border-box;
}

.header-box {
    width: 100%;
    text-align: center;
}

.side-box {
    width: 220px;
}

.right-column {
    width: min-content;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-padding {
    padding: 10px;
}

/* --- 3. THE WINDOWS (Refined Catppuccin Box Style) --- */
.box {
    background: rgba(24, 24, 37, 0.85);
    border: 2px solid #8caaee;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    flex: inherit;
}

.box-title {
    font-family: 'DotGothic16', monospace;
    background: #8caaee;
    color: #11111b;
    margin: -15px -15px 15px -15px;
    padding: 6px 15px;
    border-radius: 9px 9px 0 0;
    border-bottom: 2px solid #11111b;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Inside Box Formatting */
.header-box h1 {
    font-family: 'DotGothic16', monospace;
    color: #ca9ee6;
    margin: 0;
    text-shadow: 2px 2px #111;
}

.header-box marquee {
    color: #a6adc8;
    font-size: 12px;
    margin-top: 5px;
    border-top: 1px dashed #45475a;
    padding-top: 5px;
}

.right-column h3 {
    color: #8caaee;
    border-bottom: 1px dotted #8caaee;
    margin-bottom: 5px;
}

.right-column ul {
    list-style-type: square;
    color: #f5c2e7;
    margin-top: 5px;
}

/* Scrollbars */
.scroll-content {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 10px;
}

.scroll-content::-webkit-scrollbar {
    width: 10px;
}

.scroll-content::-webkit-scrollbar-track {
    background: #1e1e2e;
    border: 1px solid #45475a;
}

.scroll-content::-webkit-scrollbar-thumb {
    background: #ca9ee6;
    border: 1px solid #1e1e2e;
}

/* Ensure the box can hold absolute children */
.avatar-box {
    position: relative;
    width: 100%;
    height: 180px;
    background: #111;
    border: 1px solid #45475a;
    margin-bottom: 10px;
    overflow: hidden;
    display: block;
    /* Changed from flex to allow absolute positioning */
}

.avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The text overlay container */
.status-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 5px;
    background: linear-gradient(transparent, rgba(17, 17, 27, 0.9));
    /* Catppuccin Crust color */
    pointer-events: none;
    /* Allows you to still click/drag the box if needed */
}

.status-quote {
    display: block;
    color: #cdd6f4;
    font-size: 10px;
    text-align: center;
    line-height: 1.3;
    text-shadow: 1px 1px 2px #11111b;
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

.status-text {
    font-size: 12px;
    line-height: 1.6;
}

.music-player {
    background: #111;
    border: 1px solid #ca9ee6;
    padding: 8px;
    font-family: 'DotGothic16', monospace;
    font-size: 12px;
    text-align: center;
    color: #ca9ee6;
}

.song-title {
    color: #8caaee;
    margin-top: 4px;
}

.music-btn {
    background: #111;
    border: 1px solid #ca9ee6;
    color: #ca9ee6;
    font-family: 'DotGothic16', monospace;
    margin-top: 5px;
    cursor: pointer;
}

.music-btn:hover {
    background: #ca9ee6;
    color: #111;
}

/* --- 4. THE PLAYLIST WINDOW (OS Style matched to Layout) --- */
.win98-window {
    position: fixed;
    top: 15%;
    left: 20%;
    width: 350px;
    height: 300px;
    background: rgba(24, 24, 37, 0.95);
    border: 2px solid #8caaee;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.win98-title-bar {
    font-family: 'DotGothic16', monospace;
    background: #8caaee;
    color: #11111b;
    margin: -15px -15px 10px -15px;
    padding: 6px 15px;
    border-radius: 9px 9px 0 0;
    border-bottom: 2px solid #11111b;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.win98-controls {
    display: flex;
    gap: 5px;
}

.win98-controls button {
    background: #111;
    border: 1px solid #111;
    color: #8caaee;
    font-family: 'DotGothic16', monospace;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 5px;
}

.win98-controls button:hover {
    background: #cdd6f4;
    color: #111;
}

.win98-content {
    flex-grow: 1;
    background: #11111b;
    border: 1px solid #45475a;
    overflow-y: auto;
    padding: 5px;
}

#music-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: 'DotGothic16', monospace;
}

#music-list li {
    padding: 6px 10px;
    cursor: pointer;
    color: #f5c2e7;
    border-bottom: 1px dashed #313244;
}

#music-list li:hover {
    background: #ca9ee6;
    color: #111;
}

.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
    box-shadow: none;
}

/* Resize Handles */
.resizer {
    position: absolute;
    background: transparent;
}

.resizer-r {
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: e-resize;
}

.resizer-b {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: s-resize;
}

.resizer-rb {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
    z-index: 2;
}


/* --- 5. STAMPS & BLINKIES --- */
.stamp-collection {
    text-align: center;
    margin-top: 5px;
}

.css-stamp {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 88px;
    height: 31px;
    box-sizing: border-box;
    font-family: 'DotGothic16', monospace;
    font-size: 11px;
    margin: 2px;
    text-decoration: none !important;
    border-top: 2px solid #eeeeee;
    border-left: 2px solid #eeeeee;
    border-right: 2px solid #444444;
    border-bottom: 2px solid #444444;
}

.stamp-gremlin {
    background: #11111b;
    color: #a6e3a1;
    border-color: #a6e3a1 #111 #111 #a6e3a1;
}

.stamp-gpu {
    background: #76b900;
    color: #000;
    font-weight: bold;
}

.stamp-audio {
    background: #181825;
    color: #f38ba8;
}

.stamp-portal {
    background: #11111b;
    color: #a6e3a1;
    border-color: #a6e3a1 #111 #111 #a6e3a1;
    font-weight: bold;
    transition: all 0.2s;
}

.stamp-portal:hover {
    background: #a6e3a1;
    color: #111;
    box-shadow: 0 0 8px rgba(166, 227, 161, 0.8);
}

.stamp-valentines {
    position: relative;
    overflow: hidden;
    background: #11111b;
    z-index: 1;
    color: #66c9ff !important;
}

.stamp-valentines::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #9b7dff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%234a72ff' d='M50 20C40.67 8.16 25 15.6 25 31.67c0 14.53 18.06 28.16 25 43.33 6.94-15.17 25-28.8 25-43.33 0-16.07-15.67-23.51-25-11.67Z'/%3E%3C/svg%3E");
    background-size: 16px;
    animation: float-hearts-grid 8s linear infinite;
    z-index: -1;
}

@keyframes float-hearts-grid {
    0% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 100% 0%;
    }
}

.stamp-valentines:hover::before {
    background-color: #f38ba8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23eba0ac' d='M50 20C40.67 8.16 25 15.6 25 31.67c0 14.53 18.06 28.16 25 43.33 6.94-15.17 25-28.8 25-43.33 0-16.07-15.67-23.51-25-11.67Z'/%3E%3C/svg%3E");
}

/* --- MUSIC PLAYER CONTROLS --- */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

#progressBar {
    width: 90%;
    margin-top: 8px;
    accent-color: #ca9ee6;
    /* Colors the filled part of the scrubber */
    cursor: pointer;
    background: #11111b;
}
