/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: "Poppins", sans-serif;
    background: #1e1e1e;
    color: #eee;
    height: 100vh;
    overflow: hidden;
}




/* ================= NAVBAR ================= */

#navbar {
    height: 50px;
    background: #171717;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid #858585;
}

#navbar #toolSettings {
    flex-grow: 1;
    height: 100%;
    display: flex;
    justify-content: center;
}

#navbar #toolSettings .tool-setting:first-of-type {
    border-left: 1px solid #858585;

}

.tool-setting p {
    padding: 12px 6px;

}

#navbar #toolSettings .tool-setting {
    display: flex;
    border-right: 1px solid #858585;
    font-size: 1.2rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#navbar button {
    background: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    padding: 6px;
    margin-right: 6px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
}

#navbar button:hover {
    background: #555;
}

.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

/* ================= APP LAYOUT ================= */
.file-header{
    height: 70px;
    width: 100%;
    display: flex;
    background-color: #2B2B2B;
    border-bottom: 1px solid #858585;

}
.file-header .left-header,
.file-header .right-header{
    flex-grow: 1;
}
.file-header .right-header{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}
.file-header .right-header .btn{
    height: 40px;
    background-color: rgb(17, 131, 24);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 18px;
    font-weight: 500;
    margin-right: 20px;
}
.file-header .right-header .profile{
    height: 40px;
    width: 40px;
    object-fit: cover;
    border: 3px solid #fff;
    background-color: rgb(255, 255, 255);
    border-radius: 100%;
}
.file-header .left-header{
    display: flex;
    align-items: center;
    padding-left: 20px;
}
.file-header .left-header .logo{
object-fit: cover;
    height: 30px;
}
.file-header .left-header .content .top{
    padding-left: 6px;
    font-weight: 500;
    font-size: 1.2rem;
    color: #fff;
}
.file-header .left-header .content{
    height: 50px;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
}
.file-header .left-header .content .bottom{
    display: flex;
    gap: 3px;
    color: #c2c2c2;
}
.file-header .left-header .content .bottom .menu-item{
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: 0.2s ease all;
    position: relative;
}
.file-header .left-header .content .bottom .menu-item:hover{
    background-color: #1d1d1d;
    color: #fff;
}
.menu-item {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
}

.menu-item:hover {
    background: #e0e0e0;
}

.dropdown {
    position: absolute;
    top: 100%;            /* menu-item altı */
    left: 0;
    margin-top: 4px;
width: max-content;
    display: none;
    min-width: 180px;
    

    background: #272727;
    color: #fff;
    border: 1px solid #444;
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
    z-index: 1000;
}

.dropdown div {
    padding: 8px 12px;
    cursor: pointer;
        white-space: nowrap;        /* satır kırılmasını engeller */
    overflow: hidden;           /* taşanı gizler */
    text-overflow: ellipsis;
}

.dropdown div:hover {
    background: #3a3a3a;
}
#app {
    display: grid;
    grid-template-columns: 51px 1fr 260px;
    height: calc(100vh - 120px);
}

/* ================= TOOLBAR ================= */
.left-bar {
    width: 51px;
    border-right: 1px solid #858585;
}

#toolBar {
    background: #2a2a2a;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-auto-rows: 50px;
    gap: 1px;
    height: 100%;
}

#toolBar button {
    background-color: #303030;
    color: #fff;
    font-size: 18px;
    border: none;
    outline: none;
    height: 50px;
    width: 50px;
    transition: 0.2s all ease-in;
    cursor: pointer;
}

#toolBar button:hover {
    background-color: #393939;

}

#toolBar .btn-active {
    background-color: #4d4d4d !important;
}

#toolBar .sub-title {
    font-size: 12px;
    color: #ccc;
}

.color-area {
    width: 100%;
}

.color-area .sub-title {
    padding: 16px 6px 6px;
    color: #fff;
    text-align: center;
}

.color-area .pallette-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

}

.color-area .pallette-container .color-item {
    aspect-ratio: 1/1;
    border: 1px solid #858585;

    background-color: red;
}

/*
#toolBar input[type="color"] {
    width: 100%;
    height: 32px;
    border: none;
    padding: 0;
    cursor: pointer;
}*/
.color-area #colorPicker {
    -webkit-appearance: none;
    /* Chrome, Safari */
    -moz-appearance: none;
    /* Firefox */
    appearance: none;
    /* Genel */
    width: 100%;
    height: 100px;
    border: none;
    border-bottom: 1px solid #858585;

    padding: 0;
    cursor: pointer;
    background-color: #000;
    /* fallback arkaplan */
}

/* Webkit tarayıcılar için renk kutusunun içini doldur */
.color-area #colorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-area #colorPicker::-webkit-color-swatch {
    border: none;
}

/* Firefox için renk kutusu */
.color-area #colorPicker::-moz-color-swatch {
    border: none;
}


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

#canvasContainer {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ff0000;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas {
    background: #9e9e9e;
    image-rendering: pixelated;
    image-rendering: crisp-edges;



    /* Mouse doğru çalışsın */
    cursor: crosshair;
}

.right-panel{
    height: calc(100vh - 120px);
}
/* ================= LAYERS ================= */

#layers {
    background: #2a2a2a;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 400px);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #444;
    font-weight: bold;
}

.layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #444;
    font-weight: bold;
}

.layers-header button {
    background: #3a3a3a;
    color: #fff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
}

#layerList {
    list-style: none;
    overflow-y: auto;
    padding: 6px;
    flex: 1;
}

/* ================= LAYER ITEM ================= */

.layer {
    background: #333;
    border: 1px solid #444;
    margin-bottom: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
}

.layer.active {
    outline: 2px solid #4aa3ff;
}

.layer.dragging {
    opacity: 0.5;
}

.drag-handle {
    width: 16px;
    background: #000;
    cursor: grab;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle::after {
    content: "⋮⋮";
    color: #666;
    display: block;
    text-align: center;
    line-height: 24px;
}

.layer-body {
    flex: 1;
    padding: 6px;
}

.layer-controls select,
.layer-controls input {
    width: 100%;
}

.layer-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.layer-top button {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
}

.layer-top button:hover {
    color: #fff;
}

.layer-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================= LAYER CONTROLS ================= */

.layer-controls {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-controls label {
    font-size: 11px;
    color: #bbb;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layer-controls input[type="range"] {
    width: 100%;
}

.layer-controls select {
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #444;
    padding: 2px;
    font-size: 12px;
}

/* ================= SCROLLBAR ================= */

#layerList::-webkit-scrollbar {
    width: 6px;
}

#layerList::-webkit-scrollbar-thumb {
    background: #555;
}

#layerList::-webkit-scrollbar-track {
    background: #222;
}
.export-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.export-box {
    background: #1e1e1e;
    color: #fff;
    padding: 20px;
    width: 320px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-box label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.export-box .actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
/* =========================
   MODAL OVERLAY
========================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.75);
    backdrop-filter: blur(6px);

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

    z-index: 1000;
}

/* =========================
   MODAL BOX
========================= */
.modal-box {
    background: #141827;
    color: #e6e8ef;

    min-width: 320px;
    max-width: 90vw;
    padding: 20px;

    border-radius: 12px;

    box-shadow:
        0 10px 40px rgba(0,0,0,0.5),
        inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* =========================
   TITLE
========================= */
.modal-box h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
}

/* =========================
   FORM ELEMENTS
========================= */
.modal-box label {
    display: block;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.modal-box input,
.modal-box select {
    width: 100%;
    background: #0f1320;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 10px;
    color: #fff;
    font-size: 14px;
}

.modal-box input:focus,
.modal-box select:focus {
    outline: none;
    border-color: #4f8cff;
}

/* =========================
   BUTTONS
========================= */
.modal-box button {
    margin-top: 16px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;

    background: #2a2f45;
    color: #fff;
}

.modal-box button:hover {
    filter: brightness(1.1);
}

#grid-apply {
    background: #4f8cff;
    margin-right: 8px;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-box {
    background: #111;
    padding: 20px;
    border-radius: 10px;
    color: white;
}
