/* --- Admin Base Variables --- */
:root {
    --bg-dark: #0a0a0c;
    --panel-bg: #141418;
    --text-main: #ffffff;
    --text-dim: #8b8b99;
    --gold: #f5b236;
    --gold-glow: rgba(245, 178, 54, 0.15);
    --border: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex; /* Flexes the sidebar and main area side-by-side */
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 280px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.sidebar-logo { margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.sidebar-logo h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.gold-text { color: var(--gold); }
.badge { background: var(--gold-glow); color: var(--gold); font-size: 10px; padding: 4px 8px; border-radius: 6px; font-weight: 800; }

.sidebar-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.nav-btn {
    background: transparent; border: none; color: var(--text-dim);
    padding: 14px 16px; border-radius: 12px; font-size: 15px; font-weight: 600;
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    transition: all 0.2s ease; text-align: left;
}
.nav-btn i { font-size: 20px; }
.nav-btn:hover { background: rgba(255,255,255,0.02); color: var(--text-main); }
.nav-btn.active { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(245, 178, 54, 0.3); }

.nav-count { margin-left: auto; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 10px; font-size: 12px; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 20px; }
.admin-email { font-size: 12px; color: var(--text-dim); margin-bottom: 15px; word-break: break-all; }
.logout-btn { background: transparent; border: 1px solid rgba(255, 59, 48, 0.2); color: #ff3b30; width: 100%; padding: 12px; border-radius: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.logout-btn:hover { background: rgba(255, 59, 48, 0.1); }

/* --- Main Area --- */
.admin-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.main-header h1 { font-size: 28px; font-weight: 800; }

.primary-btn {
    background: var(--gold); color: #000; border: none; padding: 12px 24px;
    border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: transform 0.2s;
}
.primary-btn:active { transform: scale(0.95); }








/* --- Analytics Cards --- */
.analytics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin-bottom: 40px;
}
.stat-card {
    background: var(--panel-bg); border: 1px solid var(--border);
    padding: 24px; border-radius: 16px; display: flex; align-items: center; gap: 20px;
}
.stat-icon { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.stat-details p { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-weight: 600; }
.stat-details h2 { font-size: 28px; font-weight: 800; }

/* --- Master Data Table --- */
.table-container {
    background: var(--panel-bg); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
}
.table-header-row {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.table-header-row h3 { font-size: 16px; font-weight: 700; }
.table-search {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; width: 250px;
}
.table-search input { background: transparent; border: none; color: white; outline: none; width: 100%; font-size: 13px; }
.table-search i { color: var(--text-dim); }

.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 16px 24px; font-size: 12px; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
.admin-table td { padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.admin-table tr:hover { background: rgba(255,255,255,0.02); }

.td-preview img { width: 60px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.td-title { font-weight: 600; margin-bottom: 2px; }
.td-sub { font-size: 12px; color: var(--text-dim); }

/* Status Badges */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-available { background: rgba(37, 211, 102, 0.1); color: #25D366; border: 1px solid rgba(37, 211, 102, 0.2); }
.status-booked { background: rgba(255, 59, 48, 0.1); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.2); }

/* Action Buttons */
.action-group { display: flex; gap: 8px; }
.btn-icon { width: 32px; height: 32px; border-radius: 8px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; font-size: 16px; }
.btn-edit { background: rgba(255,255,255,0.05); color: white; }
.btn-edit:hover { background: rgba(255,255,255,0.1); }
.btn-delete { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }
.btn-delete:hover { background: #ff3b30; color: white; }









/* --- Admin Upload Modal Styles --- */
.profile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: all 0.3s ease;
}
.profile-overlay.active { opacity: 1; pointer-events: auto; }

.profile-content {
    background: var(--panel-bg); border: 1px solid var(--border);
    width: 90%; max-width: 450px; border-radius: 20px; padding: 35px;
    position: relative; transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
}
.profile-overlay.active .profile-content { transform: translateY(0) scale(1); }

/* Close Button */
.close-x {
    position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.05);
    border: none; color: var(--text-dim); width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
    font-size: 16px;
}
.close-x:hover { background: rgba(255,59,48,0.1); color: #ff3b30; }

/* Modal Headers & Inputs */
.profile-header { margin-bottom: 25px; }
.profile-header h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 6px; font-weight: 800;}
.profile-header p { color: var(--text-dim); font-size: 14px; }

.filter-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 5px; }
.filter-group label { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.premium-search-input {
    background: rgba(0,0,0,0.4); border: 1px solid var(--border);
    color: white; padding: 14px 16px; border-radius: 12px; font-size: 14px;
    outline: none; transition: 0.2s; width: 100%;
}
.premium-search-input:focus { 
    border-color: var(--gold); 
    box-shadow: 0 0 15px var(--gold-glow); 
    background: rgba(0,0,0,0.6); 
}

/* Modal Submit Button */
.futuristic-checkout-btn {
    background: var(--gold); color: #000; border: none; width: 100%;
    padding: 16px; border-radius: 14px; font-size: 15px; font-weight: 800;
    cursor: pointer; transition: all 0.2s; margin-top: 15px;
    box-shadow: 0 10px 20px var(--gold-glow);
}
.futuristic-checkout-btn:active { transform: scale(0.97); }








/* --- Form Upgrades --- */
.upload-type-toggle { display: flex; gap: 15px; margin-bottom: 5px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.radio-label input { accent-color: var(--gold); transform: scale(1.1); cursor: pointer; }

textarea.premium-search-input { resize: vertical; min-height: 60px; font-family: inherit; }
input[type="file"].premium-search-input { padding: 10px; font-size: 13px; cursor: pointer; }
input[type="file"]::file-selector-button { background: rgba(255,255,255,0.1); border: none; color: white; padding: 6px 12px; border-radius: 8px; margin-right: 10px; cursor: pointer; font-weight: 600; }

.amenities-checkbox-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.amenities-checkbox-grid label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: white; cursor: pointer; text-transform: none; font-weight: 500; }
.amenities-checkbox-grid input { accent-color: var(--gold); }






.profile-content {
    background: var(--panel-bg); border: 1px solid var(--border);
    width: 90%; max-width: 450px; border-radius: 20px; padding: 35px;
    position: relative; transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
    
    /* ADD THESE TWO LINES SO YOU CAN SCROLL DOWN TO THE NEW FIELDS */
    max-height: 90vh;
    overflow-y: auto;
}





/* --- Hide Ugly Windows Scrollbars --- */
.profile-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}
.profile-content {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- Fix the Missing Admin Toast Notification --- */
.toast-container {
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%); 
    width: 90%; max-width: 400px; z-index: 9999; 
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-container.active { top: 20px; }
.toast-content {
    background: rgba(15, 15, 18, 0.95); border: 1px solid rgba(245, 178, 54, 0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.8); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-radius: 20px; padding: 16px; display: flex; align-items: center; gap: 15px;
}
.toast-icon-wrapper {
    background: linear-gradient(135deg, #f5b236, #d49a24); color: #000;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-size: 22px; flex-shrink: 0;
}
.toast-text h4 { margin: 0 0 4px 0; font-size: 15px; font-weight: 800; color: #fff; }
.toast-text p { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.4; }










/* --- Premium Admin Modals --- */
.admin-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.admin-modal-overlay.active { opacity: 1; pointer-events: auto; }

.admin-modal-content {
    background: var(--panel-bg); border: 1px solid var(--gold-glow);
    padding: 25px; border-radius: 16px; width: 90%; max-width: 400px;
    position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    transform: translateY(20px); transition: transform 0.3s ease;
}
.admin-modal-overlay.active .admin-modal-content { transform: translateY(0); }

.close-modal-btn {
    position: absolute; top: 15px; right: 15px; background: none; border: none;
    color: var(--text-dim); font-size: 20px; cursor: pointer; transition: color 0.2s;
}
.close-modal-btn:hover { color: #ff3b30; }

.admin-modal-btn {
    width: 100%; background: var(--gold); color: #000; border: none; 
    padding: 12px; border-radius: 8px; font-weight: 800; cursor: pointer; 
    margin-top: 20px; font-size: 15px; transition: opacity 0.2s;
}
.admin-modal-btn:hover { opacity: 0.9; }







/* --- Premium File Upload Styling --- */
input[type="file"].premium-search-input {
    padding: 8px 12px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(245, 178, 54, 0.5); /* Premium Gold Dashed Border */
    position: relative;
    cursor: pointer;
}

/* Style the actual "Choose File" button inside the input */
input[type="file"].premium-search-input::file-selector-button {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    margin-right: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="file"].premium-search-input::file-selector-button:active {
    transform: scale(0.95);
}

/* --- Fix Placeholder Text Overflow --- */
.premium-search-input {
    text-overflow: ellipsis; /* Adds the "..." if text is too long */
    white-space: nowrap;
    overflow: hidden;
}

.premium-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    text-overflow: ellipsis;
}







/* =========================================
   PREMIUM MOBILE RESPONSIVENESS (SMARTPHONE APP MODE)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Ensure body doesn't flex awkwardly */
    body {
        display: block !important;
    }

    /* 2. The Sleek iOS-Style App Dock */
    .admin-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 5px;
        z-index: 9999;
        background: rgba(15, 15, 18, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-right: none;
    }

    /* Hide desktop elements */
    .sidebar-logo, .sidebar-footer {
        display: none;
    }

    /* 3. Evenly space the nav buttons */
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    /* 4. Fix the stretched buttons & cramped text */
    .nav-btn {
        flex-direction: column;
        padding: 6px 2px;
        font-size: 9px;
        justify-content: center;
        text-align: center;
        border-radius: 8px;
        flex: 1; /* Forces all buttons to share space equally */
        white-space: nowrap; /* Stops text from breaking to two lines */
        background: transparent !important; /* Removes the ugly stretched background */
        border: none !important;
        position: relative;
    }

    .nav-btn i {
        font-size: 22px;
        margin-bottom: 4px;
        margin-right: 0;
    }

    /* Clean mobile active state (just colors the icon/text, no borders) */
    .nav-btn.active {
        color: var(--gold) !important;
        transform: translateY(-2px); /* Slight pop effect */
    }

    /* Fix the notification badge placement */
    .nav-count {
        position: absolute;
        top: 2px;
        right: 15%;
        font-size: 9px;
        padding: 2px 5px;
        background: #ff3b30;
        color: white;
    }

    /* 5. Push content up so it doesn't hide behind the dock */
    .admin-main {
        padding: 15px;
        height: 100vh;
        overflow-y: auto;
        padding-bottom: 90px; /* THE FIX: Extra space at the bottom */
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .analytics-grid {
        grid-template-columns: 1fr; /* Stack the stat cards */
    }

    /* 6. Smooth horizontal scrolling for wide tables */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; 
    }

    .admin-table {
        min-width: 650px; /* Keeps data readable by forcing width */
    }

    .table-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-search {
        width: 100%;
    }
}
