* {
    box-sizing: border-box;
    font-family: Arial;
}

body {
    margin: 0;
    background: #dfe4ea;
}

/* TOP BAR */
.top-bar {
    height: 56px;
    background: #1e1e2f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid #3a3a4a;
}

/* GROUPS */
.groups {
    list-style: none;
    padding: 6px;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 6px;
    border-bottom: 1px solid #444;
}

.groups button {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: #ffffff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .15s;
}

.groups button.active,
.groups button:hover {
    background: #a29bfe;
}

/* ===============================
   RIDER OPTIONS STYLES
================================ */
.rider-options-btn {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 20px;
    /* background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); */
    border-radius: 12px;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); */
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    /* backdrop-filter: blur(10px); */
    /* -webkit-backdrop-filter: blur(10px); */
    margin: 10px;
}

.rider-options-btn button {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /*min-width: 120px;*/
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.rider-options-btn button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f639e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.rider-options-btn button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.rider-options-btn input[type="file"] {
    display: none; /* Gizle, custom button kullanacağız */
}

/* Custom file upload button */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.file-upload-btn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.file-upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

/* Fullscreen button özel stili */
.rider-options-btn .fullscreen-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.rider-options-btn .fullscreen-btn:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

/* Responsive tasarım */
@media (max-width: 768px) {
    .rider-options-btn {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        gap: 8px;
    }
    
    .rider-options-btn button {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Button ikonları */
.rider-options-btn button::before {
    font-size: 16px;
}

/* Hover efekti için border */
.rider-options-btn button {
    position: relative;
    overflow: hidden;
}

.rider-options-btn button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.rider-options-btn button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* MAIN LAYOUT */
.main {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* LEFT SIDE */
.left-side {
    width: 120px;
    background: #2f3542;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3d3d4f;
}

/* NAVBARS */
.navbars {
    flex: 1;
}

.navbar {
    display: none;
    padding: 10px 6px;
}

.navbar.active {
    display: block;
}

/* NAV BUTTONS */
.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    background: #f5f5f5;
    font-size: 12px;
}

.nav-btn.active {
    background: #a29bfe;
    color: #fff;
}

/* ITEMS WRAPPER */
.items-wrapper {
    display: flex;
    position: relative;
    min-width: 0;
}

/* ITEMS */
.items {
    width: 380px;
    min-width: 380px;
    max-width: 380px;
    padding: 7px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 96px;
    gap: 7px;
    overflow-y: auto;
    background: #dcdceb70;
    border-right: 6px solid #cfcfcf;
    transition: width .25s ease, padding .25s ease, opacity .2s;
    position: relative;
}

.items.closed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
    border-right: none;
}

/* ITEM */
.item {
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
    touch-action: manipulation;
}

.item img {
    max-width: 100%;
    max-height: 92px;
    object-fit: contain;
    pointer-events: none;
}

/* TOGGLE BUTTON */
.sidebar__toggle {
    position: absolute;
    top: 20%;
    left: calc(394px - 14px);
    transform: translateY(-50%);
    width: 28px;
    height: 48px;
    background: #2f3542;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 30;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .25);
    transition: .25s;
}

.items.closed + .sidebar__toggle {
    left: 0px;
}

.items.closed + .sidebar__toggle svg {
    transform: rotate(180deg);
}

/* STAGE AREA */
.stage-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* PLOT HEADER */
.plot__header {
    height: 48px;
    background: #1e1e2f;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-bottom: 1px solid #3a3a4a;
    flex-shrink: 0;
    position: relative;
    z-index: 80;
}

.plot__header .button {
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: none;
    background: #2f3542;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: .15s;
    font-size: 12px;
}

.plot__header .button:hover {
    background: #3d3d5c;
}

.btn_multiselect {
    font-weight: 600;
}

.btn_multiselect.active {
    background: linear-gradient(135deg, #6f42ff 0%, #4a6fa5 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 0 3px rgba(111,66,255,0.18);
}

.plot__header.multi-select-active {
    box-shadow: inset 0 -1px 0 rgba(111, 66, 255, 0.35);
    background: linear-gradient(180deg, #1e1e2f 0%, #252540 100%);
}

.undo_buttons {
    display: flex;
    gap: 6px;
}

.align_action_btn {
    min-width: 44px;
    padding: 0 8px !important;
    font-size: 11px !important;
    white-space: nowrap;
    flex: 0 0 auto;
}

.plot__header .button:disabled,
.plot__header .button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: #2a3040;
    color: rgba(255,255,255,0.72);
}

.arrange_menu_wrap {
    position: relative;
}

.arrange_menu_btn.has-selection {
    box-shadow: 0 0 0 1px rgba(125, 115, 255, 0.18);
}

.arrange_menu_btn[aria-expanded="true"] {
    background: linear-gradient(135deg, #6f42ff 0%, #4a6fa5 100%);
}

.arrange_menu_panel {
    position: fixed;
    top: 70px;
    left: 12px;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #202437;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
    padding: 12px;
    display: none;
    z-index: 200;
}

.arrange_menu_panel.is-open {
    display: block;
}

.arrange_menu_header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.arrange_menu_title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.arrange_menu_hint {
    margin-top: 4px;
    color: rgba(255,255,255,0.68);
    font-size: 12px;
    line-height: 1.4;
}

.arrange_menu_close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.arrange_menu_close:hover {
    background: rgba(255,255,255,0.12);
}

.arrange_group + .arrange_group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.arrange_group_title {
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.arrange_group_buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.arrange_group_buttons .align_action_btn {
    min-width: 78px;
    flex: 1 1 calc(50% - 4px);
}

@media (max-width: 768px) {
    .arrange_menu_panel {
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: min(62vh, 460px);
    }

    .arrange_group_buttons .align_action_btn {
        min-width: 0;
    }
}

.rider_name input {
    height: 34px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1e1e2f;
    color: #fff;
    padding: 0 10px;
    width: 180px;
    outline: none;
}

.rider_name input::placeholder {
    color: #888;
}

.rider_name input:focus {
    border-color: #a29bfe;
    box-shadow: 0 0 0 2px rgba(162, 155, 254, .25);
}

/* STAGE WRAP */
.stage-wrap {
    padding: 10px 15px 10px 15px !important;
    position: relative;
    overflow: auto;
    background: #f1f2f6;
    height: calc(100% - 48px);
    transition: padding 0.3s ease;
}

.stage-wrap.with-measurements {
    padding: 50px 60px 30px 40px !important;
}

/* STAGE CONTAINER */
.stage-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    transform-origin: 0 0;
    cursor: grab;
    overflow: visible;
}

/* STAGE */
.stage {
    width: 100%;
    aspect-ratio: 60 / 38;
    background: #fff;
    border: 3px solid #a29bfe;
    position: relative;
    margin: 0 auto;
    overflow: visible !important;
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 1;
}

.stage-floor {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 252, 0.96));
}

.stage-floor.floor-dark {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 42%),
        linear-gradient(180deg, #3d4557 0%, #242a38 100%);
}

.stage-floor.floor-wood {
    background:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.06) 3%,
            transparent 3%,
            transparent 16.66%),
        linear-gradient(180deg, #c98b57 0%, #a96e43 100%);
    background-size: 16.66% 100%, 100% 100%;
}

.stage-floor.floor-blueprint {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.14), transparent 28%),
        linear-gradient(180deg, #254b84 0%, #16345f 100%);
}

/* GRID */
/* GRID - EN İYİ ÇÖZÜM */
.grid {
    position: absolute;
    inset: 0;
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, #ddd 1px, transparent 1px),
        linear-gradient(to bottom, #ddd 1px, transparent 1px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    /* display özelliği JavaScript tarafından kontrol edilecek */
}
/* AXIS */
.axis-x,
.axis-y {
    position: absolute;
    background: red;
    pointer-events: none;
    display: none;
}

.axis-x {
    height: 2px;
    width: 100%;
    top: 50%
}

.axis-y {
    width: 2px;
    height: 100%;
    left: 50%
}

.align-guide {
    position: absolute;
    z-index: 9;
    pointer-events: none;
    background: rgba(47, 53, 66, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.align-guide.vertical {
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}

.align-guide.horizontal {
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

/* STAGE ITEM */
.stage-item-wrapper {
    position: absolute;
    z-index: 10;
    touch-action: none;
}

.stage-item-wrapper { position: absolute; }

.stage-item-wrapper .item-text-wrap{
  position: absolute;
  left: 0;
  top: 100%;              /* ✅ resmin ALTINA bağlı */
  /*transform: translate(0px, 8px);  ✅ varsayılan 8px aşağı */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  margin-top: 8px;          /* default aralık */
  transform: translate(0,0);/* js her seferinde overwrite edecek */
  z-index: 50;            /* controls üstünde */
  pointer-events: auto;     /* handle kesin tıklansın */
}


.stage-item-wrapper .item-text-wrap{
  z-index: 9999;
  pointer-events: auto;
  margin-top: 8px;
  transform: translate(0,0);
}

.stage-item-wrapper .item-text-handle{
  cursor: grab;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: auto;
  touch-action: none;
 background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.15);
}

.stage-item-wrapper .item-text-handle:active{
  cursor: grabbing;
}

.stage-item-wrapper .item-text{
  padding: 2px 6px;
  border-radius: 4px;
  outline: none;
  user-select: text; /* yazı seçilebilsin */
}


.stage-item-wrapper img {
    width: 120px;
    user-select: none;
    pointer-events: none;
}

/* CONTROLS */
.controls {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
    z-index: 20;
}

.stage-item-wrapper.selected .controls {
    display: block;
}

.stage-item-wrapper.controls-below.selected .controls {
    display: flex;
}

.ctrl {
    pointer-events: auto;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #2f3542;
    color: #fff;
    cursor: pointer;
}

/* CONTROL POSITIONS */
.delete {
    position: absolute;
    top: -12px;
    left: -12px
}

.top {
    position: absolute;
    top: -12px;
    right: -12px;
    display: flex;
    gap: 4px
}

.bottom {
    position: absolute;
    bottom: -12px;
    right: -12px;
    display: flex;
    gap: 4px
}

.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 6px;
}

.flip {
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
}

.stage-item-wrapper.controls-below .controls {
    inset: auto;
    top: calc(100% + 10px);
    left: 50%;
    width: max-content;
    transform: translateX(-50%);
    gap: 6px;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(47, 53, 66, 0.14);
    border-radius: 999px;
    padding: 6px 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.stage-item-wrapper.controls-below .delete,
.stage-item-wrapper.controls-below .top,
.stage-item-wrapper.controls-below .bottom,
.stage-item-wrapper.controls-below .center,
.stage-item-wrapper.controls-below .flip,
.stage-item-wrapper.controls-below .lock-indicator {
    position: static;
    transform: none;
}

.stage-item-wrapper.controls-below .top,
.stage-item-wrapper.controls-below .bottom,
.stage-item-wrapper.controls-below .center {
    display: flex;
    gap: 6px;
}

.stage-item-wrapper.controls-below .lock-indicator {
    display: none !important;
}

/* LOCK INDICATOR */
.lock-indicator {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2f3542;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
}

.stage.lock-select-active .stage-item-wrapper.selected .lock-indicator {
    display: none;
}

/* PAN MODE */
body.pan-mode {
    cursor: grab;
}

body.pan-mode:active {
    cursor: grabbing;
}

body.pan-mode .stage-wrapper {
    cursor: grabbing;
}

/* MEASUREMENT MARKS */
.measurement-mark {
    position: absolute;
    background: #a29bfe;
    z-index: 2;
    pointer-events: none;
}

.measurement-mark.width-mark {
    width: 1px;
    height: 8px;
    transform: translateX(-50%);
}

.measurement-mark.width-mark.top {
    top: -2px;
}

.measurement-mark.width-mark.bottom {
    bottom: -2px;
}

.measurement-mark.depth-mark {
    width: 8px;
    height: 1px;
    transform: translateY(-50%);
}

.measurement-mark.depth-mark.left {
    left: -2px;
}

.measurement-mark.depth-mark.right {
    right: -2px;
}

/* MEASUREMENT VALUES */
.measurement-value {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    color: #2f3542;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    z-index: 3;
}

.measurement-value.width-value {
    transform: translateX(-50%);
    text-align: center;
}

.measurement-value.width-value[style*="top"] {
    top: -20px !important;
}

.measurement-value.width-value[style*="bottom"] {
    bottom: -20px !important;
    top: auto !important;
}

.measurement-value.depth-value {
    transform: translateY(-50%);
}

.measurement-value.depth-value[style*="left"] {
    left: -25px !important;
}

.measurement-value.depth-value[style*="right"] {
    right: -25px !important;
}

/* TOTAL MEASUREMENTS */
.total-width,
.total-depth {
    position: absolute;
    font-size: 11px;
    font-weight: bold;
    color: white;
    background: #a29bfe;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
    white-space: nowrap;
    text-align: center;
}

.total-width {
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 10px;
    min-width: 60px;
}

.total-depth {
    right: -40px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    padding: 10px 4px;
    border-radius: 10px;
    min-height: 60px;
    writing-mode: vertical-rl;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, .55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #ffffff;
    width: 460px;
    max-width: 90vw;
    max-height: min(88vh, 760px);
    border-radius: 14px;
    padding: 20px 22px 18px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .25),
        0 0 0 1px rgba(0, 0, 0, .05);
    animation: modalIn .18s ease-out;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@keyframes modalIn {
    from {
        transform: translateY(10px) scale(.98);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.modal-box h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: #2f3542;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: -20px;
    z-index: 2;
    background: #ffffff;
    padding: 20px 0 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-box strong {
    font-size: 13px;
    color: #57606f;
}

/* STAGE SIZE INPUTS */
.stage-size {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 5px;
}

.stage-size input {
    width: 100px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.stage-size input:focus {
    border-color: #a29bfe;
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.2);
    outline: none;
}

.stage-size span {
    font-weight: bold;
    color: #666;
    font-size: 18px;
    margin: 0 5px;
}

.auto-btn {
    height: 40px;
    padding: 0 15px;
    background: #747d8c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.auto-btn:hover {
    background: #636e7c;
}

.stage-size-hint {
    font-size: 11px;
    color: #666;
    margin-bottom: 15px;
    margin-top: 5px;
}

/* CHECKBOX */
.modal-box label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #2f3542;
    cursor: pointer;
}

.modal-box hr {
    border: none;
    height: 1px;
    background: #eee;
    margin: 14px 0;
}

.modal-box button {
    margin-top: 14px;
    height: 34px;
    background: #a29bfe;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: .15s;
}

.modal-box button:hover {
    background: #7d73ff;
}

/* PREVIEW MODAL */
.preview-box {
    position: relative;
    max-height: 55vh;
    max-width: 90vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    max-height: 55vh;
    max-width: 100%;
    object-fit: contain;
}

.close-btn {
    /*position: absolute;*/
    top: 8px;
    right: 8px;
    background: #2f3542;
    color: #fff;
    border: none;
    border-radius: 50%;
    /*width: 30px;*/
    height: 30px;
    cursor: pointer;
    font-size: 14px;
}

.modal-actions {
    position: sticky;
    bottom: -18px;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, #ffffff 26%);
    padding-top: 12px;
    padding-bottom: 2px;
    margin-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-actions .close-btn {
    margin-top: 0;
}

/* MODAL OPEN STATE */
.modal[style*="display: flex"] ~ .main {
    pointer-events: none;
    filter: blur(1px);
}

/* FULLSCREEN BUTTON */
.fullscreen-btn {
    position: absolute;
 /*   top: 10px;
    right: 10px;*/
    z-index: 50;
    background: #2f3542;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 14px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .stage-wrap {
        padding: 30px !important;
    }

    .modal-box {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 24px);
        padding: 16px 16px 14px;
    }

    .modal-box h3 {
        top: -16px;
        padding-top: 16px;
    }

    .modal-actions {
        bottom: -14px;
    }

    .measurement-value {
        font-size: 8px !important;
    }

    .total-width,
    .total-depth {
        font-size: 9px !important;
        padding: 3px 8px !important;
    }
}



/* Option group */
.option-group {
    margin: 15px 0;
}

.option-group strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* Grid options */
.grid-options {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.grid-btn {
    flex: 1;
    padding: 8px 5px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s;
}

.grid-btn:hover {
    background: #e0e0e0;
}

/* Grid butonları */
.grid-buttons {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.grid-btn {
    flex: 1;
    padding: 8px 5px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s;
}

.grid-btn:hover {
    background: #e0e0e0;
}

.grid-btn.active {
    background: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
    font-weight: bold;
}

/* Disabled butonu için özel stil */
.grid-btn:first-child.active {
    background: #e74c3c;
    border-color: #e74c3c;
}

.grid-btn[data-grid="disabled"].active {
    background: #e74c3c;
    border-color: #e74c3c;
}

.floor-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 4px;
}

.floor-btn {
    height: auto !important;
    margin-top: 0 !important;
    padding: 8px;
    background: #f8f8fb !important;
    border: 1px solid #d8dbe6 !important;
    border-radius: 10px !important;
    color: #2f3542 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.floor-btn:hover {
    background: #eef1fb !important;
    border-color: #bac3ea !important;
}

.floor-btn.active {
    background: #eef0ff !important;
    border-color: #7d73ff !important;
    box-shadow: 0 0 0 2px rgba(125, 115, 255, 0.12);
}

.floor-thumb {
    width: 58px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex: 0 0 auto;
}

.floor-name {
    font-size: 13px;
    font-weight: 600;
}

.floor-none {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 252, 0.96));
}

.floor-dark {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 42%),
        linear-gradient(180deg, #3d4557 0%, #242a38 100%);
}

.floor-wood {
    background:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.06) 3%,
            transparent 3%,
            transparent 16.66%),
        linear-gradient(180deg, #c98b57 0%, #a96e43 100%);
    background-size: 16.66% 100%, 100% 100%;
}

.floor-blueprint {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.14), transparent 28%),
        linear-gradient(180deg, #254b84 0%, #16345f 100%);
}

.mobile-size-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0 4px;
}

.mobile-size-btn {
    flex: 1;
    margin-top: 0 !important;
    background: #f4f5fb !important;
    color: #2f3542 !important;
    border: 1px solid #d8dbe6 !important;
}

.mobile-size-btn.active {
    background: #4a6fa5 !important;
    border-color: #4a6fa5 !important;
    color: #fff !important;
    font-weight: 700;
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.template-btn {
    height: auto !important;
    margin-top: 0 !important;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px !important;
    text-align: left;
    background: #f8f8fb !important;
    color: #2f3542 !important;
    border: 1px solid #d8dbe6 !important;
    border-radius: 12px !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-btn:hover {
    background: #eef1fb !important;
    border-color: #bac3ea !important;
}

.template-name {
    font-size: 14px;
    font-weight: 700;
}

.template-meta {
    font-size: 12px;
    color: #697386;
}

.project-save-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.project-name-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 1px solid #d8dbe6;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.project-name-input:focus {
    border-color: #7d73ff;
    box-shadow: 0 0 0 3px rgba(125, 115, 255, 0.12);
}

.project-save-btn {
    margin-top: 0 !important;
    min-width: 88px;
}

.project-share-row {
    margin-top: 10px;
}

.project-share-btn {
    margin-top: 0 !important;
    width: 100%;
}

.share-link-status {
    margin-top: 6px;
    font-size: 12px;
    color: #697386;
    min-height: 16px;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.project-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #d8dbe6;
    border-radius: 12px;
    background: #f8f8fb;
}

.project-meta {
    min-width: 0;
}

.project-title {
    font-size: 14px;
    font-weight: 700;
    color: #2f3542;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-date {
    font-size: 12px;
    color: #697386;
    margin-top: 2px;
}

.project-action-btn {
    margin-top: 0 !important;
    min-width: 64px;
    height: 34px !important;
    padding: 0 12px !important;
}

.project-action-btn.delete {
    background: #e74c3c !important;
}

@media (max-width: 768px) {
    .project-save-row {
        flex-direction: column;
    }

    .project-save-btn {
        width: 100%;
    }

    .project-card {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .template-buttons {
        grid-template-columns: 1fr;
    }
}



.items-wrapper {
    position: relative;
    min-height: 500px;
    padding-bottom: 60px; /* Footer yüksekliği kadar alt boşluk */
    box-sizing: border-box; /* Padding'i yüksekliğe dahil eder */
}

.items-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; /* Footer'ın sabit yüksekliği */
    padding: 15px 0;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #dee1ea;
    background-color: #dee1ea;
    box-sizing: border-box; /* Padding'i yüksekliğe dahil eder */
}


@media (max-width: 768px) {
    .items-footer {
        font-size: 12px;
        padding: 10px 0;
        height: 50px;
    }
    
    .items-wrapper {
        min-height: 400px; /* Mobilde daha az yükseklik */
        padding-bottom: 50px;
    }
}


/* MODAL Channels*/


.tk-modal { position: fixed; inset: 0; display: none; z-index: 9999; }
.tk-modal.show { display: block; }

.tk-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }

.tk-modal-panel {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 24px));
  margin: 12px auto;
  background: #f2f2f6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

.tk-modal-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f2f2f6;
}

.tk-modal-title { font-weight: 600; font-size: 14px; opacity: 0.85; }
.tk-close {
  width: 34px; height: 34px;
  border: none; border-radius: 10px;
  background: rgba(0,0,0,0.06);
  font-size: 20px; line-height: 1;
  cursor: pointer;
}

.tk-tabs {
  padding: 10px 14px 0 14px;
  display: flex;
  gap: 10px;
}

.tk-tab {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: #ffffff;
  color: #1d1d1f;
  cursor: pointer;
}

.tk-tab.active {
  background: #6d39ff;
  color: #ffffff;
}

.tk-tabpanes { padding: 12px 14px 14px 14px; flex: 1; overflow: auto; }
.tk-pane { display: none; height: 100%; }
.tk-pane.active { display: block; }

.tk-ch-list { display: flex; flex-direction: column; gap: 10px; }

.tk-row {
  display: grid;
  grid-template-columns: 52px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.tk-num, .tk-input {
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #ffffff;
  font-size: 14px;
  padding: 0 12px;
}

.tk-num { text-align: center; width: 52px; padding: 0; }
.tk-x {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  font-size: 18px;
  opacity: 0.55;
  cursor: pointer;
}

.tk-add {
  width: 100%;
  margin-top: 14px;
  height: 48px;
  border: none;
  border-radius: 10px;
  background: rgba(109,57,255,0.22);
  cursor: pointer;
}

.tk-plus {
  display: inline-flex;
  width: 28px; height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  font-size: 20px;
  font-weight: 700;
  color: #6d39ff;
}

.tk-textarea {
  width: 100%;
  height: calc(100% - 6px);
  resize: none;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #ffffff;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.tk-modal-foot {
  padding: 12px 14px;
  background: #f2f2f6;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.tk-save {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Mobile menu button */
.mobile_menu_btn{
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #111827;
}

/* Menu container */
.mobile_menu{
  position: absolute;
  top: 60px;
  right: 16px;
  width: 260px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all .18s ease;
  z-index: 1000;
}

/* Active state */
.mobile_menu.is-open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Menu list */
.menu_help_items{
  list-style: none;
  margin: 0;
  padding: 12px;
}

.menu_help_items li{
  margin: 0;
}

/* Menu links */
.menu_item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  font-size: 14px;
}

.menu_item:hover{
  background: #f3f6fb;
}

.menu_item.pricing{
  color: #6f42ff;
  font-weight: 700;
}

/* External link icon spacing fix */
.external_link a{
  justify-content: space-between;
}

.item-text-wrap .txt-btn{
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: #2f3542;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.item-text-wrap .txt-btn:active{
  transform: translateY(1px);
}


/* Yazı (item-text) her zaman görünsün */
.stage-item-wrapper > .item-text-wrap{
  pointer-events: auto;
}

/* Kontroller default gizli */
.stage-item-wrapper > .item-text-wrap .item-text-handle,
.stage-item-wrapper > .item-text-wrap .txt-btn{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease, visibility .12s ease;
}

/* Sadece item seçilince kontroller görünsün */
.stage-item-wrapper.selected > .item-text-wrap .item-text-handle,
.stage-item-wrapper.selected > .item-text-wrap .txt-btn{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .top-bar {
        height: auto;
        padding: 10px;
        gap: 10px;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .groups {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 6px;
        border-bottom: none;
    }

    .groups li {
        flex: 0 0 auto;
    }

    .groups button {
        min-width: 52px;
    }

    .rider-options-btn {
        width: 100%;
        margin: 0;
        padding: 0;
        justify-content: flex-end;
    }

    .main {
        height: auto;
        min-height: calc(100vh - 56px);
        overflow: visible;
    }

    .main.panelpos-left,
    .main.panelpos-right,
    .main.panelpos-top,
    .main.panelpos-bottom {
        flex-direction: column !important;
    }

    .main .stage-area {
        order: 0 !important;
        flex: 0 0 auto !important;
        min-height: 52vh;
    }

    .main .left-panel {
        order: 1 !important;
        width: 100% !important;
        flex-direction: column !important;
        background: #dfe4ea;
        border-top: 1px solid #cfcfcf;
    }

    .main .left-side {
        order: 0 !important;
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-top: 1px solid #3d3d4f;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .main .navbars {
        width: max-content;
        min-width: 100%;
    }

    .main .navbar {
        display: none;
        padding: 10px !important;
        white-space: nowrap;
    }

    .main .navbar.active {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 10px !important;
    }

    .main .nav-btn {
        flex: 0 0 auto !important;
        min-width: 96px;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 14px !important;
    }

    .main .items-wrapper {
        order: 1 !important;
        min-height: auto;
        padding-bottom: 0;
        border-right: none !important;
    }

    .main .items {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        grid-auto-rows: 84px;
        max-height: 34vh;
        border-right: none;
        border-bottom: 1px solid #cfcfcf;
    }

    .main .items.closed {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 0 !important;
        padding: 0 !important;
        opacity: 0;
        overflow: hidden;
        border-bottom: none;
    }

    .main .sidebar__toggle {
        display: none !important;
    }

    .items-footer {
        display: none;
    }

    .plot__header {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .rider_name input {
        width: 130px;
    }

    .mobile_menu {
        top: 108px;
        right: 12px;
        width: min(260px, calc(100vw - 24px));
    }
}
