/* ==========================================================================
   Luna Room Preview — Frontend CSS v1.4.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   Ürün sayfası — Premium tanıtım kutusu
   -------------------------------------------------------------------------- */
.luna-rp-product-callout {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0;
    padding: 18px 20px;
    background: linear-gradient(145deg, #fdfbf6 0%, #f7f2ea 100%);
    border: 1px solid #e2d4bc;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(26, 26, 46, 0.07), 0 1px 3px rgba(26, 26, 46, 0.05);
}

.luna-rp-callout-copy {
    flex: 1;
    min-width: 0;
}

.luna-rp-callout-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 5px;
    letter-spacing: 0.1px;
    line-height: 1.3;
}

.luna-rp-callout-text {
    display: block;
    font-size: 13px;
    color: #6b6270;
    line-height: 1.55;
}

/* CTA butonu — lacivert zemin, gold yazı */
.luna-rp-open-button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 24px;
    background: linear-gradient(150deg, #1a1a2e 0%, #16213e 60%, #0f2a50 100%);
    color: #e8b84b;
    border: 1px solid rgba(232, 184, 75, 0.30);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.25px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    box-shadow: 0 3px 10px rgba(26, 26, 46, 0.22), 0 1px 3px rgba(26, 26, 46, 0.15);
}

.luna-rp-open-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(150deg, #16213e 0%, #0f2a50 60%, #0a2040 100%);
    color: #f5cb6a;
    box-shadow:
        0 6px 20px rgba(26, 26, 46, 0.28),
        0 0 0 1px rgba(232, 184, 75, 0.35),
        0 0 18px rgba(232, 184, 75, 0.12);
}

.luna-rp-open-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 26, 46, 0.22);
}

.luna-rp-open-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.45), 0 3px 10px rgba(26, 26, 46, 0.22);
}

/* Eski .luna-rp-button-wrap artık kullanılmıyor; sıfır margin ile korunur */
.luna-rp-button-wrap {
    margin: 0;
}

/* Eski .luna-rp-open-modal sınıfı JS hook'u için korunur; görsel stil .luna-rp-open-button'dan gelir */
.luna-rp-open-modal {
    /* JS bağımlılığı için boş tutuldu */
}

/* --------------------------------------------------------------------------
   Modal — arka plan (overlay)
   -------------------------------------------------------------------------- */
.luna-rp-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.luna-rp-modal-open {
    overflow: hidden;
}

.luna-rp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* --------------------------------------------------------------------------
   Modal — iç konteyner
   -------------------------------------------------------------------------- */
.luna-rp-modal-container {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    padding: 26px 28px 22px;
    width: 94%;
    max-width: 940px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.38);
    animation: luna-rp-fadein 0.22s ease;
}

@keyframes luna-rp-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* --------------------------------------------------------------------------
   Başlık & açıklama
   -------------------------------------------------------------------------- */
.luna-rp-modal-header {
    margin-bottom: 16px;
}

#luna-rp-modal-title {
    margin: 0 0 5px;
    font-size: 21px;
    color: #1a1a2e;
    line-height: 1.3;
}

.luna-rp-modal-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Araç çubuğu (toolbar)
   -------------------------------------------------------------------------- */
.luna-rp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

/* Genel buton */
.luna-rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 15px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background: #f8f8f8;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

.luna-rp-btn:hover,
.luna-rp-btn:focus {
    background: #ebebeb;
    border-color: #aaa;
    color: #111;
    text-decoration: none;
    outline: none;
}

/* Fotoğraf yükleme etiketi — mavi ton */
.luna-rp-btn--upload {
    background: #eaf4fd;
    border-color: #5aacdf;
    color: #1565c0;
    font-weight: 600;
}

.luna-rp-btn--upload:hover,
.luna-rp-btn--upload:focus {
    background: #d3eaf8;
    border-color: #1976d2;
    color: #0d47a1;
}

/* İndir butonu — koyu ana renk */
.luna-rp-btn--primary {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
    font-weight: 600;
}

.luna-rp-btn--primary:hover,
.luna-rp-btn--primary:focus {
    background: #0f3460;
    border-color: #0f3460;
    color: #fff;
}

/* Kapat butonu — sağa yasla, nötr */
.luna-rp-btn--close {
    margin-left: auto;
    background: transparent;
    border-color: #ddd;
    color: #777;
}

.luna-rp-btn--close:hover,
.luna-rp-btn--close:focus {
    background: #fff0f0;
    border-color: #e53935;
    color: #c62828;
}

/* --------------------------------------------------------------------------
   Canvas sarmalayıcı
   -------------------------------------------------------------------------- */
.luna-rp-canvas-wrap {
    position: relative;
    background: #ebebeb;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    overflow: hidden;
    /* Oda fotoğrafı yüklenmeden önce sabit bir yükseklik */
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Placeholder: canvas üzerinde kayan overlay metin */
.luna-rp-placeholder {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(235, 235, 235, 0.88);
    text-align: center;
    padding: 24px;
    pointer-events: none;
    border-radius: 8px;
}

.luna-rp-placeholder span {
    font-size: 14px;
    color: #888;
    max-width: 280px;
    line-height: 1.5;
}

/* Fabric.js'in oluşturduğu .canvas-container div'i tam genişlikte olsun */
.luna-rp-canvas-wrap .canvas-container {
    display: block !important;
    max-width: 100%;
}

/* Fabric'in üst canvas'ı (etkileşim katmanı) taşmasın */
.luna-rp-canvas-wrap .upper-canvas,
.luna-rp-canvas-wrap .lower-canvas {
    max-width: 100%;
    display: block;
}

/* --------------------------------------------------------------------------
   Hata / uyarı mesajı
   -------------------------------------------------------------------------- */
.luna-rp-error {
    margin: 10px 0 0;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-left: 4px solid #f9a825;
    border-radius: 5px;
    color: #795548;
    font-size: 13px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Gizlilik notu
   -------------------------------------------------------------------------- */
.luna-rp-privacy-note {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Tanıtım kutusu: tablet'te dikey yığın */
    .luna-rp-product-callout {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .luna-rp-open-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .luna-rp-modal-container {
        padding: 20px 16px 18px;
        width: 96%;
        max-height: 98vh;
    }

    .luna-rp-toolbar {
        gap: 6px;
    }

    .luna-rp-btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .luna-rp-btn--close {
        margin-left: 0;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Mobil (< 480px)
   Butonlar iki sütuna bölünür, canvas tam genişlik
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .luna-rp-modal-container {
        padding: 16px 12px 14px;
        border-radius: 8px 8px 0 0;
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 96vh;
    }

    .luna-rp-modal {
        align-items: flex-end;
    }

    .luna-rp-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .luna-rp-btn--upload {
        grid-column: 1 / -1; /* tam genişlik */
    }

    .luna-rp-btn--primary {
        grid-column: 1 / -1;
    }

    .luna-rp-btn--close {
        grid-column: 1 / -1;
        margin-left: 0;
    }

    .luna-rp-canvas-wrap {
        min-height: 180px;
    }
}

/* --------------------------------------------------------------------------
   Mobil kaydetme önizlemesi
   Kullanıcı görsele basılı tutarak "Fotoğraflara Kaydet" yapabilir.
   -------------------------------------------------------------------------- */
.luna-rp-save-preview {
    margin-top: 16px;
    padding: 14px 14px 16px;
    background: #f0f7ff;
    border: 1px solid #c3ddf5;
    border-radius: 8px;
    text-align: center;
}

.luna-rp-save-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #1565c0;
    line-height: 1.55;
}

.luna-rp-save-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #c3ddf5;
    margin: 0 auto;
    cursor: pointer;
    /* iOS: basılı tutma menüsünü (Fotoğraflara Kaydet) etkinleştir */
    -webkit-touch-callout: default;
    touch-action: manipulation;
    /* Gölge — görselin tıklanabilir olduğunu hissettir */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
