/* admin.css - Premium Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #4f46e5;      /* Deep Indigo */
    --primary-hover: #4338ca;
    --secondary-color: #6366f1;
    --success-color: #10b981;      /* Emerald */
    --danger-color: #f43f5e;       /* Rose */
    --warning-color: #f59e0b;      /* Amber */
    --info-color: #0ea5e9;         /* Sky Blue */
    --dark-color: #0f172a;         /* Slate 900 */
    --text-muted: #64748b;         /* Slate 500 */
    --light-bg: #f8fafc;           /* Slate 50 */
    --sidebar-bg: #0f172a;         
    --sidebar-text: #94a3b8;       
    --sidebar-active: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-soft: 0 10px 40px -10px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
}

.login-box {
    width: 420px;
    max-width: 90%;
    animation: fadeInUp 0.8s ease-out;
}

.login-logo h2 {
    color: var(--dark-color);
    font-weight: 800;
    letter-spacing: -1px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

/* Dashboard Layout */
#wrapper {
    display: flex;
    width: 100%;
}

#sidebar {
    width: 250px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1040;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
}

#sidebar .sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 15px 25px;
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

#sidebar ul li a i {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: var(--sidebar-active);
    background: rgba(255,255,255,0.05);
    border-left: 4px solid var(--primary-color);
}

#sidebar ul li a:hover i {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary-color);
}

#content-wrapper {
    width: calc(100% - 250px);
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-toggled #sidebar {
    transform: translateX(-100%);
}

body.sidebar-toggled #content-wrapper {
    margin-left: 0;
    width: 100%;
}

.topbar {
    height: 70px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.main-content {
    padding: 30px;
    flex-grow: 1;
}

/* Cards & Statistics */
.card, .stat-card {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card:hover, .stat-card:hover {
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    transform: translateY(-8px);
}

.stat-card.primary-hover:hover { box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15); border-bottom: 4px solid var(--primary-color); }
.stat-card.success-hover:hover { box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15); border-bottom: 4px solid var(--success-color); }
.stat-card.warning-hover:hover { box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15); border-bottom: 4px solid var(--warning-color); }
.stat-card.danger-hover:hover { box-shadow: 0 20px 40px rgba(244, 63, 94, 0.15); border-bottom: 4px solid var(--danger-color); }

.stat-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.stat-card .card-body {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card .icon {
    width: 65px;
    height: 65px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    position: relative;
    z-index: 2;
}

.stat-card:hover .icon {
    transform: scale(1.15) rotate(10deg);
}

.bg-light-primary { background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(79, 70, 229, 0.05)); color: var(--primary-color); box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15); border: 1px solid rgba(79, 70, 229, 0.1); }
.bg-light-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); color: var(--success-color); box-shadow: 0 8px 16px rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.1); }
.bg-light-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: var(--warning-color); box-shadow: 0 8px 16px rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.1); }
.bg-light-danger { background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.05)); color: var(--danger-color); box-shadow: 0 8px 16px rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.1); }

/* Premium Buttons */
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); border-radius: 8px; font-weight: 500; transition: all 0.2s; }
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); transform: translateY(-1px); }

/* Custom Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 30px;
    letter-spacing: 0.3px;
}
.bg-success { background-color: #d1fae5 !important; color: #059669 !important; }
.bg-danger { background-color: #ffe4e6 !important; color: #e11d48 !important; }
.bg-warning { background-color: #fef3c7 !important; color: #d97706 !important; }
.bg-info { background-color: #e0f2fe !important; color: #0284c7 !important; }

/* Building Visual Layout */
.floor-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.floor-title {
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.flat-box {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
    transition: 0.3s;
    cursor: pointer;
}

.flat-box:hover {
    opacity: 0.9;
}

.bg-vacant { background-color: #2a9d8f; } /* Green */
.bg-occupied { background-color: #e63946; } /* Red */
.bg-reserved { background-color: #f4a261; } /* Orange */

/* Tables */
.table-responsive {
    border-radius: 12px;
}

.table-custom {
    background: white;
    border-radius: 12px;
    margin-bottom: 0;
}

.table-custom thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-custom tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.table-custom tbody tr {
    transition: background-color 0.2s;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SweetAlert overrides for premium feel */
div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 20px !important;
    padding: 2rem !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    box-shadow: var(--shadow-soft) !important;
}

div:where(.swal2-container) button:where(.swal2-styled) {
    border-radius: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

/* Mobile App Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.05);
    z-index: 1000;
    justify-content: space-around;
    padding: 10px 0 15px 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-bottom-nav .nav-item:active i {
    transform: scale(0.8);
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .nav-item.active i {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 15px rgba(79, 70, 229, 0.15);
}

.mobile-bottom-nav .nav-item:hover {
    color: var(--primary-color);
}

/* Beautiful Dashboard Cards */
.building-card {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    position: relative;
}

.building-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color), var(--success-color));
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.building-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
}

.building-card .card-header {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    padding: 24px 24px 15px 24px;
}

/* Island Tabs for Buildings Overview */
.island-tabs-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.island-tabs {
    background: #ffffff;
    border-radius: 50px;
    padding: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 10px 25px rgba(15, 23, 42, 0.06);
    display: inline-flex;
    margin: 0 auto 30px auto;
    border: 1px solid rgba(226, 232, 240, 0.8);
    flex-wrap: wrap;
    justify-content: center;
}

.island-tabs .nav-item {
    margin: 0 4px;
}

.island-tabs .nav-link {
    border-radius: 40px;
    padding: 10px 24px;
    color: var(--text-muted);
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.island-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(248, 250, 252, 0.8);
}

.island-tabs .nav-link.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.05));
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15), inset 0 2px 4px rgba(255,255,255,0.8);
    border: 1px solid rgba(79, 70, 229, 0.2);
    transform: translateY(-2px);
}

.building-card .icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.1);
}

.building-card .card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dark-color);
    letter-spacing: -0.3px;
}

.building-card .card-body {
    padding: 10px 24px 24px 24px;
}

.btn-light-primary {
    background: #e0e7ff;
    color: var(--primary-color);
    border: none;
}

.btn-light-primary:hover {
    background: var(--primary-color);
    color: white;
}

.stats-section .section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.progress-beautiful {
    height: 12px !important;
    border-radius: 20px !important;
    background: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.progress-beautiful .progress-bar {
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.progress-beautiful .progress-bar.bg-danger {
    background: linear-gradient(90deg, #f43f5e, #fb7185) !important;
    box-shadow: 0 2px 5px rgba(244, 63, 94, 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

.progress-beautiful .progress-bar.bg-success {
    background: linear-gradient(90deg, #10b981, #34d399) !important;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Animated Map Button */
.btn-map-animated {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white !important;
    padding: 8px 24px;
    border: none;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-map-animated::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--info-color), var(--success-color));
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.btn-map-animated:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-map-animated:hover::before {
    opacity: 1;
}

.btn-map-animated i {
    animation: bounceRight 2s infinite;
}

@keyframes bounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Media Queries for Mobile Nav */
@media (max-width: 768px) {
    #sidebar {
        display: block !important;
        transform: translateX(-100%); /* Hidden by default on mobile */
        box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    }
    body.sidebar-toggled #sidebar {
        transform: translateX(0); /* Shown when toggled on mobile */
    }
    #content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .topbar .btn-light {
        display: inline-block !important; /* Ensure sidebar toggle button is visible */
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1030;
        opacity: 0;
        transition: opacity 0.3s;
    }
    body.sidebar-toggled .sidebar-overlay {
        display: block;
        opacity: 1;
    }
}
