:root {
    --accent: #d4af37;
    --sidebar-w: 380px;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
    display: flex;
}

#main-viewer {
    position: relative;
    flex-grow: 1;
    height: 100vh;
    background: #0a0a0a;
}

#map {
    position: absolute;
    inset: 0;
}

#crop-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 9000px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#crop-box::after {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
}

.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: #111;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 20px 25px;
    border-bottom: 1px solid #222;
}

.sidebar-header h2 {
    margin: 0;
    color: var(--accent);
    font-size: 18px;
    letter-spacing: 2px;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.section-title {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 25px 0 12px 0;
    display: block;
    font-weight: 800;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

.setting-group {
    margin-bottom: 15px;
}

label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 6px;
}

input[type="text"],
select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: white;
    font-size: 13px;
    box-sizing: border-box;
}

.search-container {
    position: relative;
    margin-bottom: 10px;
}

.btn-locate {
    background: #222;
    color: #ccc;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-locate:hover {
    background: #333;
    color: white;
}

.input-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* HARİTA AYARLARI */
.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.color-box {
    background: #1a1a1a;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #333;
}

input[type="color"] {
    width: 100%;
    height: 30px;
    border: none;
    cursor: pointer;
    background: none;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
    margin-top: 5px;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
    color: #ccc;
}

/* ÇERÇEVE VE ÖNİZLEME */
.btn-preview {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--accent);
    background: rgba(212, 175, 55, 0.05);
    color: var(--accent);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
}

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

.frame-opt {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 11px;
    color: #888;
}

.frame-opt.active {
    border-color: var(--accent);
    color: white;
    background: rgba(212, 175, 55, 0.1);
}

.frame-opt div {
    width: 18px;
    height: 18px;
    margin: 0 auto 5px;
    border: 1px solid #fff;
}

/* FOOTER */
.sidebar-footer {
    padding: 20px;
    background: #0a0a0a;
    border-top: 1px solid #222;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
    color: #888;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 20px;
    font-weight: bold;
}

.btn-pay {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
    transition: 0.3s;
}

.btn-download {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    margin-top: 8px;
    padding: 8px;
    font-size: 11px;
}

/* LOADING */
#loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #222;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#hidden-container {
    position: fixed;
    top: 0;
    left: -30000px;
}

/* MODAL CSS */
#previewModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.pexels.com/photos/20390759/pexels-photo-20390759.jpeg');
    background-size: cover;
    background-position: center;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 50px;
    color: white;
    cursor: pointer;
    z-index: 2100;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

/* ÇERÇEVE DİNAMİKLERİ */
.frame {
    border: 20px solid #111;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    transform: rotateY(-8deg) rotateX(2deg);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
}

/* Ölçü Sınıfları */
.frame.a2_p {
    width: 450px;
    height: 636px;
}

.frame.a3_p {
    width: 380px;
    height: 537px;
}

.frame.a4_p {
    width: 320px;
    height: 452px;
}

.frame.a5_p {
    width: 250px;
    height: 353px;
}

.frame.ratio5070 {
    width: 450px;
    height: 630px;
}

/* Yatay Ölçüler */
.frame.a2_l {
    width: 636px;
    height: 450px;
}

.frame.a3_l {
    width: 537px;
    height: 380px;
}

.frame.a4_l {
    width: 452px;
    height: 320px;
}

/* --- GÜNCELLENMİŞ MODAL CSS --- */
#previewModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('https://images.pexels.com/photos/20390759/pexels-photo-20390759.jpeg');
    background-size: cover;
    background-position: center;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#draggable-wrapper {
    position: absolute;
    top: 20%;
    left: 30%;
    /* Başlangıç */
    transform-origin: center center;
    /* Önemli: Merkezden büyüsün */
    z-index: 2010;
    will-change: transform;
    pointer-events: auto;
}

/* Çerçeve artık bu wrapper'ın içinde büyüyecek */
.frame {
    border: 15px solid #111;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    background: #000;
    transition: none;
    /* Sürüklerken gecikme olmasın */
    pointer-events: none;
    /* Tıklamaları wrapper'a geçirir */
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    /* Odayı biraz karartıyoruz ki tablo öne çıksın */
}

/* Ölçü Sınıfları - Modal İçin Optimize Edildi */
.frame.a4_p {
    width: 320px;
    height: 452px;
    border-width: 12px;
}

.frame.a5_p {
    width: 240px;
    height: 340px;
    border-width: 10px;
}

.frame.ratio5070,
.frame.5070_p {
    width: 450px;
    height: 630px;
}

#preview-img-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#preview-map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* HARİTA ÜZERİNE BİNEN GRADIENT METİN BLOĞU */
.integrated-text-block {
    width: 100%;
    padding: 50px 0 30px 0;
    /* Üstten geniş boşluk (gradient geçişi için) */
    box-sizing: border-box;
    text-align: center;
    color: #ffffff;
    z-index: 5;
    position: relative;
    /* Alt tarafı siyah, üstü transparan geçiş */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
}

.preview-city {
    font-weight: 900;
    letter-spacing: 10px;
    margin: 0;
    font-size: 26px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.preview-coords {
    font-size: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    padding-top: 6px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.8);
}

.preview-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 40px;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.close-modal {
    position: fixed;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    z-index: 2100;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.search-modal {
    display: none;
    /* Başlangıçta gizli */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.search-modal-content {
    text-align: center;
    color: var(--white);
    font-family: 'Karla', sans-serif;
}

.search-modal-content p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    margin-top: 20px;
    letter-spacing: 0.05em;
}

.search-modal-content span {
    font-size: 12px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Minimal Spinner */
.search-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(200, 184, 154, 0.1);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.palette-card {
    transition: transform 0.2s, border-color 0.2s;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.palette-card:hover {
    transform: scale(1.03);
    border-color: #fff !important;
}