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

body {
    font-family: 'Arial Narrow', Arial, sans-serif;
    background: white;
    overflow: hidden;
    transition: background-color 0.3s;
}

.container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    padding: 10px;
    min-height: 100vh;
}

/* Left side - Text section (4 columns) */
.text-section {
    grid-column: 1 / 5;
    overflow-y: auto;
    height: calc(100vh - 20px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.text-section::-webkit-scrollbar {
    display: none;
}

.title {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 20px;
    white-space: nowrap;
}

.title .italic {
    font-style: italic;
    font-weight: bold;
}

.color-list {
    list-style: none;
}

.color-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 0px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.color-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.color-item.selected .color-name,
.color-item.selected .hex-code,
.color-item.selected .rgb-value {
    font-weight: bold;
}

.color-name {
    font-size: 14px;
    font-weight: normal;
}

.hex-code,
.rgb-value {
    font-size: 14px;
    font-weight: normal;
    color: rgba(0, 0, 0, 0.25);
}

/* Right side - Gallery section (6 columns) */
.gallery-section {
    grid-column: 5 / 11;
    overflow-y: auto;
    height: calc(100vh - 20px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-section::-webkit-scrollbar {
    display: none;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.gallery-item {
    aspect-ratio: 5 / 4;
    position: relative;
    overflow: hidden;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Admin delete button */
.gallery-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.gallery-item .delete-btn:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* Mobile header - hidden on desktop */
.mobile-header {
    display: none;
}

/* Bouncing Logo (desktop) */
.bouncing-logo {
    position: fixed;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999;
    user-select: none;
    -webkit-user-select: none;
}

.bouncing-logo span {
    pointer-events: none;
}

/* Color list overlay - hidden on desktop */
.color-list-overlay {
    display: none;
}

/* Color Picker Modal */
.color-picker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.color-picker-modal.active {
    display: flex;
}

.color-picker-content {
    background: white;
    padding: 20px;
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
}

.close-picker-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.color-picker-image-wrap {
    overflow: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    scrollbar-width: none;
}

.color-picker-image-wrap::-webkit-scrollbar {
    display: none;
}

.color-picker-image-wrap canvas {
    max-width: 100%;
    max-height: 60vh;
    cursor: crosshair;
}

.color-picker-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    font-family: 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
}

.preview-swatch {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
}

.confirm-color-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Arial Narrow', Arial, sans-serif;
}

.confirm-color-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================================================
   Mobile Responsive (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 0;
    }

    /* Desktop text section hidden on mobile */
    .text-section {
        display: none;
        grid-column: 1;
    }

    /* Mobile header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        padding: 0 15px;
        background: white;
        z-index: 200;
        border-bottom: 0px solid #e0e0e0;
        grid-column: 1;
    }

    .mobile-title {
        font-family: 'Arial Narrow', Arial, sans-serif;
        font-size: 14px;
        font-weight: normal;
        white-space: nowrap;
    }

    .mobile-title .italic {
        font-style: italic;
        font-weight: bold;
    }

    .mobile-upload-btn {
        width: 36px;
        height: 36px;
        background: #000;
        color: #fff;
        border: none;
        font-family: 'Courier New', monospace;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
        flex-shrink: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-list-toggle {
        background: none;
        border: none;
        font-family: 'Arial Narrow', Arial, sans-serif;
        font-size: 14px;
        cursor: pointer;
        padding: 8px;
        white-space: nowrap;
    }

    /* Bouncing logo hidden on mobile */
    .bouncing-logo {
        display: none;
    }

    /* Gallery section */
    .gallery-section {
        grid-column: 1;
        height: auto;
        padding: 10px;
        padding-top: 60px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Color list overlay (mobile only) */
    .color-list-overlay {
        display: none;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
    }

    .color-list-overlay.active {
        display: block;
    }

    .color-list-overlay-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
    }

    .color-list-overlay-content {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        background: rgba(255, 255, 255, 0.65);
        overflow-y: auto;
        padding: 10px;
        scrollbar-width: none;
    }

    .color-list-overlay-content::-webkit-scrollbar {
        display: none;
    }

    /* Color picker modal mobile */
    .color-picker-content {
        max-width: 95vw;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .color-item {
        font-size: 12px;
    }

    .hex-code,
    .rgb-value {
        font-size: 11px;
    }
}
