/* ================================================= */
/* BASE */
/* ================================================= */

* {
    box-sizing: border-box;
}

html,
body {

    margin: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #1e293b;

    color: #222;
}


/* ================================================= */
/* APPLICATION */
/* ================================================= */

.app {

    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;

}


/* ================================================= */
/* BARRE OUTILS */
/* ================================================= */

.toolbar {

    min-height: 64px;

    background: #ffffff;

    border-bottom: 1px solid #d1d5db;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 8px 12px;

    z-index: 10;

    box-shadow:
        0 2px 8px rgba(0,0,0,.12);

}


.toolbar-title {

    font-weight: bold;

    font-size: 17px;

    white-space: nowrap;

    margin-right: 8px;

}


.toolbar-title span {

    display: block;

    font-size: 11px;

    color: #777;

    font-weight: normal;

}


.toolbar-group {

    display: flex;

    align-items: center;

    gap: 6px;

    padding-right: 10px;

    border-right: 1px solid #ddd;

}


.toolbar-group:last-child {

    border-right: none;

}


.tool-button,
.action-group button {

    width: 42px;
    height: 42px;

    border: 1px solid #d1d5db;

    border-radius: 7px;

    background: #f8fafc;

    color: #222;

    font-size: 20px;

    cursor: pointer;

}


.tool-button:hover,
.action-group button:hover {

    background: #e5efff;

    border-color: #3978d3;

}


.tool-button.active {

    background: #3978d3;

    color: white;

    border-color: #3978d3;

}


.settings-group {

    font-size: 12px;

    color: #555;

}


.settings-group label {

    display: flex;

    align-items: center;

    gap: 5px;

    white-space: nowrap;

}


.settings-group input[type="color"] {

    width: 34px;
    height: 32px;

    padding: 2px;

    border: 1px solid #ccc;

    border-radius: 5px;

    cursor: pointer;

}


.settings-group input[type="range"] {

    width: 90px;

}


.settings-group input[type="number"] {

    width: 60px;

    padding: 7px;

    border: 1px solid #ccc;

    border-radius: 5px;

}


#lineWidthValue {

    width: 35px;

}


.export-button {

    width: auto !important;

    padding: 0 15px;

    background: #16a34a !important;

    color: white !important;

    border-color: #16a34a !important;

    font-size: 14px !important;

}


/* ================================================= */
/* WORKSPACE */
/* ================================================= */

.workspace {

    flex: 1;

    min-height: 0;

    display: flex;

}


/* ================================================= */
/* SIDEBAR */
/* ================================================= */

.sidebar {

    width: 260px;

    flex-shrink: 0;

    background: #ffffff;

    border-right: 1px solid #d1d5db;

    overflow-y: auto;

}


.sidebar-section {

    padding: 18px;

    border-bottom: 1px solid #e5e7eb;

}


.sidebar-section h2 {

    font-size: 16px;

    margin: 0 0 14px;

}


.primary-button,
.secondary-button {

    width: 100%;

    padding: 11px;

    border: 0;

    border-radius: 6px;

    cursor: pointer;

    font-size: 14px;

    margin-bottom: 8px;

}


.primary-button {

    background: #3978d3;

    color: white;

}


.primary-button:hover {

    background: #2865bd;

}


.secondary-button {

    background: #e5e7eb;

    color: #333;

}


.secondary-button:hover {

    background: #d1d5db;

}


/* ================================================= */
/* OBJETS */
/* ================================================= */

.object-list {

    display: flex;

    flex-direction: column;

    gap: 5px;

}


.empty-objects {

    color: #888;

    font-size: 13px;

    text-align: center;

    padding: 15px 5px;

}


.object-item {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 9px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;

    border-radius: 6px;

    cursor: pointer;

    font-size: 13px;

}


.object-item:hover {

    background: #eef6ff;

}


.object-item.selected {

    background: #dbeafe;

    border-color: #3978d3;

}


.object-icon {

    width: 25px;

    text-align: center;

    font-size: 17px;

}


.object-name {

    flex: 1;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

}


/* ================================================= */
/* AIDE */
/* ================================================= */

.help p {

    font-size: 12px;

    color: #666;

    line-height: 1.45;

    margin: 8px 0;

}


/* ================================================= */
/* CANVAS AREA */
/* ================================================= */

.canvas-area {

    flex: 1;

    min-width: 0;

    min-height: 0;

    display: flex;

    flex-direction: column;

    background: #334155;

}


/* ================================================= */
/* ZONE CANVAS */
/* ================================================= */

.canvas-drop {

    flex: 1;

    min-height: 0;

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    overflow: hidden;

    background:

        repeating-conic-gradient(
            #3b4757 0% 25%,
            #334155 0% 50%
        )
        50% / 24px 24px;

}


.canvas-drop.dragover {

    background-color: #1d4ed8;

}


#canvas {

    display: none;

    max-width: 100%;

    max-height: 100%;

    box-shadow:
        0 5px 25px rgba(0,0,0,.35);

    touch-action: none;

    user-select: none;

}


.canvas-drop.has-image #canvas {

    display: block;

}


/* ================================================= */
/* MESSAGE VIDE */
/* ================================================= */

.empty-message {

    text-align: center;

    color: white;

    opacity: .9;

}


.empty-icon {

    font-size: 70px;

    margin-bottom: 15px;

}


.empty-message h2 {

    margin: 0 0 8px;

}


.empty-message p {

    margin: 6px 0;

    color: #dbeafe;

}


.formats {

    font-size: 13px;

    opacity: .7;

}


/* ================================================= */
/* STATUS */
/* ================================================= */

.status-bar {

    height: 32px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 0 12px;

    background: #111827;

    color: #d1d5db;

    font-size: 12px;

}


.status-bar span {

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

}


/* ================================================= */
/* MOBILE */
/* ================================================= */

@media (max-width: 900px) {

    .toolbar {

        flex-wrap: wrap;

        overflow-y: auto;

        max-height: 150px;

    }

    .toolbar-title {

        display: none;

    }

    .settings-group {

        border-right: none;

    }

    .sidebar {

        width: 210px;

    }

}


@media (max-width: 650px) {

    .sidebar {

        display: none;

    }

    .toolbar {

        gap: 5px;

    }

    .settings-group label {

        font-size: 10px;

    }

    .toolbar-group {

        padding-right: 4px;

    }

    .tool-button,
    .action-group button {

        width: 36px;
        height: 36px;

    }

    .export-button {

        padding: 0 8px;

    }

}
