/* =====================================================================
 * Admin Panel Stilleri
 * ===================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.admin-body { background: #f1f5f9; min-height: 100vh; color: #1e293b; }

/* ----------------- Login Page ----------------- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #6366f1 100%);
}
.login-card {
    width: 100%; max-width: 420px;
    background: white; border-radius: 20px; padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; font-weight: 700;
    box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
.login-brand h1 { font-size: 1.3rem; margin: 0 0 4px; color: #0f172a; }
.login-hint { text-align: center; margin-top: 18px; font-size: 12px; color: #94a3b8; }
.login-hint a { color: #6366f1; }

/* ----------------- Shell / Layout ----------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px; flex-shrink: 0;
    background: #0f172a; color: #cbd5e1;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.admin-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.vt-hotspot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid white;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.5);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    text-align: center !important;
    cursor: grab;
    margin-left: -16px !important;
    margin-top: -16px !important;
    position: relative;
    box-sizing: border-box;
}
.admin-brand .brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; font-weight: 700; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
}
.admin-brand .brand-name { font-size: 13px; font-weight: 600; line-height: 1.2; color: white; }

.admin-nav { padding: 14px 10px; flex: 1; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 4px;
    color: #cbd5e1; text-decoration: none; font-size: 14px;
    transition: background .2s, color .2s;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-nav a.active { background: linear-gradient(90deg, #6366f1, #8b5cf6); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.admin-nav .nav-ico { width: 18px; text-align: center; }

.admin-user {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
}
.user-name { color: white; font-weight: 600; }
.user-email { color: #94a3b8; margin-bottom: 8px; }
.logout-link { color: #f87171; text-decoration: none; font-weight: 500; }
.logout-link:hover { text-decoration: underline; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    background: white; padding: 18px 28px;
    border-bottom: 1px solid #e2e8f0;
}
.topbar-title { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }

.admin-content { padding: 28px; }

/* ----------------- Forms ----------------- */
.form-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.form-input {
    width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 10px;
    font-size: 14px; color: #0f172a; background: white;
    transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { outline: 0; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-help { font-size: 12px; color: #64748b; margin-top: 4px; }

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
    text-decoration: none; cursor: pointer; border: 0;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(99,102,241,0.45); }
.btn-secondary { background: white; color: #334155; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: #f8fafc; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ----------------- Stat Cards ----------------- */
.stat-card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(15,23,42,0.04); border: 1px solid #e2e8f0; }
.stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 800; color: #0f172a; margin-top: 8px; }

/* ----------------- Panels ----------------- */
.panel { background: white; border-radius: 14px; box-shadow: 0 2px 10px rgba(15,23,42,0.04); border: 1px solid #e2e8f0; overflow: hidden; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: #0f172a; }
.panel-body { padding: 20px; }

/* ----------------- Tables ----------------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    text-align: left; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: #64748b;
    padding: 12px 20px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.data-table tbody td { padding: 14px 20px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }

.thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; background: #e2e8f0; }

/* İçerik yönetim kartları (galeri/plan/link kısayolları) */
.content-manage-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: white; border: 1px solid #e2e8f0; border-radius: 12px;
    text-decoration: none; color: inherit;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.content-manage-card:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}
.cmc-icon { font-size: 22px; line-height: 1; }
.cmc-title { font-weight: 700; color: #0f172a; }
.cmc-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.cmc-arrow { margin-left: auto; color: #94a3b8; font-size: 18px; }

/* Çoklu içerik satırı (galeri/plan kartları) */
.multi-row {
    display: flex; gap: 12px; padding: 12px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
}
.multi-row-thumb {
    width: 110px; height: 80px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0; background: #e2e8f0;
}
.multi-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.multi-row-input { font-size: 13px; padding: 6px 10px; }
.multi-row-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.multi-row-del {
    margin-left: auto; cursor: pointer;
    background: transparent; border: 0;
    color: #dc2626; font-size: 13px; font-weight: 600;
}
.multi-row-del:hover { text-decoration: underline; }
.thumb-empty { width: 80px; height: 60px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #94a3b8; border-radius: 8px; }
.thumb-wide { width: 100%; max-width: 480px; aspect-ratio: 2/1; object-fit: cover; border-radius: 10px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-muted { background: #f1f5f9; color: #475569; }

.link { color: #6366f1; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-danger { color: #ef4444; background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }

/* =====================================================================
 * HOTSPOT EDITOR (CloudPano benzeri 3 panel layout)
 * ===================================================================== */
.hotspot-editor-shell {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    height: calc(100vh - 73px);
    margin: -28px;
    background: #0f172a;
    color: #e2e8f0;
}

/* Sol panel */
.he-left { background: #0b1120; border-right: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; }
.he-left-head { padding: 18px 18px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.he-left-head h3 { margin: 0; font-size: 14px; color: white; }
.he-left-head p  { margin: 2px 0 0; font-size: 12px; color: #64748b; }
.he-scene-list { flex: 1; overflow-y: auto; padding: 10px; }
.he-scene {
    display: flex; align-items: center; gap: 10px; padding: 8px;
    border-radius: 10px; margin-bottom: 6px; text-decoration: none;
    color: #cbd5e1; transition: background .2s;
}
.he-scene:hover { background: rgba(255,255,255,0.04); }
.he-scene.active { background: linear-gradient(90deg, rgba(99,102,241,0.3), rgba(139,92,246,0.15)); color: white; box-shadow: inset 2px 0 0 #6366f1; }
.he-scene-thumb { flex: 0 0 auto; width: 56px; height: 36px; border-radius: 6px; background-size: cover; background-position: center; background-color: #1e293b; }
.he-scene-info { flex: 1; min-width: 0; }
.he-scene-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.he-scene-badge { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px; background: #6366f1; color: white; font-size: 10px; }
.he-left-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,0.05); }

/* Orta */
.he-center { display: flex; flex-direction: column; min-width: 0; }
.he-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #1e293b; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.he-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.he-tool {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
    background: #334155; color: #e2e8f0; border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; transition: background .2s, transform .1s;
}
.he-tool:hover { background: #475569; }
.he-tool.active { background: #6366f1; color: white; box-shadow: 0 0 0 2px rgba(99,102,241,0.4); }
.he-tool .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-blue { background: #6366f1; }
.dot-amber { background: #f59e0b; }
.dot-emerald { background: #10b981; }
.dot-rose { background: #f43f5e; }
.he-status { font-size: 12px; color: #94a3b8; }

.he-viewer { flex: 1; background: #000; position: relative; }
.he-viewer.adding-mode { cursor: crosshair !important; }
.he-viewer.adding-mode * { cursor: crosshair !important; }
.he-viewer.adding-mode .pnlm-hotspot-container,
.he-viewer.adding-mode .pnlm-hotspot-container *,
.he-viewer.adding-mode .pnlm-hotspot-base,
.he-viewer.adding-mode .pnlm-hotspot-base *,
.he-viewer.adding-mode .vt-hotspot,
.he-viewer.adding-mode .vt-hotspot *,
.he-viewer.adding-mode .vt-tooltip,
.he-viewer.adding-mode .vt-tooltip * {
    pointer-events: none !important;
}

.he-meta {
    padding: 8px 14px; background: #0b1120; font-size: 12px; color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Sağ panel */
.he-right { background: #0b1120; border-left: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; }
.he-right-head { padding: 18px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.he-right-head h3 { margin: 0; font-size: 14px; color: white; }
.he-right-head p  { margin: 2px 0 0; font-size: 12px; color: #64748b; }
.he-hotspot-list { flex: 1; overflow-y: auto; padding: 10px; }
.he-empty { color: #64748b; text-align: center; padding: 24px 12px; font-size: 13px; }
.he-hotspot-item {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: 10px; margin-bottom: 6px; background: rgba(255,255,255,0.03);
    transition: background .2s; cursor: pointer;
}
.he-hotspot-item:hover { background: rgba(255,255,255,0.06); }
.he-hotspot-item.selected { background: rgba(99,102,241,0.18); box-shadow: inset 2px 0 0 #6366f1; }
.he-hotspot-icon { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; }
.hi-scene { background: #6366f1; }
.hi-scene::after { content: '↗'; }
.hi-info  { background: #f59e0b; }
.hi-info::after { content: 'i'; font-style: italic; font-family: serif; font-weight: 700; }
.hi-product { background: #10b981; }
.hi-product::after { content: '🛒'; font-size: 11px; }
.hi-label { background: #f43f5e; }
.hi-label::after { content: 'T'; font-weight: 700; }
.he-hotspot-info { flex: 1; min-width: 0; }
.he-hotspot-text { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: white; }
.he-hotspot-meta { font-size: 11px; color: #94a3b8; }
.he-del {
    background: transparent; border: 0; color: #f87171; font-size: 18px; cursor: pointer;
    padding: 0 6px; line-height: 1;
}
.he-del:hover { color: #ef4444; }

.he-right-foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.05); }

/* ----------------- Modal ----------------- */
.he-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.he-modal.hidden { display: none; }
.he-modal-card {
    width: 100%; max-width: 540px;
    background: #1e293b; color: #e2e8f0;
    border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.he-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.he-modal-head h3 { margin: 0; font-size: 16px; color: white; }
.he-modal-close { background: transparent; border: 0; color: #94a3b8; font-size: 24px; cursor: pointer; line-height: 1; }
.he-modal-body { padding: 22px; }
.he-modal-body .form-input { background: #0b1120; color: #e2e8f0; border-color: #334155; }
.he-modal-body .form-input:focus { border-color: #6366f1; }
.he-modal-body .form-label { color: #cbd5e1; }
.he-modal-body .btn-secondary { background: #334155; border-color: #475569; color: white; }
.he-modal-body .btn-secondary:hover { background: #475569; }

/* Responsive */
@media (max-width: 1200px) {
    .hotspot-editor-shell { grid-template-columns: 220px 1fr 280px; }
}
@media (max-width: 992px) {
    .hotspot-editor-shell { grid-template-columns: 1fr; height: auto; }
    .he-left, .he-right { border: 0; border-top: 1px solid rgba(255,255,255,0.05); }
    .he-viewer { height: 500px; }
}

/* Fullscreen adding mode layout overrides */
.hotspot-editor-shell.fullscreen-adding .he-viewer {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}

.hotspot-editor-shell.fullscreen-adding::after {
    content: 'Ekleme Modu Aktif - Lütfen eklemek istediğiniz noktaya tıklayın. İptal etmek için ESC tuşuna basın.';
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
    letter-spacing: 0.02em;
}

.he-modal {
    z-index: 10001 !important;
}
