/* ==========================================================================
   Sofana Company - Admin Control Panel & R2 Media Studio Styles
   ========================================================================== */

:root {
    --bg-deep: #06130c;
    --bg-card: rgba(10, 29, 19, 0.92);
    --bg-input: rgba(4, 12, 8, 0.85);
    --gold: #d4af37;
    --gold-light: #f3d068;
    --gold-dark: #a6821c;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --emerald: #10b981;
    --border-dark: rgba(212, 175, 55, 0.25);
    --text-main: #ffffff;
    --text-muted: #a3b8ac;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-ar: 'Cairo', 'Tajawal', sans-serif;
}

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

body {
    font-family: var(--font-ar);
    background: radial-gradient(circle at top center, #133524 0%, #07160e 50%, #040d08 100%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Utilities */
.hidden { display: none !important; }
.text-gold { color: var(--gold-light); }
.text-muted { color: var(--text-muted); }

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 2.4rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
    text-align: center;
    backdrop-filter: blur(20px);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 25px var(--gold-glow);
    margin: 0 auto 1.2rem auto;
    object-fit: cover;
}

.login-title {
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 35%, var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
}

/* Header */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 16, 10, 0.96);
    border-bottom: 1.5px solid var(--border-dark);
    backdrop-filter: blur(18px);
    padding: 0.85rem 1.5rem;
}

.admin-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-brand img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--gold);
    object-fit: cover;
}

.admin-brand-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
}

.admin-brand-sub {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 700;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cloud-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.cloud-status-pill.connected {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.cloud-status-pill.local {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

/* Container & Tabs */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.admin-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-tab-btn {
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-tab-btn:hover {
    border-color: var(--gold);
    color: #fff;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #06130c;
    border-color: var(--gold-light);
    box-shadow: 0 5px 18px var(--gold-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #06130c;
    box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px var(--gold-glow);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-dark);
    color: #fff;
}

.btn-outline:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.14);
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981, #047857);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    padding: 0.42rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
    margin-bottom: 1.1rem;
    text-align: right;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.45rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.72rem 0.95rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

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

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Cards & Sections */
.panel-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-card-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
}

.kpi-num {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--gold-light);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Hotels List Table / Grid */
.hotels-toolbar {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
    align-items: center;
    justify-content: space-between;
}

.admin-hotels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.1rem;
}

.admin-hotel-card {
    background: rgba(8, 24, 15, 0.9);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-hotel-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.admin-hotel-thumb {
    height: 170px;
    position: relative;
    background: #040d08;
    overflow: hidden;
}

.admin-hotel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-hotel-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    left: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.badge-pill {
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(5, 16, 10, 0.85);
    border: 1px solid var(--gold);
    color: var(--gold-light);
}

.admin-hotel-body {
    padding: 1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-hotel-name {
    font-size: 1.08rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.2rem;
}

.admin-hotel-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}

.media-summary-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.media-chip {
    font-size: 0.72rem;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #d1fae5;
}

.admin-hotel-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* Chips (Views & Amenities) */
.chips-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.toggle-chip {
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.toggle-chip.selected {
    background: rgba(212, 175, 55, 0.22);
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

/* Dynamic Rows (Room Categories, Views with Price) */
.dynamic-row-card {
    background: rgba(4, 12, 8, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.8rem;
}

/* Media Dropzones */
.media-dropzone {
    border: 2px dashed rgba(212, 175, 55, 0.45);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    background: rgba(212, 175, 55, 0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.media-dropzone:hover,
.media-dropzone.dragover {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--gold-light);
}

.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 0.85rem;
}

.media-item-box {
    background: rgba(4, 12, 8, 0.85);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.media-item-box.is-cover {
    border-color: var(--gold-light);
    box-shadow: 0 0 15px var(--gold-glow);
}

.media-item-box img,
.media-item-box video {
    width: 100%;
    height: 125px;
    object-fit: cover;
    background: #000;
}

.media-item-actions {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.6rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--emerald));
    width: 0%;
    transition: width 0.2s ease;
}

/* Sticky Save Footer in Editor */
.editor-sticky-footer {
    position: sticky;
    bottom: 12px;
    z-index: 90;
    background: rgba(6, 19, 12, 0.96);
    border: 1.5px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(18px);
}

/* Modal for 360 Panorama Preview */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.admin-modal-box {
    width: 100%;
    max-width: 900px;
    background: var(--bg-card);
    border: 1.5px solid var(--gold);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-modal-header {
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-dark);
}

.pano-preview-stage {
    width: 100%;
    height: 460px;
    background: #000;
    position: relative;
}

/* Toast Notification */
.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 3000;
    background: #092014;
    border: 1.5px solid var(--gold);
    color: #fff;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    font-weight: 700;
    font-size: 0.9rem;
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.3s ease;
}

.admin-toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .admin-container {
        padding: 1rem 0.75rem;
    }
    .pano-preview-stage {
        height: 360px;
    }
}

