/*
 * Keduchat - Master Stylesheet
 * Version: 1.0.0
 * Author: Your Name
 * Description: A mobile-first, modern design system for the Keduchat platform.
 */
/* --- 1. Design System: CSS Variables --- */
:root {
    /* Color Palette */
    --primary-color: #00A859; /* A vibrant, trustworthy green for Africa */
    --primary-color-dark: #007F4E;
    --secondary-color: #FFC107; /* A warm, energetic accent yellow/gold */
    --background-color: #F4F6F9; /* A light, clean grey for backgrounds */
    --surface-color: #FFFFFF; /* For cards, modals, etc. */
    --text-color-primary: #1A202C; /* Dark, readable text */
    --text-color-secondary: #718096; /* Lighter text for subtitles */
    --border-color: #E2E8F0;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --link-color: var(--primary-color);
    /* Typography */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 16px;
    --font-weight-normal: 400;
    --font-weight-bold: 700;
    /* Spacing & Sizing */
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem; /* 8px */
    --spacing-md: 1rem; /* 16px */
    --spacing-lg: 1.5rem; /* 24px */
    --spacing-xl: 2rem; /* 32px */
    /* Borders & Shadows */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --box-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
/* --- 2. Global Resets & Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* --- 3. Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
}
p {
    margin-bottom: var(--spacing-md);
}
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}
/* --- 4. Layout & Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}
/* --- 5. Reusable Components --- */
/* Buttons */
.btn {
    display: inline-block;
    font-weight: var(--font-weight-bold);
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease-in-out;
    user-select: none;
}
.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    color: #fff;
    text-decoration: none;
}
.btn-secondary {
    color: var(--text-color-primary);
    background-color: var(--surface-color);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--background-color);
    text-decoration: none;
}
.btn-block {
    display: block;
    width: 100%;
}
/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}
.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-bold);
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color-primary);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.25);
}
/* Cards */
.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}
/* Alerts */
.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
/* --- 6. Navigation --- */
.navbar {
    background: var(--surface-color);
    box-shadow: var(--box-shadow-md);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-brand {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
}
.navbar-brand:hover {
    text-decoration: none;
    color: var(--primary-color-dark);
}
.nav-links a {
    color: var(--text-color-primary);
    margin-left: var(--spacing-lg);
    font-weight: var(--font-weight-bold);
}
/* --- 7. Responsive Design (Mobile First) --- */
@media (min-width: 768px) {
    .container {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}
/* --- 8. Authentication Pages --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns to top for longer forms */
    min-height: 80vh;
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}
.auth-card {
    width: 100%;
    max-width: 450px;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}
.auth-card .sub-heading {
    text-align: center;
    color: var(--text-color-secondary);
    margin-bottom: var(--spacing-lg);
}
.auth-card .form-footer-link {
    text-align: center;
    margin-top: var(--spacing-lg);
}
.invalid-feedback {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}
.form-control.is-invalid {
    border-color: var(--error-color);
}
/* Custom Account Type Selector */
.account-type-selector {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.account-type-selector input[type="radio"] {
    display: none; /* Hide the default radio button */
}
.account-type-selector label {
    flex: 1;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.2s ease-in-out;
}
.account-type-selector label i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}
.account-type-selector label span {
    font-weight: var(--font-weight-bold);
}
.account-type-selector input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background-color: rgba(0, 168, 89, 0.05);
    color: var(--primary-color);
}
/* --- 9. Authenticated App Layout --- */
.app-layout {
    display: flex;
    min-height: calc(100vh - 70px); /* 100% height minus navbar */
}
.sidebar {
    width: 250px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}
.sidebar-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h3 {
    margin-bottom: 0;
}
.sidebar-nav ul {
    list-style: none;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem var(--spacing-md);
    color: var(--text-color-secondary);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
}
.sidebar-nav a:hover {
    background: var(--background-color);
    color: var(--text-color-primary);
    text-decoration: none;
}
.sidebar-nav a.active {
    background: var(--primary-color);
    color: #fff;
}
.sidebar-nav a i {
    width: 20px;
    margin-right: var(--spacing-md);
    text-align: center;
}
.main-content {
    flex-grow: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}
/* --- 10. Dashboard Specifics --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}
.summary-card {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
}
.summary-card .icon {
    font-size: 2rem;
    padding: var(--spacing-md);
    margin-right: var(--spacing-lg);
    border-radius: 50%;
    color: #fff;
}
.summary-card .icon.bg-green { background-color: var(--primary-color); }
.summary-card .icon.bg-yellow { background-color: var(--secondary-color); }
.summary-card .icon.bg-blue { background-color: #3498db; }
.summary-card .icon.bg-purple { background-color: #9b59b6; }
.summary-card .info h4 {
    margin: 0;
    font-size: 1.5rem;
}
.summary-card .info p {
    margin: 0;
    color: var(--text-color-secondary);
}
/* --- 11. Profile Page --- */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--surface-color);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--spacing-md);
    border: 4px solid var(--surface-color);
    box-shadow: var(--box-shadow-md);
}
.profile-header h2 {
    margin-bottom: var(--spacing-xs);
}
.profile-header .location {
    color: var(--text-color-secondary);
    margin-bottom: var(--spacing-lg);
}
.profile-header .location i {
    margin-right: var(--spacing-sm);
}
.profile-content .card-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    list-style: none;
}
.skill-tag {
    background-color: var(--background-color);
    color: var(--text-color-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 20px;
    font-size: 0.9rem;
}
/* --- 12. Wallet Page --- */
.wallet-summary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-dark));
    color: #fff;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}
.wallet-summary .balance-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: var(--spacing-sm);
}
.wallet-summary .balance-amount {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -1px;
}
.wallet-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}
.wallet-actions .btn {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}
.wallet-actions .btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.transaction-history .card-header {
    font-size: 1.25rem;
    font-weight: bold;
}
.transaction-list {
    list-style: none;
}
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}
.transaction-item:last-child {
    border-bottom: none;
}
.transaction-item .details .description {
    font-weight: var(--font-weight-bold);
}
.transaction-item .details .date {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}
.transaction-item .amount {
    font-weight: var(--font-weight-bold);
    font-size: 1.1rem;
}
.transaction-item .amount.credit { color: var(--success-color); }
.transaction-item .amount.debit { color: var(--error-color); }
/* --- 13. Interactive Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 32, 44, 0.7);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal.is-active {
    display: flex; /* Shown with JS */
}
.modal-content {
    background-color: var(--surface-color);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-secondary);
}
.modal-content h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
/* --- 14. Marketplace & Products --- */
.marketplace-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.search-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    flex-grow: 1;
}
.search-filter-form .form-control {
    min-width: 200px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}
.product-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
}
.product-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.product-card-body {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color-primary);
}
.product-card-title:hover {
    color: var(--primary-color);
    text-decoration: none;
}
.product-card-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}
.product-card-seller {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin-top: auto; /* Pushes seller info to the bottom */
}
/* Single Product Page */
.product-single-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
}
.product-gallery-main {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
}
.product-gallery-thumbnails {
    display: flex;
    gap: var(--spacing-md);
}
.product-gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.product-gallery-thumb:hover, .product-gallery-thumb.active {
    border-color: var(--primary-color);
}
.product-details .price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}
.seller-info-card {
    padding: var(--spacing-lg);
    background: var(--background-color);
    border-radius: var(--border-radius-md);
}
.seller-info-card h4 {
    margin-bottom: var(--spacing-lg);
}
@media (max-width: 992px) {
    .product-single-layout {
        grid-template-columns: 1fr;
    }
}
/* --- 15. Gig Economy --- */
.gig-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--surface-color);
    transition: box-shadow 0.2s, border-color 0.2s;
    margin-bottom: var(--spacing-lg);
}
.gig-card:hover {
    box-shadow: var(--box-shadow-md);
    border-color: var(--primary-color);
}
.gig-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}
.gig-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-color-primary);
}
.gig-card-title:hover {
    color: var(--primary-color);
    text-decoration: none;
}
.gig-card-budget {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-left: var(--spacing-md);
}
.gig-card-description {
    color: var(--text-color-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}
.gig-card-footer {
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}
/* Gig Status Badges */
.gig-status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    text-transform: uppercase;
}
.status-open { background-color: #d4edda; color: #155724; }
.status-in_progress { background-color: #cce5ff; color: #004085; }
.status-pending_approval { background-color: #fff3cd; color: #856404; }
.status-completed { background-color: #e2e3e5; color: #383d41; }
/* Single Gig Page */
.gig-detail-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: var(--spacing-xl);
}
.gig-detail-main h1 {
    margin-bottom: var(--spacing-md);
}
.gig-detail-sidebar .card {
    position: sticky;
    top: 90px; /* Below navbar */
}
.applicant-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.applicant-info {
    display: flex;
    align-items: center;
}
.applicant-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: var(--spacing-md);
}
.applicant-info strong {
    display: block;
}
@media (max-width: 992px) {
    .gig-detail-layout {
        grid-template-columns: 1fr;
    }
    /* This forces the sidebar to appear below the main content on mobile */
    .gig-detail-sidebar {
        grid-row-start: 2;
    }
}
/* --- 16. Real-Time Chat System --- */
.chat-layout {
    display: flex;
    height: calc(100vh - 70px); /* Full height minus navbar */
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}
.conversations-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.conversations-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.conversations-header .toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color-primary);
    cursor: pointer;
}
.conversations-list {
    overflow-y: auto;
    flex-grow: 1;
}
.conversation-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.conversation-item:hover {
    background-color: var(--background-color);
}
.conversation-item.active {
    background-color: var(--primary-color-dark);
    color: #fff;
}
.conversation-item.active .conversation-details .name { color: #fff; }
.conversation-item.active .conversation-details .last-message { color: rgba(255,255,255,0.8); }
.conversation-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: var(--spacing-md);
    object-fit: cover;
}
.conversation-details {
    overflow: hidden;
}
.conversation-details .name {
    font-weight: bold;
    color: var(--text-color-primary);
}
.conversation-details .last-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}
.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}
.chat-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header .toggle-sidebar-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color-primary);
    cursor: pointer;
}
.message-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    min-height: 200px; /* Ensure visibility */
}
.message-bubble {
    max-width: 70%;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 18px;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}
.message-sent {
    background-color: var(--primary-color);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.message-received {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}
.message-form {
    display: flex;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--surface-color);
    z-index: 10;
}
.message-form textarea {
    flex-grow: 1;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    resize: none;
    border: 1px solid var(--border-color);
}
.message-form button {
    margin-left: var(--spacing-md);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    padding: 0;
}
@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
        height: calc(100vh - 70px - 65px); /* Account for navbar and mobile-footer-nav */
        position: relative;
    }
    .conversations-sidebar {
        width: 100%;
        position: absolute;
        left: -100%;
        transition: left 0.3s ease-in-out;
        z-index: 10;
        background: var(--surface-color);
        max-height: 100%; /* Full height for sidebar */
    }
    .conversations-sidebar.is-visible {
        left: 0;
    }
    .conversations-header .toggle-sidebar {
        display: block;
    }
    .chat-window {
        height: 100%;
        padding-bottom: 65px; /* Prevent overlap with mobile-footer-nav */
    }
    .chat-header .toggle-sidebar-mobile {
        display: block;
    }
    .message-area {
        flex-grow: 1;
        min-height: auto; /* Allow dynamic height */
    }
    .message-form {
        position: sticky;
        bottom: 0;
    }
}
/* --- 17. PWA & Offline UI --- */
.offline-banner {
    position: fixed;
    bottom: -100px; /* Hidden by default */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--error-color);
    color: #fff;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-md);
    z-index: 3000;
    transition: bottom 0.5s ease-in-out;
}
.offline-banner.is-visible {
    bottom: var(--spacing-lg); /* Slides into view */
}
/* --- 18. Homepage & Public Pages --- */
.hero {
    text-align: center;
    padding: 4rem 0;
    background-color: var(--surface-color);
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-color-secondary);
    max-width: 700px;
    margin: 0 auto var(--spacing-lg) auto;
}
.hero .cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}
.features-section {
    padding: 4rem 0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    text-align: center;
}
.feature-item .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
}
.feature-item h3 {
    margin-bottom: var(--spacing-sm);
}
.cta-section {
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 4rem 0;
    border-radius: var(--border-radius-md);
}
.cta-section h2 {
    font-size: 2.5rem;
}
.cta-section .btn-secondary {
    background-color: #fff;
    color: var(--primary-color);
}
.cta-section .btn-secondary:hover {
    background-color: var(--background-color);
}
/* --- 19. Dynamic User Navigation --- */
.user-menu {
    position: relative;
    display: inline-block;
}
.user-menu-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-family-sans);
    font-size: 1rem;
}
.user-menu-trigger img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    object-fit: cover;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-md);
    list-style: none;
    min-width: 200px;
    z-index: 1100;
    overflow: hidden;
}
.user-menu-dropdown.is-active {
    display: block;
}
.user-menu-dropdown a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color-primary);
    white-space: nowrap;
}
.user-menu-dropdown a:hover {
    background-color: var(--background-color);
    text-decoration: none;
}
.user-menu-dropdown .divider {
    height: 1px;
    background-color: var(--border-color);
    margin: var(--spacing-sm) 0;
}
/* --- 20. Review & Rating System --- */
.star-rating {
    display: flex;
    flex-direction: row-reverse; /* This is the magic for the hover effect */
    justify-content: flex-end;
    font-size: 2rem;
}
.star-rating input {
    display: none;
}
.star-rating label {
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}
.star-rating input:checked ~ label,
.star-rating:not(:checked) > label:hover,
.star-rating:not(:checked) > label:hover ~ label {
    color: var(--secondary-color);
}
.star-rating input:checked + label:hover,
.star-rating input:checked ~ label:hover,
.star-rating label:hover ~ input:checked ~ label {
    color: #ff9800;
}
.review-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border-color);
}
.review-card:last-child {
    border-bottom: none;
}
.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.review-content .reviewer-name {
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}
.review-content .rating-display {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}
.profile-rating-summary {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: 1.2rem;
}
.profile-rating-summary .stars {
    color: var(--secondary-color);
}
/* --- 21. Dashboard Activity Feed --- */
.activity-feed {
    list-style: none;
    padding: 0;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.activity-icon i {
    font-size: 1rem;
}
.activity-details .message {
    margin-bottom: var(--spacing-xs);
}
.activity-details .timestamp {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
}
/* --- 22. FINAL RESPONSIVE & MOBILE UX FIXES --- */
/* This applies to all screens 992px wide or less (tablets and phones) */
@media (max-width: 992px) {
    /* --- Fix the Header --- */
    /* Hide the text in the user menu to prevent ugly wrapping */
    .user-menu-trigger span {
        display: none;
    }
    .user-menu-trigger i.fa-chevron-down {
        display: none;
    }
    .user-menu-trigger img {
        margin-right: 0; /* Remove space since text is gone */
    }
    /* --- Fix the Main App Layout (Most Important Part) --- */
    /* Stack the sidebar and main content vertically instead of side-by-side */
    .app-layout {
        flex-direction: column;
        height: auto; /* Allow height to be determined by content */
    }
    /* Make the sidebar take up the full width */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing-md);
    }
    .sidebar-header {
        display: none; /* Hide the "Menu" title on mobile */
    }
    .sidebar-nav ul {
        display: flex; /* Make the menu items horizontal */
        justify-content: space-around; /* Distribute them evenly */
        overflow-x: auto; /* Allow scrolling if they don't fit */
        padding-bottom: var(--spacing-sm);
    }
    .sidebar-nav a {
        flex-direction: column; /* Stack icon on top of text */
        font-size: 0.8rem;
        padding: var(--spacing-sm);
        margin-bottom: 0;
    }
    .sidebar-nav a i {
        margin-right: 0;
        margin-bottom: var(--spacing-xs);
        font-size: 1.2rem;
    }
    /* Adjust the main content area */
    .main-content {
        padding: var(--spacing-md);
        padding-bottom: 80px; /* Account for mobile-footer-nav */
    }
    /* --- Fix the Chat Layout on Mobile --- */
    .chat-layout {
        flex-direction: column;
        height: calc(100vh - 70px - 65px); /* Account for navbar and mobile-footer-nav */
        position: relative;
    }
    .conversations-sidebar {
        width: 100%;
        position: absolute;
        left: -100%;
        transition: left 0.3s ease-in-out;
        z-index: 10;
        background: var(--surface-color);
        max-height: 100%; /* Full height for sidebar */
    }
    .conversations-sidebar.is-visible {
        left: 0;
    }
    .conversations-header .toggle-sidebar {
        display: block;
    }
    .chat-window {
        height: 100%;
        padding-bottom: 65px; /* Prevent overlap with mobile-footer-nav */
    }
    .chat-header .toggle-sidebar-mobile {
        display: block;
    }
    .message-area {
        flex-grow: 1;
        min-height: auto; /* Allow dynamic height */
    }
    .message-form {
        position: sticky;
        bottom: 0;
    }
}
/* --- 23. In-App Notification System --- */
.notification-menu {
    position: relative;
    margin-right: var(--spacing-lg);
}
.notification-bell {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color-secondary);
    cursor: pointer;
    position: relative;
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--error-color);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-color);
}
.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 150%;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-md);
    width: 350px;
    z-index: 1200;
    overflow: hidden;
}
.notification-dropdown.is-active {
    display: block;
}
.notification-header {
    padding: var(--spacing-md);
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}
.notification-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color-primary);
}
.notification-item:hover {
    background-color: var(--background-color);
    text-decoration: none;
}
.notification-item.unread {
    background-color: #e8f5e9; /* Light green for unread */
}
.notification-footer {
    display: block;
    text-align: center;
    padding: var(--spacing-sm);
    font-weight: bold;
    color: var(--primary-color);
}
/* --- 24. Gig Submission Previews --- */
.submission-preview {
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-md);
}
.submission-media-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius-sm);
    display: block;
    margin-bottom: var(--spacing-md);
}
/* --- 25. FINAL Responsive Header & Mobile Menu --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}
/* Desktop links container */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}
/* Desktop action buttons container */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}
/* Hamburger menu button - HIDDEN on desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color-primary);
    cursor: pointer;
}
/* This applies to all screens 992px wide or less */
@media (max-width: 992px) {
    /* Hide the desktop menu and show the hamburger button */
    .nav-menu {
        display: none;
    }
    .mobile-menu-toggle {
        display: block;
        z-index: 3001; /* Ensure it's on top */
    }
    /* Styles for the mobile overlay menu when it's active */
    .nav-menu.is-active {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(26, 32, 44, 0.95); /* Dark, semi-transparent overlay */
        z-index: 3000;
    }
    .nav-menu.is-active a {
        color: #fff;
        font-size: 1.5rem;
        margin-bottom: var(--spacing-lg);
    }
    .nav-menu .mobile-close-btn {
        position: absolute;
        top: var(--spacing-lg);
        right: var(--spacing-lg);
        font-size: 2rem;
        color: #fff;
    }
}
/* --- 26. Enhanced Footer --- */
.site-footer {
    padding: var(--spacing-xl) 0 0 0;
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}
.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-color-primary);
}
.footer-column p {
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}
.footer-column ul {
    list-style: none;
}
.footer-column ul a {
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}
.footer-column ul a:hover {
    color: var(--primary-color);
    text-decoration: none;
}
.footer-social-links a {
    color: var(--text-color-secondary);
    font-size: 1.5rem;
    margin-right: var(--spacing-md);
}
.footer-social-links a:hover {
    color: var(--primary-color);
}
.footer-bottom-bar {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-color-secondary);
}
/* --- 27. Dashboard Graphic View --- */
.graphic-view-container {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}
.chart-area {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-md);
}
.chart-bar-item {
    text-align: center;
    width: 20%;
}
.chart-bar {
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    transition: height 0.5s ease-out;
}
.chart-bar-label {
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-color-secondary);
}
/* --- 28. INTELLIGENT FOOTER SYSTEM --- */
/* A. Main Site Footer (for Guests and Desktop) */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0 0 0;
    margin-top: var(--spacing-xl);
    font-size: 0.9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}
.footer-column h4 {
    margin-bottom: var(--spacing-md);
    color: var(--text-color-primary);
}
.footer-column ul {
    list-style: none;
}
.footer-column ul li {
    margin-bottom: var(--spacing-sm);
}
.footer-column ul a {
    color: var(--text-color-secondary);
}
.footer-column ul a:hover {
    color: var(--primary-color);
    text-decoration: none;
}
.footer-social-links {
    display: flex;
    gap: var(--spacing-md);
}
.footer-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--background-color);
    color: var(--text-color-secondary);
    font-size: 1rem;
}
.footer-social-links a:hover {
    background-color: var(--primary-color);
    color: #fff;
}
.footer-bottom-bar {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    text-align: center;
    color: var(--text-color-secondary);
}
/* B. Mobile Footer Navigation (for Logged-In Users) */
.mobile-footer-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}
.mobile-footer-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color-secondary);
    font-size: 0.7rem;
    text-decoration: none;
    flex-grow: 1;
}
.mobile-footer-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}
.mobile-footer-nav .nav-item-add {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transform: translateY(-20px);
    border: 4px solid var(--surface-color);
    box-shadow: var(--box-shadow-md);
}
/* C. Responsive Logic */
@media (max-width: 768px) {
    /* If the mobile-footer-nav exists (meaning user is logged in), show it */
    .mobile-footer-nav {
        display: flex;
    }
    /* And hide the large site footer to save space */
    .site-footer {
        display: none;
    }
    /* Add padding to the bottom of the main content so it doesn't get hidden */
    .main-content {
        padding-bottom: 80px;
    }
}