:root {
    /* Light Mode variables (default) - Professional Blue Scheme */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #f1f5f9;
    --border-color: #e2e8f0;
    --border-glow: #cbd5e1;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.08);
    --primary-text: #ffffff;
    --accent: #0284c7;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;
    --success: #059669;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --transition: all 0.2s ease-in-out;
    --sidebar-width: 260px;
    --sidebar-bg: #ffffff;
}

body.dark-theme {
    /* Dark Mode variables - Deep Navy / Almost Black */
    --bg-base: #030712;
    --bg-surface: #0b1329;
    --bg-card: #111a36;
    --border-color: #1e294b;
    --border-glow: #2e3f73;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-text: #ffffff;
    --accent: #38bdf8;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --sidebar-bg: #0b1329;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Main Layout Structure */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-glow);
    border: 1px solid rgba(79, 70, 229, 0.15);
    font-weight: 600;
}

body.dark-theme .nav-link.active {
    color: var(--primary);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

/* Main Content Panel */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    width: calc(100% - var(--sidebar-width));
}

.content-container {
    width: 100%;
    max-width: 900px;
}

/* Opaque Card Panels */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    width: 100%;
    margin-bottom: 24px;
    transition: var(--transition);
}

.header {
    margin-bottom: 28px;
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

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

/* Buttons styling */
.btn {
    width: 100%;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* Alert Boxes */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
    display: none;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
}

body.dark-theme .alert-success {
    color: #34d399;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

body.dark-theme .alert-error {
    color: #f87171;
}

/* Profile Display widgets */
.profile-view {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-img-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 3px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-meta {
    text-align: center;
    margin-bottom: 28px;
}

.profile-meta h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-meta p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
    width: 100%;
}

.view-section {
    display: none;
    width: 100%;
    animation: fadeIn 0.15s ease-out;
}

.active-section {
    display: block;
}

/* Dynamic grid layout for details */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
    width: 100%;
}

.detail-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    transition: var(--transition);
}

.detail-item:hover {
    border-color: var(--border-glow);
}

.detail-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.bio-text {
    white-space: pre-wrap;
    line-height: 1.5;
}

/* 4-Panel Grid Landing Page Dashboard */
.panels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 12px;
    width: 100%;
}

.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.03);
    border-color: var(--primary);
}

body.dark-theme .panel-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.panel-card.disabled-panel {
    cursor: not-allowed;
    opacity: 0.45;
}

.panel-card.disabled-panel:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}

.panel-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 4px;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.badge {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

body.dark-theme .badge-active {
    border-color: rgba(129, 140, 248, 0.2);
}

.badge-soon {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Flatmate Cards search listing view */
.search-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    margin-bottom: 28px;
    transition: var(--transition);
}

.search-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 25px -3px var(--primary-glow);
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px !important;
    font-size: 1.05rem;
    border-radius: 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-surface);
}

.search-icon-svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.filter-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group select {
    padding: 12px 14px;
    font-size: 0.95rem;
    width: 100%;
    border-radius: 8px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.filter-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.clear-filters-btn {
    width: auto;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    white-space: nowrap;
}

/* Avatar Upload & Crop UI */
.avatar-edit-zone {
    position: relative;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    border: 3px dashed var(--border-glow);
}

.avatar-edit-zone:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    color: #ffffff;
    transition: var(--transition);
}

.avatar-edit-zone:hover .avatar-edit-overlay {
    opacity: 1;
}

.avatar-edit-overlay svg {
    color: #ffffff;
}

.avatar-edit-overlay span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Cropper Modal Card */
.cropper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.cropper-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cropper-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.cropper-card canvas {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #000;
    cursor: move;
    margin-bottom: 16px;
    max-width: 100%;
}

.slider-group {
    width: 100%;
    margin-bottom: 16px;
}

.slider-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.cropper-controls {
    display: flex;
    gap: 12px;
    width: 100%;
}


.flatmates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.flatmate-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.flatmate-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.dark-theme .flatmate-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flatmate-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flatmate-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.flatmate-meta {
    min-width: 0;
}

.flatmate-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flatmate-handle {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.flatmate-uni-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.flatmate-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.flatmate-detail-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flatmate-bio-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

/* Centered login-signup container */
.centered-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-base);
}

.centered-card {
    max-width: 440px;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 12px 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-header {
        margin-bottom: 0;
    }
    
    .nav-links {
        flex-direction: row;
        flex: none;
        gap: 4px;
        align-items: center;
    }
    
    .nav-links .divider {
        display: none !important;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .nav-link span {
        display: none; /* Hide link text to fit all navigation icons on tablet/mobile */
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 12px;
    }
    
    .card {
        padding: 20px 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .profile-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .panels-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .flatmates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Landing Header mobile adjustments */
    .landing-header {
        padding: 12px 16px;
    }
    
    .landing-nav {
        gap: 8px;
    }
    
    .landing-nav .btn {
        padding: 6px 12px !important;
        font-size: 0.8rem;
    }
    
    #onboardingThemeToggleText {
        display: none;
    }
}

@media (max-width: 480px) {
    .sidebar-logo {
        display: none; /* Only show the icon on extremely narrow screens */
    }
    
    .landing-logo .sidebar-logo {
        display: none; /* Only show the icon on extremely narrow screens */
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }
    
    .hero-actions .btn {
        width: 100% !important;
        text-align: center;
        padding: 12px 20px !important;
    }

    .clear-filters-btn {
        width: 100% !important;
    }
}

/* Custom Searchable Dropdown styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
}
.dropdown-input {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 36px 12px 14px !important;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.dropdown-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.dropdown-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}
.searchable-dropdown.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.dropdown-item {
    padding: 10px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}
.dropdown-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
}
.dropdown-item.no-match {
    color: var(--text-muted);
    cursor: default;
    font-size: 0.85rem;
}

/* Landing Page premium styles */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 900;
}
.landing-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.landing-nav {
    display: flex;
    gap: 12px;
}
.landing-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    padding: 100px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.hero-content {
    flex: 1.2;
}
.hero-content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -1px;
}
.hero-content p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 16px;
}
.hero-visual {
    flex: 0.8;
    display: flex;
    justify-content: center;
    position: relative;
}
.visual-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: rotate(2deg);
    transition: var(--transition);
}
.visual-card:hover {
    transform: rotate(0deg) scale(1.03);
}
.visual-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.visual-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}
.visual-name {
    font-weight: 600;
    color: var(--text-primary);
}
.visual-handle {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}
.visual-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: inline-block;
}
.visual-details {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.visual-tag {
    font-size: 0.75rem;
    background: var(--primary-glow);
    border: 1px solid rgba(79, 70, 229, 0.15);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
}
body.dark-theme .visual-tag {
    border-color: rgba(129, 140, 248, 0.2);
}
.visual-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.feature-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
}
.feature-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.landing-footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .landing-hero {
        flex-direction: column;
        padding: 60px 20px;
        text-align: center;
        gap: 40px;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-content h1 {
        font-size: 2.6rem;
    }
    .landing-features {
        grid-template-columns: 1fr;
        padding: 40px 20px;
        gap: 20px;
    }
}

/* Sidebar Navigation Badge */
.nav-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9999px;
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Messaging UI Styles */
.chat-container {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: calc(100vh - 160px);
    min-height: 500px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.chat-sidebar-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversations-loading, .conversations-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.conversation-item:hover {
    background: var(--bg-base);
}

.conversation-item.active {
    background: var(--primary-glow);
    border-left-color: var(--primary);
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-details {
    flex: 1;
    min-width: 0; /* Ensures text truncates instead of overflowing */
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conversation-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.conversation-badge {
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.chat-empty-icon {
    margin-bottom: 16px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.chat-empty-state h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.chat-empty-state p {
    color: var(--text-secondary);
    max-width: 320px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.chat-header-user {
    display: flex;
    align-items: center;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.chat-header-link {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.chat-header-link:hover {
    text-decoration: underline;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-base);
}

.chat-body-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: auto;
}

.chat-date-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 8px 0;
    position: relative;
}

.chat-date-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: calc(50% - 70px);
    border-top: 1px solid var(--border-color);
}

.chat-date-divider::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: calc(50% - 70px);
    border-top: 1px solid var(--border-color);
}

.message-row {
    display: flex;
    width: 100%;
}

.message-row.sent {
    justify-content: flex-end;
}

.message-row.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 65%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    word-break: break-word;
}

.message-row.sent .message-bubble {
    background: var(--primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-meta {
    font-size: 0.7rem;
    margin-top: 6px;
    text-align: right;
    display: block;
    opacity: 0.8;
}

.message-row.sent .message-meta {
    color: rgba(255, 255, 255, 0.9);
}

.message-row.received .message-meta {
    color: var(--text-muted);
}

.chat-input-area {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    height: 48px;
    max-height: 120px;
    transition: var(--transition);
}

.chat-input-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-send {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-back-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.chat-back-btn:hover {
    background: var(--bg-base);
}

@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 120px);
        position: relative;
    }
    
    .chat-container:not(.chat-active) .chat-sidebar {
        width: 100%;
        display: flex;
    }
    
    .chat-container:not(.chat-active) .chat-window {
        display: none;
    }
    
    .chat-container.chat-active .chat-sidebar {
        display: none;
    }
    
    .chat-container.chat-active .chat-window {
        display: flex;
        width: 100%;
    }
    
    .chat-sidebar-header {
        display: block;
    }
    
    .conversation-details {
        display: block;
    }
    
    .conversation-avatar {
        margin-right: 12px;
    }
    
    .conversation-item {
        padding: 16px 20px;
        justify-content: flex-start;
    }
    
    .chat-back-btn {
        display: flex;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--bg-card);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--primary-text);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 8px;
    font-weight: 500;
}

