/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — PREMIUM DARK THEME
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #1a1a1a;
    --border: #222222;
    --text: #f0f0f0;
    --text-secondary: #9CA3AF;
    --gold: #D4AF37;
    --gold-dim: rgba(212, 175, 55, 0.15);
    --error: #ef4444;
    --success: #22c55e;
    --radius: 12px;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── VIEWS ── */
.view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── GLASS ── */
.glass {
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    text-align: center;
}

.logo-mark {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 12px;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.admin-form { display: flex; flex-direction: column; gap: 16px; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-group label, .form-label-sm {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-group input, .form-group select, .form-group textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.3s;
    outline: none;
    width: 100%;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--gold);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

/* ── BUTTONS ── */
.btn-primary {
    background: var(--gold);
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary.full-width { width: 100%; }

.btn-text {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-family: var(--font-body);
}
.btn-text:hover { color: var(--error); border-color: var(--error); }

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.nav-brand .logo-mark { font-size: 20px; margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════ */

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
}

.dash-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ── CATEGORY TABS ── */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.admin-tab:hover { border-color: var(--gold); color: var(--text); }
.admin-tab.active {
    background: var(--gold);
    color: #0a0a0a;
    border-color: var(--gold);
    font-weight: 600;
}

/* ── PROPERTIES GRID ── */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    min-height: 100px;
}

.property-card {
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.property-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-sold { background: var(--error); color: #fff; }
.status-negotiating { background: #f59e0b; color: #000; }

.img-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    backdrop-filter: blur(4px);
}

.property-info { padding: 16px; }

.property-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.property-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.property-price {
    color: var(--gold);
    font-weight: 600;
}

.property-specs-mini {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.action-btn:hover { border-color: var(--gold); color: var(--gold); }
.action-btn.delete-btn:hover { border-color: var(--error); color: var(--error); }

/* ═══════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    z-index: 1;
}

.modal-content.modal-large {
    max-width: 640px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 2;
}
.modal-close:hover { color: var(--text); }

.modal-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════
   MULTI-IMAGE UPLOAD ZONE
   ═══════════════════════════════════════════════════════════ */

.multi-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    transition: border-color 0.3s, background 0.3s;
    cursor: pointer;
}

.multi-upload-zone:hover {
    border-color: var(--gold);
    background: var(--gold-dim);
}

.multi-upload-zone.small {
    margin-top: 8px;
}

.upload-zone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    gap: 8px;
    cursor: pointer;
    text-align: center;
}

.multi-upload-zone.small .upload-zone-label {
    padding: 16px;
    flex-direction: row;
    gap: 10px;
}

.upload-zone-icon { font-size: 32px; }
.multi-upload-zone.small .upload-zone-icon { font-size: 20px; }

.upload-zone-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-zone-hint {
    font-size: 12px;
    color: #555;
}

/* ── IMAGE PREVIEWS GRID ── */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s;
}
.preview-remove:hover { transform: scale(1.1); }

/* ═══════════════════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════════════════ */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
    grid-column: 1 / -1;
}

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

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .form-row { flex-direction: column; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .admin-nav { padding: 12px 16px; }
    .dashboard-main { padding: 16px; }
    .modal-content { padding: 24px 16px; }
    .properties-grid { grid-template-columns: 1fr; }
}
