/* Reset & Dasar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Space Mono', monospace;
    background: url('img/background (8).png') no-repeat center top fixed;
    background-size: cover;
    color: #000;
    cursor: url('img/icons/homepage_cursor.png'), auto;
    min-height: 100vh;
}

a,
button,
.nav-item,
.color-swatch,
.tool-btn {
    cursor: url('img/icons/homepage_cursor.png'), pointer;
}

/* =========================================
   NAVBAR (sama dengan index.html)
========================================= */
.top-nav {
    width: 100%;
    padding: 15px 0 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 100;
}

.nav-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 1200px;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: black;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    padding: 5px 10px;
    width: auto;
    min-width: 100px;
    text-align: center;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.nav-item.active {
    border: 1px solid #a450ff;
    background-color: rgba(164, 80, 255, 0.2);
}

.nav-item img {
    width: 65px;
    height: auto;
    margin-bottom: 5px;
}

.marquee-container {
    background-color: #FFFF00;
    /* Brutalist Electric Yellow */
    background-image:
        linear-gradient(45deg, #d4d400 25%, transparent 25%, transparent 75%, #d4d400 75%, #d4d400),
        linear-gradient(45deg, #d4d400 25%, transparent 25%, transparent 75%, #d4d400 75%, #d4d400);
    background-size: 8px 8px;
    /* Pixelated grid pattern */
    background-position: 0 0, 4px 4px;
    color: #000000;
    font-family: 'VT323', monospace;
    /* Pixelated font */
    font-weight: normal;
    padding: 12px 10px;
    font-size: 26px;
    /* Disesuaikan agar lebih jelas */
    margin-top: 15px;
    border-top: 4px solid #000;
    border-bottom: 4px solid #000;
    box-shadow: 0px 6px 0px rgba(0, 0, 0, 1);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0px #FFF;
    /* Agar teks menonjol di atas pattern pixel */
}

/* =========================================
   MAIN AREA
========================================= */
main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px 50px;
}

/* =========================================
   PAINT WINDOW (UI Utama)
========================================= */
.paint-window {
    background: #d4d0c8;
    /* Warna abu klasik Windows */
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    /* Border 3D efek XP */
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    width: 95vw;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    user-select: none;
}

/* Title Bar */
.paint-titlebar {
    background: linear-gradient(to right, #0a246a, #3a6ea5);
    color: white;
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

.paint-title {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.paint-window-controls {
    display: flex;
    gap: 2px;
}

.wc-btn {
    background: #d4d0c8;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    color: black;
    width: 20px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.wc-close {
    color: #8b0000;
}

/* Toolbar */
.paint-toolbar {
    background: #d4d0c8;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #808080;
    flex-wrap: wrap;
}

.tool-group {
    display: flex;
    gap: 3px;
    border: 1px inset #808080;
    padding: 3px;
    background: #c8c5be;
}

.tool-btn {
    background: #d4d0c8;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    min-width: 28px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #000;
}

.tool-btn:active,
.tool-btn.active {
    border-color: #808080 #ffffff #ffffff #808080;
    background: #b8b5ae;
}

.tool-btn.danger {
    color: #8b0000;
}

/* Color Palette */
.color-palette {
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-colors {
    position: relative;
    width: 34px;
    height: 30px;
}

.color-preview {
    width: 22px;
    height: 22px;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    position: absolute;
}

.color-preview.secondary {
    background: #ffffff;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.color-preview.primary {
    background: #000000;
    top: 0;
    left: 0;
    z-index: 2;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(10, 18px);
    grid-template-rows: repeat(2, 18px);
    gap: 1px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border: 1px solid #808080;
    transition: transform 0.1s;
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: #ffffff;
    z-index: 10;
    position: relative;
}

/* Size Control */
.size-control {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.size-label {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.size-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 8px;
    background: #a8a5a0;
    border: 1px inset #808080;
    border-radius: 0;
    outline: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 18px;
    background: #d4d0c8;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    cursor: pointer;
}

.size-display {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

/* Canvas Area */
.canvas-wrapper {
    background: #808080;
    padding: 4px;
    overflow: auto;
    border-top: 2px inset #a8a5a0;
    border-bottom: 2px inset #a8a5a0;
    display: flex;
    justify-content: center;
}

#paint-canvas {
    background: #ffffff;
    display: block;
    cursor: crosshair;
    width: 100%;
    max-width: 1000px;
    height: auto;
    /* Garis-garis horisontal seperti di screenshot */
    background-image: repeating-linear-gradient(to bottom,
            transparent,
            transparent 15px,
            rgba(0, 0, 0, 0.03) 15px,
            rgba(0, 0, 0, 0.03) 16px);
}

/* Status Bar */
.paint-statusbar {
    padding: 3px 8px;
    background: #d4d0c8;
    border-top: 1px solid #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #333;
}

.statusbar-credit {
    color: #555;
    font-style: italic;
}

/* =========================================
   MOBILE RESPONSIVE (Fix Navbar & UI)
========================================= */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .top-nav {
        padding: 10px 5px;
    }

    .nav-icons {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
        padding: 0 5px;
    }

    .nav-item {
        min-width: 0;
        width: 100%;
        font-size: 11px;
        padding: 5px 2px;
    }

    .nav-item img {
        width: 45px;
    }

    .marquee-container {
        font-size: 18px;
        padding: 8px 5px;
    }

    /* Paint Window Mobile Fixes */
    .paint-window {
        width: 98vw;
        margin: 0 auto;
    }

    .paint-toolbar {
        gap: 5px;
        padding: 4px;
    }

    .tool-btn {
        padding: 2px 5px;
        min-width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .color-swatches {
        grid-template-columns: repeat(10, 15px);
        grid-template-rows: repeat(2, 15px);
    }

    .color-swatch {
        width: 15px;
        height: 15px;
    }

    .size-slider {
        width: 60px;
    }

    .paint-title {
        font-size: 10px;
    }
}