/*
 * White House Gardens
 * Garden Visualiser
 *
 * Stage 1 stylesheet
 */


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #111;

    color: #eee;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}


/* =========================================================
   APPLICATION
   ========================================================= */

.simulator-app {
    width: 100%;
    min-height: 100vh;

    background: #111;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   HEADER
   ========================================================= */

.simulator-header {
    width: 100%;

    background: #181818;

    border-bottom: 1px solid #303030;

    flex-shrink: 0;
}

.header-inner {
    width: 100%;

    max-width: 1800px;

    min-height: 72px;

    margin: 0 auto;

    padding: 12px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    flex-direction: column;

    text-decoration: none;

    color: #fff;

    line-height: 1.1;
}

.brand-name {
    font-size: 21px;

    font-weight: 700;

    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin-top: 4px;

    font-size: 12px;

    color: #aaa;

    letter-spacing: 0.8px;

    text-transform: uppercase;
}


/* =========================================================
   HEADER BUTTON
   ========================================================= */

.header-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}

.header-button {
    border: 1px solid #555;

    background: #222;

    color: #eee;

    border-radius: 6px;

    padding: 9px 15px;

    font-size: 14px;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.header-button:hover:not(:disabled) {
    background: #2d2d2d;

    border-color: #777;
}

.header-button:disabled {
    opacity: 0.45;

    cursor: default;
}


/* =========================================================
   MAIN
   ========================================================= */

.simulator-main {
    flex: 1;

    width: 100%;

    min-height: 0;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   WELCOME SCREEN
   ========================================================= */

.welcome-screen {
    flex: 1;

    min-height: calc(100vh - 73px);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 40px 20px;
}

.welcome-content {
    width: 100%;

    max-width: 620px;

    text-align: center;
}


/* =========================================================
   WELCOME LOGO
   ========================================================= */

.welcome-logo {
    width: 64px;

    height: 64px;

    margin: 0 auto 22px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #666;

    border-radius: 50%;

    color: #fff;

    font-size: 15px;

    font-weight: 700;

    letter-spacing: 1px;
}


/* =========================================================
   WELCOME TEXT
   ========================================================= */

.welcome-content h1 {
    margin: 0;

    color: #fff;

    font-size: 38px;

    font-weight: 600;

    line-height: 1.2;
}

.welcome-content > p {
    max-width: 520px;

    margin: 16px auto 32px;

    color: #aaa;

    font-size: 16px;

    line-height: 1.6;
}


/* =========================================================
   UPLOAD AREA
   ========================================================= */

.upload-area {
    width: 100%;

    padding: 44px 30px;

    border: 2px dashed #4a4a4a;

    border-radius: 10px;

    background: #181818;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #888;

    background: #1d1d1d;
}

.upload-icon {
    width: 48px;

    height: 48px;

    margin: 0 auto 18px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #666;

    border-radius: 50%;

    color: #ddd;

    font-size: 27px;

    font-weight: 300;
}

.upload-area h2 {
    margin: 0;

    color: #fff;

    font-size: 21px;

    font-weight: 600;
}

.upload-area p {
    margin: 10px auto 22px;

    color: #999;

    font-size: 14px;

    line-height: 1.5;
}

.upload-area .upload-note {
    margin: 18px 0 0;

    color: #666;

    font-size: 12px;
}


/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

.primary-button {
    border: 1px solid #ddd;

    background: #eee;

    color: #111;

    border-radius: 6px;

    padding: 11px 21px;

    font-size: 14px;

    font-weight: 600;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.primary-button:hover {
    background: #fff;

    border-color: #fff;
}


/* =========================================================
   EDITOR
   ========================================================= */

.editor {
    width: 100%;

    height: calc(100vh - 73px);

    min-height: 600px;

    display: grid;

    grid-template-columns:
        330px
        minmax(0, 1fr);

    overflow: hidden;
}


/* =========================================================
   PRODUCT PANEL
   ========================================================= */

.product-panel {
    min-width: 0;

    height: 100%;

    background: #181818;

    border-right: 1px solid #303030;

    display: flex;

    flex-direction: column;

    overflow: hidden;

    z-index: 20;
}


/* =========================================================
   PANEL HEADER
   ========================================================= */

.panel-header {
    padding: 20px;

    border-bottom: 1px solid #303030;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

    flex-shrink: 0;
}

.panel-header h2 {
    margin: 0;

    color: #fff;

    font-size: 20px;

    font-weight: 600;
}

.panel-header p {
    margin: 5px 0 0;

    color: #888;

    font-size: 12px;

    line-height: 1.4;
}

.panel-close-button {
    display: none;

    width: 34px;

    height: 34px;

    padding: 0;

    border: 1px solid #444;

    background: #222;

    color: #ddd;

    border-radius: 5px;

    font-size: 23px;

    line-height: 1;
}


/* =========================================================
   CATEGORY SECTION
   ========================================================= */

.category-section {
    padding: 15px 15px 10px;

    flex-shrink: 0;

    border-bottom: 1px solid #303030;
}

.section-heading {
    margin: 0 5px 9px;

    color: #777;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;
}

.category-list {
    max-height: 260px;

    overflow-y: auto;

    padding-right: 3px;
}


/* =========================================================
   CATEGORY BUTTON
   ========================================================= */

.category-button {
    width: 100%;

    display: block;

    padding: 9px 10px;

    margin: 0 0 2px;

    border: 0;

    border-radius: 5px;

    background: transparent;

    color: #bbb;

    text-align: left;

    font-size: 13px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.category-button:hover {
    background: #242424;

    color: #fff;
}

.category-button.active {
    background: #303030;

    color: #fff;
}

.category-child {
    padding-left: 25px;

    font-size: 12px;

    color: #999;
}


/* =========================================================
   PRODUCTS SECTION
   ========================================================= */

.products-section {
    flex: 1;

    min-height: 0;

    padding: 15px;

    overflow-y: auto;
}

.products-section > .section-heading {
    display: flex;

    align-items: center;

    justify-content: space-between;
}

.product-count {
    display: inline-flex;

    min-width: 22px;

    height: 20px;

    padding: 0 6px;

    align-items: center;

    justify-content: center;

    border-radius: 10px;

    background: #303030;

    color: #aaa;

    font-size: 10px;

    font-weight: 600;
}


/* =========================================================
   PRODUCT GRID
   ========================================================= */

.products-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
}


/* =========================================================
   PRODUCT CARD
   ========================================================= */

.product-card {
    min-width: 0;

    padding: 0;

    border: 1px solid #303030;

    border-radius: 6px;

    overflow: hidden;

    background: #202020;

    color: #eee;

    text-align: left;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.product-card:hover {
    border-color: #666;

    background: #272727;

    transform: translateY(-1px);
}


/* =========================================================
   PRODUCT IMAGE
   ========================================================= */

.product-image {
    width: 100%;

    aspect-ratio: 1 / 1;

    background: #292929;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;
}

.product-image img {
    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;
}

.product-no-image {
    color: #666;

    font-size: 11px;
}


/* =========================================================
   PRODUCT INFORMATION
   ========================================================= */

.product-information {
    padding: 9px;
}

.product-information h3 {
    margin: 0;

    color: #eee;

    font-size: 12px;

    font-weight: 600;

    line-height: 1.35;
}

.product-description {
    margin: 5px 0 0;

    color: #888;

    font-size: 10px;

    line-height: 1.4;

    display: -webkit-box;

    -webkit-line-clamp: 3;

    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =========================================================
   CANVAS AREA
   ========================================================= */

.canvas-area {
    min-width: 0;

    min-height: 0;

    position: relative;

    display: flex;

    flex-direction: column;

    background: #0d0d0d;

    overflow: hidden;
}


/* =========================================================
   CANVAS TOOLBAR
   ========================================================= */

.canvas-toolbar {
    min-height: 52px;

    padding: 8px 15px;

    background: #151515;

    border-bottom: 1px solid #303030;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    flex-shrink: 0;

    z-index: 10;
}

.toolbar-left,
.toolbar-right {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}

.canvas-status {
    color: #888;

    font-size: 12px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.toolbar-button {
    padding: 7px 12px;

    border: 1px solid #444;

    border-radius: 5px;

    background: #222;

    color: #ccc;

    font-size: 12px;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.toolbar-button:hover:not(:disabled) {
    background: #2d2d2d;

    border-color: #666;
}

.toolbar-button:disabled {
    opacity: 0.4;

    cursor: default;
}


/* =========================================================
   CANVAS WRAPPER
   ========================================================= */

.canvas-wrapper {
    flex: 1;

    min-height: 0;

    min-width: 0;

    padding: 10px;

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: auto;

    background:
        radial-gradient(
            circle at center,
            #181818 0,
            #101010 55%,
            #0b0b0b 100%
        );
}


/* =========================================================
   KONVA CANVAS
   ========================================================= */

.garden-canvas {
    position: relative;

    display: block;

    flex-shrink: 0;

    box-shadow:
        0 8px 35px rgba(0, 0, 0, 0.45);
}

.garden-canvas canvas {
    display: block;
}


/* =========================================================
   CANVAS PLACEHOLDER
   ========================================================= */

.canvas-placeholder {
    position: absolute;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    text-align: center;

    color: #666;

    pointer-events: none;

    z-index: 1;
}

.placeholder-icon {
    width: 44px;

    height: 44px;

    margin: 0 auto 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #444;

    border-radius: 50%;

    color: #777;

    font-size: 24px;
}

.canvas-placeholder p {
    margin: 0;

    font-size: 13px;
}


/* =========================================================
   CANVAS HELP
   ========================================================= */

.canvas-help {
    min-height: 36px;

    padding: 8px 15px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #151515;

    border-top: 1px solid #303030;

    color: #666;

    font-size: 11px;

    flex-shrink: 0;
}


/* =========================================================
   MOBILE PRODUCT BUTTON
   ========================================================= */

.mobile-products-button {
    display: none;

    position: absolute;

    top: 10px;

    left: 10px;

    z-index: 30;

    padding: 9px 14px;

    border: 1px solid #555;

    border-radius: 6px;

    background: rgba(24, 24, 24, 0.95);

    color: #eee;

    font-size: 13px;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    background: rgba(0, 0, 0, 0.7);

    display: flex;

    align-items: center;

    justify-content: center;
}

.loading-box {
    min-width: 180px;

    padding: 24px;

    border: 1px solid #444;

    border-radius: 8px;

    background: #1b1b1b;

    text-align: center;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5);
}

.loading-box p {
    margin: 14px 0 0;

    color: #bbb;

    font-size: 13px;
}


/* =========================================================
   LOADING SPINNER
   ========================================================= */

.loading-spinner {
    width: 28px;

    height: 28px;

    margin: 0 auto;

    border: 3px solid #444;

    border-top-color: #ddd;

    border-radius: 50%;

    animation:
        simulator-spin 0.8s linear infinite;
}

@keyframes simulator-spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   MESSAGES
   ========================================================= */

.loading-message,
.empty-message,
.empty-products,
.error-message {
    padding: 15px 10px;

    color: #777;

    font-size: 12px;

    line-height: 1.5;

    text-align: center;
}

.error-message {
    color: #b99;
}


/* =========================================================
   NOTIFICATION
   ========================================================= */

.notification {
    position: fixed;

    right: 20px;

    bottom: 20px;

    z-index: 1100;

    max-width: 420px;

    border: 1px solid #555;

    border-radius: 7px;

    background: #202020;

    color: #ddd;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.45);
}

.notification-content {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 12px 13px 12px 15px;
}

.notification-content span {
    font-size: 13px;

    line-height: 1.45;
}

.notification-content button {
    width: 28px;

    height: 28px;

    padding: 0;

    flex-shrink: 0;

    border: 0;

    background: transparent;

    color: #aaa;

    font-size: 21px;

    line-height: 1;
}

.notification-content button:hover {
    color: #fff;
}


/* =========================================================
   SCROLLBARS
   ========================================================= */

.category-list::-webkit-scrollbar,
.products-section::-webkit-scrollbar,
.canvas-wrapper::-webkit-scrollbar {
    width: 7px;

    height: 7px;
}

.category-list::-webkit-scrollbar-track,
.products-section::-webkit-scrollbar-track,
.canvas-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.category-list::-webkit-scrollbar-thumb,
.products-section::-webkit-scrollbar-thumb,
.canvas-wrapper::-webkit-scrollbar-thumb {
    background: #3b3b3b;

    border-radius: 4px;
}

.category-list::-webkit-scrollbar-thumb:hover,
.products-section::-webkit-scrollbar-thumb:hover,
.canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* =========================================================
   HIDDEN ATTRIBUTE
   ========================================================= */

[hidden] {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .editor {
        grid-template-columns:
            280px
            minmax(0, 1fr);
    }

    .header-inner {
        padding-left: 18px;

        padding-right: 18px;
    }

    .products-grid {
        grid-template-columns:
            1fr;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .simulator-header {
        position: relative;

        z-index: 50;
    }


    .header-inner {
        min-height: 60px;

        padding: 10px 14px;
    }


    .brand-name {
        font-size: 17px;
    }


    .brand-subtitle {
        font-size: 10px;
    }


    .header-button {
        padding: 7px 10px;

        font-size: 12px;
    }


    /* ---------------------------------------------
       Welcome
       --------------------------------------------- */

    .welcome-screen {
        min-height: calc(100vh - 61px);

        padding: 25px 15px;
    }


    .welcome-content h1 {
        font-size: 30px;
    }


    .welcome-content > p {
        font-size: 14px;

        margin-bottom: 25px;
    }


    .upload-area {
        padding: 35px 20px;
    }


    /* ---------------------------------------------
       Editor
       --------------------------------------------- */

    .editor {
        position: relative;

        display: block;

        height: calc(100vh - 61px);

        min-height: 0;

        overflow: hidden;
    }


    /* ---------------------------------------------
       Product panel
       --------------------------------------------- */

    .product-panel {
        position: absolute;

        top: 0;

        left: 0;

        bottom: 0;

        width: min(340px, 88vw);

        transform:
            translateX(-105%);

        transition:
            transform 0.2s ease;

        box-shadow:
            8px 0 30px rgba(0, 0, 0, 0.5);

        z-index: 100;
    }


    .product-panel.mobile-open {
        transform:
            translateX(0);
    }


    .panel-close-button {
        display: block;
    }


    /* ---------------------------------------------
       Canvas
       --------------------------------------------- */

    .canvas-area {
        width: 100%;

        height: 100%;
    }


    .mobile-products-button {
        display: block;
    }


    .canvas-toolbar {
        padding-left: 10px;

        padding-right: 10px;
    }


    .canvas-status {
        max-width: 190px;
    }


    .canvas-wrapper {
        padding: 5px;
    }


    .canvas-help {
        display: none;
    }


    /* ---------------------------------------------
       Notification
       --------------------------------------------- */

    .notification {
        right: 10px;

        bottom: 10px;

        left: 10px;

        max-width: none;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .welcome-content h1 {
        font-size: 27px;
    }


    .upload-area h2 {
        font-size: 18px;
    }


    .upload-area {
        padding: 30px 15px;
    }


    .canvas-status {
        max-width: 150px;

        font-size: 11px;
    }


    .toolbar-button {
        padding: 6px 9px;

        font-size: 11px;
    }

}