/* BH Zone - Professional Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Authentication Pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    padding: 0;
    box-shadow: var(--shadow-lg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.7;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 16px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu li a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.main-content {
    flex: 1;
    background: var(--light-bg);
    margin-left: 280px;
}

.top-bar {
    background: white;
    padding: 20px 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 9;
}

.top-bar h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span:first-child {
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-info span:first-child:hover {
    background: var(--gray-100);
}

.content-area {
    padding: 32px;
    max-width: 1400px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--gray-900);
    margin: 8px 0;
}

.card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 16px 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

table th,
table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: background 0.2s;
}

table tbody tr:hover {
    background: var(--gray-50);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Badge */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

/* Virtual Tour */
.virtual-tour-viewer {
    width: 100%;
    height: 500px;
    background: var(--gray-900);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.virtual-tour-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Icon Styles */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Stat Card Icon */
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        flex: 1;
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: all 0.3s ease;
        z-index: 1000;
        height: 100vh;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        width: 100%;
        min-height: 100vh;
        margin-left: 0;
    }
    
    .top-bar {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .top-bar h1 {
        font-size: 20px;
        order: 2;
    }
    
    .user-info {
        order: 3;
    }
    
    .menu-toggle {
        display: flex !important;
        order: 1;
        background: var(--gray-100);
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        color: var(--gray-700);
        font-size: 18px;
    }

    .content-area {
        padding: 20px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Table responsiveness */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    table {
        min-width: 600px; /* Force scroll on small screens */
    }

    /* Stack stat cards better */
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 2em;
    }
    .search-box input, input[id*="Search"], input[id*="search"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .top-bar .user-info {
        margin-left: auto;
    }

    /* Detail views responsiveness */
    .detail-row {
        flex-direction: column;
        padding: 12px 0;
    }

    .detail-label {
        width: 100% !important;
        margin-bottom: 4px;
        font-size: 13px;
        color: var(--gray-500);
    }

    .detail-value {
        font-size: 15px;
        font-weight: 500;
    }

    .house-image {
        max-width: 100%;
        height: auto;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .status-actions {
        flex-direction: column;
        gap: 10px;
    }

    .status-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .info-card {
        padding: 15px;
    }

    /* User info in top bar */
    .user-info {
        gap: 10px;
    }

    .user-info .notification-container {
        position: static;
    }

    .user-info .user-details {
        display: none; /* Hide name text on small mobiles if needed, but let's try keeping it first */
    }
}

@media (max-width: 480px) {
    .top-bar {
        justify-content: space-between;
        padding: 10px 15px;
    }
    
    .top-bar h1 {
        display: none; /* Hide title on very small screens */
    }
    
    .user-info div[style*="flex-direction: column"] {
        display: none !important; /* Hide the name/role text on very small screens */
    }

    .auth-box {
        padding: 24px 16px;
    }
}
