/* Community Toolkit - Landing Page Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Search */
.search-container {
    position: relative;
    flex: 0 0 300px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 30px;
    flex: 1;
    justify-content: center;
}


.main-header .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    text-decoration: none;
    color: #fff; /* ALWAYS white */
    font-size: 14px;
    font-weight: 500;
    transition: none; /* no fade effect */
}

.main-header .nav-link:hover {
    color: #fff; /* stays white */
}

.main-header .nav-link.active {
    color: #fff;
}

.main-header .nav-link i {
    font-size: 18px;
    color: #fff;
}


/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
}

.notification-icon i {
    font-size: 20px;
    color: white;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

/* Filters Section */
.filters-section {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 16px 0;
}

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

.filter-dropdown {
    position: relative;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f9f9f9;
}

.filter-chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    background: #f9f9f9;
}

.filter-chip.active {
    background: #e6f3ff;
    border-color: #007bff;
    color: #007bff;
}

/* Main Content */
.main-content {
    padding: 24px 0;
}

.main-content h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    color: #333;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* Items Column */
.items-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    transition: all 0.3s ease;
}

/* Grid View Options */
.items-column.grid-1 {
    grid-template-columns: 1fr;
}

.items-column.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.items-column.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.items-column.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.items-column.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Grid View Options in Filter Bar */
.grid-layout-dropdown {
    position: relative;
}

.grid-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 1000;
    min-width: 180px;
    max-width: calc(100vw - 20px);
}

@media (min-width: 768px) {
    .grid-menu {
        left: 0;
        right: auto;
        transform: none;
    }
}

.grid-menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.grid-menu-option:hover {
    background: #f9f9ff;
}

.grid-menu-option.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.grid-menu-option svg {
    flex-shrink: 0;
}

.grid-menu-option:not(.active) .grid-icon-rect {
    fill: #999;
}

.grid-menu-option.active .grid-icon-rect {
    fill: white;
}

.grid-menu-option span {
    font-size: 14px;
    font-weight: 500;
}


/* Item Card */
.item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.item-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.item-avatar span {
    line-height: 1;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.avatar-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.avatar-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-distance {
    font-size: 12px;
    color: #999;
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #999;
    font-size: 18px;
}

.bookmark-btn:hover {
    color: #333;
}

.item-image {
    width: 100%;
    height: 360px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.item-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.item-actions {
    display: flex;
    gap: 16px;
}

.action-btn, .favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    font-size: 18px;
}

.action-btn:hover, .favorite-btn:hover {
    color: #333;
}

.item-details {
    padding: 12px;
}

.item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.item-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.item-price-section {
    margin-bottom: 10px;
}

.price-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.price {
    font-size: 19px;
    font-weight: 700;
    color: #333;
}

.price-subtext {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

.message-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.message-btn:hover {
    background: #0056b3;
}
/* ── Item card action buttons ── */
.item-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.item-action-btn {
    flex: 1;
    display: inline-block;
    text-align: center;
    padding: 7px 6px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.item-action-btn:hover { opacity: 0.85; text-decoration: none !important; }

.item-action-view,
a.item-action-view {
    background: #f0f2ff !important;
    color: #667eea !important;
    border: 1.5px solid #c7d2fe !important;
}

.item-action-edit,
a.item-action-edit {
    background: #667eea !important;
    color: white !important;
    border: none !important;
}

.item-action-delete,
a.item-action-delete {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1.5px solid #fecaca !important;
}

.Edit-btn {
    background: #f97316; /* orange */
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.Edit-btn:hover {
    background: #ea580c; /* darker orange on hover */
}
/* Chat Sidebar */
.chat-sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
}

.new-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    font-size: 18px;
}

.new-chat-btn:hover {
    color: #333;
}

.chat-search {
    position: relative;
    margin-bottom: 24px;
}

.chat-search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
}

.chat-search-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
}

.chat-search i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.chat-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-item {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f9f9f9;
}

.chat-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.chat-footer i {
    color: #1877f2;
    font-size: 16px;
}

/* Coming Soon Banner */
.coming-soon-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 12px 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.banner-content h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.banner-content p {
    font-size: 14px;
    opacity: 0.9;
}


/* Responsive */

/* Prevent horizontal scroll on all screen sizes */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Large screens - tablets landscape */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-sidebar {
        position: relative;
        top: 0;
    }
    
    .items-column {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .main-nav {
        gap: 10px;
    }
    
    .main-header .nav-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Tablets portrait */
@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .site-logo {
        order: 0;
        flex-shrink: 0;
    }
    
    .search-container {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .main-nav {
        order: 2;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
        flex: 0 1 auto;
    }
    
    .user-section {
        order: 1;
        margin-left: auto;
    }
    
    /* Stack text under icons on mobile */
    .main-header .nav-link {
        flex-direction: column;
        padding: 6px 8px;
        min-width: 50px;
        gap: 2px;
    }
    
    .main-header .nav-link span {
        font-size: 10px;
        text-align: center;
        line-height: 1.1;
        display: block;
    }
    
    .main-header .nav-link i {
        font-size: 18px;
        margin: 0;
    }
    
    .items-column {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .main-header {
        padding: 10px 0;
    }

    .header-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .site-logo {
        flex: 0 0 auto;
    }

    .user-section {
        margin-left: auto;
        gap: 8px;
        flex: 0 0 auto;
    }

    .main-nav {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: space-around;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .search-container {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .site-logo img {
        height: 32px;
    }

    .main-header .nav-link {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 6px;
        min-width: 48px;
        gap: 2px;
    }

    .main-header .nav-link span {
        font-size: 9px;
        line-height: 1.1;
        text-align: center;
    }

    .main-header .nav-link i {
        font-size: 16px;
        margin: 0;
    }

    .filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 8px 0;
    }

    .filter-dropdown,
    .filter-chip,
    .filter-select {
        flex: 0 0 auto;
    }

    .items-column {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .item-image {
        height: 220px;
    }

    .user-dropdown {
        right: 0;
        min-width: 200px;
        max-width: calc(100vw - 24px);
    }
}
/* Small mobile phones */
@media (max-width: 480px) {
    .main-header .nav-link {
        padding: 4px 6px;
        gap: 1px;
    }
    
    .main-header .nav-link span {
        font-size: 9px;
    }
    
    .main-header .nav-link i {
        font-size: 16px;
    }
    
    .site-logo img {
        height: 30px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 6px 10px 6px 32px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    
    .item-image {
        height: 300px;
    }
    
    .item-title {
        font-size: 15px;
    }
    
    .price {
        font-size: 18px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
}


/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.auth-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #333;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.btn-outline:hover {
    background: white;
    color: #667eea;
}

.btn-outline:active,
.btn-outline:focus {
    background: #f0f0f0;
    color: #667eea;
    border-color: #f0f0f0;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 30px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: #999;
    font-size: 14px;
}

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-social {
    padding: 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-social:hover {
    background: #f9f9f9;
}

.btn-google {
    color: #db4437;
}

.btn-facebook {
    color: #1877f2;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.text-center {
    text-align: center;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
}

/* User Dropdown Menu */
.user-menu-container {
    position: relative;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 55px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-header strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.user-dropdown-header small {
    color: #999;
    font-size: 12px;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: #f9f9f9;
}

.user-dropdown a i {
    width: 20px;
    text-align: center;
}

.user-dropdown hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #f0f0f0;
}

/* Filter Styles */
.filter-select {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    background: #f9f9f9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state i {
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Item Meta */
.item-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #666;
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-meta i {
    color: #999;
}

.item-category {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
}

.item-condition {
    background: #e6f7e6;
    padding: 4px 10px;
    border-radius: 12px;
    color: #2d7a2d;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin: 0;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-body p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #666;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.6;
}

.close {
    color: white;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    padding: 20px 25px;
}

.close:hover,
.close:focus {
    opacity: 0.8;
}

/* Select dropdown styling */
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-body ul {
    color: #666;
    line-height: 1.8;
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body em {
    color: #999;
    font-size: 14px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.close {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #333;
}

/* Better link styling in forms */
.checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 80vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }
}

/* Small text utility */
.text-sm {
    font-size: 13px;
    color: #999;
}

.text-sm a {
    color: #999;
}

.text-sm a:hover {
    color: #667eea;
}

/* Fix visited link color for better contrast */
.btn-outline:visited {
    color: white;
}

.btn-primary:visited {
    color: white;
}




/* Ensure links in navigation maintain color */
/*a.nav-link:visited {
    color: #666;
}

a.nav-link.active:visited {
    color: #333;
}*/

/* Fix header elements for gradient background */
/*.main-header .search-input {
    background: rgba(255,255,255,0.9);
}

.main-header .search-input::placeholder {
    color: #999;
}

.main-header .search-icon {
    color: #666;
}

.main-header .nav-link {
    color: white;
}

.main-header .nav-link:hover {
    color: rgba(255,255,255,0.8);

}

.main-header .nav-link.active {

    color: white;
}*/

/* Force visibility of auth buttons on index.html */
.main-header .btn-outline,
.main-header .btn-primary {
    background: transparent !important;
    color: white !important;
    border: 2px solid white !important;
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.2s !important;
    display: inline-block !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.main-header .btn-outline:visited,
.main-header .btn-primary:visited {
    color: white !important;
}

.main-header .btn-outline:hover,
.main-header .btn-primary:hover {
    background: white !important;
    color: #667eea !important;
}

/* Ensure user-section is visible */
/*.main-header .user-section {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}*/

/* ============================================================================
   PROFILE PAGE STYLES - TWO COLUMN LAYOUT (NO WHITE BACKGROUND)
   ============================================================================ */

.profile-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: none;
}

/* Success/Error Messages - Position above columns */
.success-message,
.error-message {
    width: 100%;
    margin-bottom: 20px;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 8px;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
}

/* Left Column - Profile Info */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    flex: 0 0 350px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 48px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.profile-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.profile-info-line {
    color: #666;
    font-size: 15px;
    margin: 5px 0;
}

.profile-rating {
    color: #ffa500;
    font-size: 18px;
    margin: 15px 0;
}

.profile-rating i {
    color: #ffa500;
    margin: 0 2px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Right Column - Bio Section */
.bio-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1;
}

.bio-section h2 {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    color: #333;
}

.bio-display {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.bio-empty {
    color: #999;
    font-style: italic;
}

.bio-edit-form {
    display: none;
}

.bio-edit-form.active {
    display: block;
}

textarea.bio-textarea {
    width: 100%;
    height: 300px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: none;
    box-sizing: border-box;
}

/* Mobile - Stack Vertically */
@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
    }
    
    .profile-card {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .bio-section {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ============================================================================
   BUTTON FIXES - VISIBILITY AND CONSISTENCY
   ============================================================================ */

/* Base button */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

/* Primary button */
.btn-primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
    border-color: #5568d3;
    color: white;
}

/* Outline button - works on white backgrounds */
.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Secondary button */
.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Button sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Ensure all buttons are always visible */
.btn,
.btn-primary,
.btn-outline,
.btn-secondary {
    opacity: 1 !important;
    visibility: visible !important;
}

/* -- Carousel overlays -- */
.ci-prev, .ci-next {
    position: absolute;
    top: 0; bottom: 0; width: 30%;
    border: none; cursor: pointer;
    z-index: 10; opacity: 0;
    transition: opacity 0.18s;
    display: flex; align-items: center; padding: 0;
}
.ci-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.42) 0%, transparent 100%);
    justify-content: flex-start; padding-left: 10px;
}
.ci-next {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.42) 0%, transparent 100%);
    justify-content: flex-end; padding-right: 10px;
}
.item-image:hover .ci-prev,
.item-image:hover .ci-next { opacity: 1; }
.ci-prev svg, .ci-next svg {
    width: 26px; height: 26px; flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
@media (hover: none), (max-width: 768px) {
    .ci-prev, .ci-next { display: none; }
    .ci-mob-prev, .ci-mob-next { display: flex !important; }
}
.ci-mob-prev, .ci-mob-next {
    display: none;
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.45); border: none; cursor: pointer;
    z-index: 10; align-items: center; justify-content: center; padding: 0;
}
.ci-mob-prev { left: 8px; }
.ci-mob-next { right: 8px; }
.ci-mob-prev svg, .ci-mob-next svg {
    width: 14px; height: 14px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.ci-dots {
    position: absolute; bottom: 7px;
    left: 50%; transform: translateX(-50%);
    display: flex; gap: 5px; z-index: 10; pointer-events: none;
}
.ci-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.45);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.ci-dot-on { background: white; transform: scale(1.3); }

/* ── Distance filter (shared: home + index) ────────────────────────────────── */
.distance-filter {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.distance-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}
.distance-header i { color: #7C3AED; }
.distance-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}
.distance-slider input[type=range] {
    width: 130px;
    accent-color: #7C3AED;
    cursor: pointer;
}
.distance-value {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
}

/* ── Apply Filter(s) button (shared: home + index) ─────────────────────────── */
.apply-filters-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.apply-filters-btn:hover { background: #5a6fd6; }

.live-search {
    position: relative;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    flex: 0 0 320px;
}

.live-search-wrap {
    position: relative;
    width: 100%;
}

.live-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 38px 10px 12px;
    border: 2px solid #222;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.live-search-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #777;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: none;
    padding: 0;
}

.live-search-clear:hover {
    color: #222;
}

.live-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.live-search-item,
.live-search-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f1f1f1;
    background: #fff;
    cursor: pointer;
}

.live-search-item:last-child,
.live-search-history-item:last-child {
    border-bottom: none;
}

.live-search-item:hover,
.live-search-history-item:hover {
    background: #f8f8f8;
}

.live-search-item img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.live-search-info {
    flex: 1;
    min-width: 0;
}

.live-search-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-search-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
}
.live-search-meta,
.live-search-history-text {
    font-size: 13px;
    color: #777;
}

.live-search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 6px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.live-search-clear-history {
    border: none;
    background: transparent;
    color: #6c63ff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.live-search-no-results {
    padding: 12px;
    font-size: 14px;
    color: #777;
    background: #fff;
}
@media (max-width: 768px) {
    .live-search {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .live-search-input {
        font-size: 16px;
        padding: 12px 40px 12px 12px;
    }

    .live-search-results {
        max-height: 260px;
        border-radius: 10px;
    }

    .live-search-item,
    .live-search-history-item {
        padding: 12px 10px;
        gap: 10px;
    }

    .live-search-item img {
        width: 44px;
        height: 44px;
    }

    .live-search-title {
        font-size: 13px;
    }

    .live-search-meta,
    .live-search-history-text,
    .live-search-no-results {
        font-size: 12px;
    }

    .live-search-history-header {
        padding: 10px 10px 6px;
        font-size: 11px;
    }

    .live-search-clear {
        right: 12px;
        width: 24px;
        height: 24px;
    }
}

#addAvailableRangeBtn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
#clearAllDatesBtn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.pickup-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.pickup-modal-overlay.active {
    display: block;
}

.pickup-modal-box {
    background: #fff;
    width: 100%;
    max-width: 520px;
    margin: 40px auto;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
    padding: 22px;
    animation: pickupModalFade .2s ease;
}

.pickup-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.pickup-loading {
    text-align: center;
    padding: 30px 10px;
    color: #666;
    font-size: 15px;
}

.pickup-card h3 {
    margin-bottom: 8px;
    font-size: 22px;
    color: #222;
}

.pickup-card p {
    margin-bottom: 14px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.pickup-camera-input {
    display: block;
    width: 100%;
    margin-bottom: 14px;
}

.pickup-preview-wrap {
    display: none;
    margin-bottom: 14px;
}

.pickup-preview-wrap.active {
    display: block;
}

.pickup-preview-wrap img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.pickup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pickup-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pickup-btn-primary {
    background: linear-gradient(135deg, #34c759, #28a745);
    color: white;
}

.pickup-btn-secondary {
    background: #f1f1f1;
    color: #333;
}

.pickup-status-msg {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
}

.pickup-status-msg.error {
    color: #c62828;
}

.pickup-status-msg.success {
    color: #1b8f3a;
}

@keyframes pickupModalFade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.camera-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 140px;

    border: 2px dashed #ddd;
    border-radius: 16px;

    background: #fafafa;
    cursor: pointer;

    transition: all 0.25s ease;
    margin-bottom: 14px;
}

.camera-btn:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.camera-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;

    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    margin-bottom: 8px;

    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.camera-text {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.pickup-preview-wrap {
    display: none;
    margin-top: 10px;
}

.pickup-preview-wrap.active {
    display: block;
}

.pickup-preview-wrap img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #ddd;
}
#returnModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#returnModal.active {
    display: flex;
}

.approve-extension-btn,
.decline-extension-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.approve-extension-btn {
    background: #10b981;
    color: white;
}

.decline-extension-btn {
    background: #ef4444;
    color: white;
}
.rentals-wrap {
            max-width: 980px;
            margin: 40px auto 80px;
            padding: 0 24px;
        }

        .rentals-wrap h1 {
            font-size: 32px;
            font-weight: 800;
            color: #1a1a2e;
            margin-bottom: 6px;
        }

        .rentals-wrap .page-sub {
            color: #6b7280;
            font-size: 14px;
            margin-bottom: 28px;
        }

        .role-switcher {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .role-btn {
            padding: 10px 28px;
            border-radius: 999px;
            border: 2px solid #e5e7eb;
            background: white;
            font-size: 14px;
            font-weight: 700;
            color: #6b7280;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .role-btn:hover {
            border-color: #667eea;
            color: #667eea;
        }

        .role-btn.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-color: transparent;
            color: white;
        }

        .tab-card {
            background: #fff;
            border-radius: 16px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.06);
        }

        .tab-row {
            display: flex;
            border-bottom: 1px solid #e5e7eb;
            overflow-x: auto;
        }

        .tab-btn {
            flex: 1;
            padding: 16px 12px;
            border: none;
            background: none;
            font-size: 14px;
            font-weight: 600;
            color: #6b7280;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: color 0.2s, border-color 0.2s;
            text-align: center;
            white-space: nowrap;
        }

        .tab-btn:hover  { color: #667eea; }
        .tab-btn.active { color: #667eea; border-bottom-color: #667eea; }

        .tab-panel        { display: none; padding: 24px; }
        .tab-panel.active { display: block; }

        .role-panel        { display: none; }
        .role-panel.active { display: block; }

        .rental-card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 20px 24px;
            display: flex;
            gap: 20px;
            align-items: flex-start;
            margin-bottom: 16px;
        }

        .rental-card:last-child { margin-bottom: 0; }

        .rental-image {
            width: 120px;
            height: 90px;
            border-radius: 10px;
            overflow: hidden;
            flex-shrink: 0;
            background: #f3f4f6;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            font-size: 28px;
        }

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

        .rental-body  { flex: 1; min-width: 0; }

        .rental-title-row {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .rental-title {
            font-size: 18px;
            font-weight: 700;
            color: #1a1a2e;
            text-decoration: none;
        }

        .rental-title:hover { color: #667eea; }

        .rental-person {
            font-size: 13px;
            color: #6b7280;
            font-weight: 400;
        }

        .rental-info-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 16px;
        }

        .rental-info-label {
            font-size: 11px;
            color: #9ca3af;
            margin-bottom: 3px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .rental-info-value {
            font-size: 14px;
            font-weight: 700;
            color: #1a1a2e;
        }

        .rental-info-value.price-total { color: #667eea; font-size: 15px; }

        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 12px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            margin-left: 8px;
        }

        .badge-active    { background: #d1fae5; color: #065f46; }
        .badge-confirmed { background: #dbeafe; color: #1e40af; }
        .badge-pending   { background: #fef3c7; color: #92400e; }
        .badge-review    { background: #ede9fe; color: #5b21b6; }

        .days-pill {
            display: inline-block;
            font-size: 11px;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 999px;
        }

        .days-pill.urgent { background: #fee2e2; color: #991b1b; }
        .days-pill.warn   { background: #fef3c7; color: #92400e; }
        .days-pill.soon   { background: #dbeafe; color: #1e40af; }

        .rental-actions { display: flex; gap: 10px; flex-wrap: wrap; }

        .btn-primary-action {
            background: #667eea;
            color: white;
            border: none;
            padding: 9px 18px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: opacity 0.2s;
        }

        .btn-primary-action:hover { opacity: 0.85; }

        .btn-green-action {
            background: #10b981;
            color: white;
            border: none;
            padding: 9px 18px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: opacity 0.2s;
            text-decoration: none;
        }

        .btn-green-action:hover { opacity: 0.85; }

        .btn-red-action {
            background: #ef4444;
            color: white;
            border: none;
            padding: 9px 18px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: opacity 0.2s;
        }

        .btn-red-action:hover { opacity: 0.85; }

        .btn-outline-action {
            background: white;
            color: #374151;
            border: 1.5px solid #d1d5db;
            padding: 9px 18px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: border-color 0.2s, color 0.2s;
        }

        .btn-outline-action:hover { border-color: #667eea; color: #667eea; }

        .btn-cancel-action {
            background: white;
            color: #dc2626;
            border: 1.5px solid #fecaca;
            padding: 9px 18px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: background 0.2s;
        }

        .btn-cancel-action:hover { background: #fef2f2; }

        .empty-rental-state {
            text-align: center;
            padding: 56px 20px;
            color: #9ca3af;
        }

        .empty-rental-state i    { font-size: 48px; margin-bottom: 14px; display: block; color: #e5e7eb; }
        .empty-rental-state h3   { font-size: 17px; color: #374151; margin-bottom: 8px; font-weight: 700; }
        .empty-rental-state p    { font-size: 13px; }
        .empty-rental-state a    { color: #667eea; font-weight: 600; text-decoration: none; }

        .tab-count {
            background: #667eea;
            color: white;
            font-size: 10px;
            font-weight: 700;
            padding: 1px 7px;
            border-radius: 999px;
            margin-left: 5px;
            vertical-align: middle;
        }

        .review-note {
            font-size: 12px;
            color: #6b7280;
            margin-bottom: 12px;
        }

        @media (max-width: 768px) {
            .rental-card     { flex-direction: column; }
            .rental-image    { width: 100%; height: 160px; }
            .rental-info-row { grid-template-columns: 1fr 1fr; }
        }

        @media (max-width: 480px) {
            .rental-info-row { grid-template-columns: 1fr; }
            .role-btn        { padding: 9px 18px; font-size: 13px; }
        }
/* ── Force chatbot widget above all page stacking contexts ── */
#toolbot-widget, #toolbot-btn, .toolbot-container,
[id*="chatbot"], [id*="toolbot"], [class*="chatbot"], [class*="toolbot"] {
    z-index: 999999 !important;
}

.messages-page {
    max-width: 1300px;
    margin: 30px auto;
}

.messages-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    min-height: 650px;
}

.panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.panel-header {
    padding: 18px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}

.conversation-list {
    max-height: 550px;
    overflow-y: auto;
}

.conversation {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
    color: inherit;
}

.conversation:hover {
    background: #f8f9ff;
}

.conversation.active {
    background: #f0f2ff;
    border-left: 3px solid #667eea;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-delete {
    opacity: 0;
    transition: opacity 0.15s;
    color: #dc2626;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    align-self: center;
    background: none;
    border: none;
    cursor: pointer;
}
.conversation:hover .conv-delete { opacity: 1; }
.conv-delete:hover { background: #fef2f2; }

.conv-name {
    font-weight: 700;
}

.conv-item {
    font-size: 13px;
    color: #667eea;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-last {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread {
    background: #ff4d4f;
    color: white;
    font-size: 11px;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.no-conversations {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
}

.chat-thread {
    padding: 20px;
    height: 420px;
    overflow-y: auto;
    background: #fafafa;
}

.message-row {
    margin-bottom: 16px;
    display: flex;
}

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

.bubble {
    max-width: 65%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.message-row.them .bubble {
    background: white;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.message-row.me .bubble {
    background: #667eea;
    color: white;
    border-top-right-radius: 4px;
}

.message-row.system .bubble {
    background: #f0f2ff;
    color: #667eea;
    font-style: italic;
    font-size: 13px;
    border-radius: 8px;
    margin: 0 auto;
}

.msg-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: .7;
}

.chat-input {
    border-top: 1px solid #eee;
    padding: 16px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-form input {
    flex: 1;
    padding: 12px;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
}

.chat-form input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

.send-btn:hover {
    background: #586de0;
}

.no-conversation-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 15px;
    flex-direction: column;
    gap: 12px;
}

.no-conversation-selected i {
    font-size: 40px;
    color: #d1d5db;
}

@media (max-width: 900px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .chat-thread {
        height: 300px;
    }
}


        /* ── Camera button ── */
        .camera-take-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            margin-top: 12px;
            padding: 9px 18px;
            background: #f0f2ff;
            color: #667eea;
            border: 1.5px solid #c7d2fe;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: background 0.2s;
        }
        .camera-take-btn:hover { background: #e0e7ff; }
        #cameraModal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.92);
            z-index: 9999;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        #cameraModal.open { display: flex; align-items: center; justify-content: center; }
        #cameraInner {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
            padding: 24px 16px;
            width: 100%;
            box-sizing: border-box;
            min-height: 100%;
            justify-content: center;
        }
        #cameraVideo {
            width: min(480px, 92vw);
            max-height: 55vh;
            border-radius: 12px;
            background: #000;
            object-fit: contain;
            flex-shrink: 0;
        }
        .camera-modal-btns {
            display: flex;
            gap: 12px;
            flex-shrink: 0;
            flex-wrap: wrap;
            justify-content: center;
        }
        #captureBtn {
            padding: 14px 32px; background: #667eea; color: white;
            border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
            cursor: pointer; font-family: inherit;
        }
        #captureBtn:hover { background: #5a6fd6; }
        #closeCameraBtn {
            padding: 14px 24px; background: rgba(255,255,255,0.15); color: white;
            border: 1.5px solid rgba(255,255,255,0.3); border-radius: 8px;
            font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
        }
        #closeCameraBtn:hover { background: rgba(255,255,255,0.25); }
        #cameraErrMsg { color: #ef4444; font-size: 12px; margin-top: 6px; display: none; }
        
       .availability-section {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-top: 20px;
    margin-bottom: 20px; 
}

.availability-section h3 {
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #444;
}

.date-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.date-group label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.date-group input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}
     /* ── Page layout ── */
        .listing-page-wrap {
            max-width: 860px;
            margin: 40px auto 80px;
            padding: 0 24px;
        }

        .listing-page-wrap > h1 {
            font-size: 28px;
            font-weight: 700;
            color: #1a1a2e;
            margin-bottom: 24px;
            text-align: center;
        }

        /* ── Section card ── */
        .listing-section {
            background: #fff;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            padding: 32px 36px;
            margin-bottom: 24px;
        }

        .listing-section-title {
            font-size: 17px;
            font-weight: 700;
            color: #1a1a2e;
            padding-bottom: 12px;
            border-bottom: 2px solid #667eea;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .listing-section-title i { color: #667eea; }

        /* ── Form elements ── */
        .listing-section .form-group { margin-bottom: 20px; }

        .listing-section .form-group label {
            display: block;
            font-weight: 600;
            font-size: 14px;
            color: #374151;
            margin-bottom: 7px;
        }

        .listing-section .form-group input[type="text"],
        .listing-section .form-group input[type="number"],
        .listing-section .form-group select,
        .listing-section .form-group textarea {
            width: 100%;
            padding: 11px 14px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            color: #374151;
            background: #fff;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        .listing-section .form-group input:focus,
        .listing-section .form-group select:focus,
        .listing-section .form-group textarea:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
        }

        .listing-section .form-group textarea {
            resize: vertical;
            min-height: 120px;
            line-height: 1.6;
        }

        .listing-section .form-group small {
            display: block;
            margin-top: 5px;
            font-size: 12px;
            color: #9ca3af;
        }

        .form-row-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }

        /* ── Price fields ── */
        .price-fields-wrap {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-top: 4px;
        }

        .price-field { display: none; }
        .price-field.visible { display: block; }

        .price-input-wrap {
            display: flex;
            align-items: center;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .price-input-wrap:focus-within {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
        }

        .price-prefix {
            padding: 11px 13px;
            background: #f9fafb;
            border-right: 1px solid #d1d5db;
            font-weight: 600;
            color: #6b7280;
            font-size: 14px;
            user-select: none;
        }

        .price-input-wrap input {
            border: none !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            flex: 1;
        }

        /* ── Existing photos ── */
        .existing-photos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
            margin-bottom: 20px;
        }

        .existing-photo-thumb {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            aspect-ratio: 1;
            background: #f0f0f0;
            border: 2px solid transparent;
            cursor: grab;
            transition: border-color 0.2s, opacity 0.2s, box-shadow 0.15s, transform 0.15s;
        }
        .existing-photo-thumb.drag-source { opacity:0.45; transform:scale(0.96); box-shadow:0 0 0 3px #667eea; }
        .existing-photo-thumb.drag-over { box-shadow:0 0 0 3px #667eea, 0 4px 16px rgba(102,126,234,0.35); transform:scale(1.04); }

        .existing-photo-thumb.marked-delete {
            border-color: #ef4444;
            opacity: 0.5;
        }

        .existing-photo-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .existing-photo-thumb .delete-overlay {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(0,0,0,0.6);
            color: white;
            border: none;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .existing-photo-thumb .delete-overlay:hover { background: #ef4444; }

        .existing-photo-thumb .delete-label {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(239,68,68,0.85);
            color: white;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
            padding: 3px 0;
            display: none;
        }

        .existing-photo-thumb.marked-delete .delete-label { display: block; }

        /* ── Upload zone ── */
        .upload-zone {
            border: 2px dashed #d1d5db;
            border-radius: 10px;
            padding: 36px 24px;
            text-align: center;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
            background: #fafafa;
            position: relative;
        }

        .upload-zone:hover,
        .upload-zone.dragover {
            border-color: #667eea;
            background: #f0f2ff;
        }

        .upload-zone input[type="file"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
            width: 100%;
            height: 100%;
        }

        .upload-zone i {
            font-size: 36px;
            color: #667eea;
            margin-bottom: 10px;
            display: block;
        }

        .upload-zone p {
            font-size: 14px;
            color: #6b7280;
            margin: 0;
            line-height: 1.6;
        }

        .upload-zone strong { color: #667eea; }

        /* ── New photo preview grid ── */
        .photo-preview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
            margin-top: 16px;
        }

        .photo-thumb {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            aspect-ratio: 1;
            background: #f0f0f0;
            cursor: grab;
            transition: box-shadow 0.15s, opacity 0.15s, transform 0.15s;
        }

        /* Drag states */
        .photo-thumb.drag-source {
            opacity: 0.45;
            transform: scale(0.96);
            box-shadow: 0 0 0 3px #667eea;
        }

        .photo-thumb.drag-over {
            box-shadow: 0 0 0 3px #667eea, 0 4px 16px rgba(102,126,234,0.35);
            transform: scale(1.04);
        }

        /* Drag handle icon */
        .drag-hint {
            position: absolute;
            top: 6px;
            left: 6px;
            color: rgba(255,255,255,0.9);
            font-size: 13px;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.15s;
        }

        .photo-thumb:hover .drag-hint { opacity: 1; }

        /* Cover badge */
        .photo-primary-badge {
            position: absolute;
            bottom: 6px;
            left: 6px;
            background: rgba(102,126,234,0.9);
            color: white;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 4px;
            letter-spacing: 0.04em;
            pointer-events: none;
            z-index: 2;
        }

        /* Fix listing action buttons to use global .btn styles */
        .listing-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            padding: 20px 36px;
        }

        .btn-create-listing {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 36px;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .btn-create-listing:hover { opacity: 0.9; }

        @media (max-width: 640px) {
            .listing-actions { flex-direction: column-reverse; gap: 12px; padding: 20px; }
            .listing-actions .btn { width: 100%; text-align: center; }
        }

        @media (max-width: 600px) {
            .range-row { grid-template-columns: 1fr !important; }
            .range-row #addAvailableRangeBtn { width: 100%; }
        }

        .photo-thumb img,
        .photo-thumb video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .photo-thumb .remove-btn {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(0,0,0,0.6);
            color: white;
            border: none;
            border-radius: 50%;
            width: 22px;
            height: 22px;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        /* ── Subcategory / location hidden until populated ── */
        #subcategoryGroup      { display: none; }

        /* Tag-button category picker */
        .cat-tag-picker { display:flex; flex-direction:column; gap:6px; border:1.5px solid #e5e7eb; border-radius:10px; padding:14px 16px; max-height:300px; overflow-y:auto; background:#fff; }
        .cat-tag-row { display:flex; flex-direction:column; gap:4px; }
        .cat-tag { display:inline-block; padding:5px 14px; border-radius:999px; border:1.5px solid #d1d5db; background:#f9fafb; color:#374151; font-size:13px; font-weight:500; cursor:pointer; transition:all 0.15s; text-align:left; align-self:flex-start; }
        .cat-tag:hover { border-color:#667eea; color:#667eea; background:#f0f0ff; }
        .cat-tag.selected { background:#667eea; border-color:#667eea; color:white; font-weight:600; }
        .cat-sub-tags { display:none; flex-wrap:wrap; gap:6px; padding:4px 0 4px 16px; border-left:2px solid #e5e7eb; margin-left:10px; }
        .cat-sub-tag { display:inline-block; padding:3px 11px; border-radius:999px; border:1.5px solid #e5e7eb; background:#fff; color:#6b7280; font-size:12px; cursor:pointer; transition:all 0.15s; }
        .cat-sub-tag:hover { border-color:#667eea; color:#667eea; }
        .cat-sub-tag.selected { background:#ede9fe; border-color:#667eea; color:#5b21b6; font-weight:600; }
        #cityContainer         { display: none; }
        #neighborhoodContainer { display: none; }

        /* ── Error box ── */
        .listing-errors {
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: 10px;
            padding: 16px 20px;
            margin-bottom: 24px;
        }

        .listing-errors p {
            font-weight: 700;
            color: #b91c1c;
            margin: 0 0 8px;
            font-size: 14px;
        }

        .listing-errors ul { margin: 0; padding-left: 18px; }

        .listing-errors li {
            color: #b91c1c;
            font-size: 14px;
            margin-bottom: 3px;
        }

        /* ── Actions bar ── */
        .listing-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            padding: 20px 36px;
        }

       
        .cancel-link:hover { color: #374151; }

        .btn-save-listing {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 36px;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .btn-save-listing:hover { opacity: 0.9; }

        @media (max-width: 640px) {
            .listing-section    { padding: 20px; }
            .form-row-2         { grid-template-columns: 1fr; }
            .price-fields-wrap  { grid-template-columns: 1fr; }
            .listing-actions    { flex-direction: column-reverse; gap: 12px; padding: 20px; }
            .btn-save-listing   { width: 100%; }
        }
        
        .availability-section {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-top: 20px;
    margin-bottom: 20px; 
}

.availability-section h3 {
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #444;
}

.date-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.date-group label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.date-group input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

     .item-detail-container {
            max-width: 1200px;
            margin: 40px auto;
            padding: 20px;
        }
        
        .detail-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 30px;
            margin-top: 20px;
        }
        
        .photo-gallery {
            background: white;
            border-radius: 12px;
            padding: 0;
            box-shadow: 0 2px 12px rgba(0,0,0,0.1);
            border: 1px solid #e5e7eb;
            overflow: hidden;
        }

        .photo-main-area {
            padding: 16px 16px 14px;
        }

        .photo-thumb-area {
            background: #f9fafb;
            border-top: 1px solid #e5e7eb;
            padding: 12px 16px;
            display: flex;
            gap: 10px;
            overflow-x: auto;
        }
        
        .zoom-wrapper {
            position: relative;
            display: inline-block;
            max-width: 100%;
            margin-bottom: 0;
        }

        .zoom-lens {
            display: none;
            position: absolute;
            border: 2px solid #667eea;
            border-radius: 4px;
            width: 100px;
            height: 100px;
            cursor: crosshair;
            pointer-events: none;
            background: rgba(102,126,234,0.08);
            z-index: 3;
        }

        .zoom-result {
            display: none;
            position: absolute;
            top: 0;
            left: calc(100% + 12px);
            width: 380px;
            height: 380px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
            background-repeat: no-repeat;
            background-color: #f9fafb;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            z-index: 10;
        }

        @media (max-width: 900px) {
            .zoom-result, .zoom-lens { display: none !important; }
            .main-photo { cursor: zoom-in; }
        }

        .main-photo {
            display: block;
            max-width: 100%;
            max-height: 500px;
            width: auto;
            height: auto;
            border-radius: 8px;
            cursor: crosshair;
        }


        
        .thumbnail-strip {
            display: flex;
            gap: 10px;
            overflow-x: auto;
        }
        
        .thumbnail {
            width: 80px;
            height: 80px;
            object-fit: cover;
            border-radius: 6px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: border-color 0.2s;
        }
        
        .thumbnail:hover, .thumbnail.active {
            border-color: #667eea;
        }
        
        .no-photos {
            width: 100%;
            height: 400px;
            background: #f0f0f0;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 18px;
        }
        .item-map {
    margin-top: 20px;
    width: 100%;
}

        .item-info {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .item-title {
            font-size: 28px;
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
        }
        
        .item-meta {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        
        .meta-badge {
            background: #f0f0f0;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 14px;
            color: #666;
        }
        
        .price-section {
            background: #f8f9ff;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
        }
        
        .price-option {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 10px 0;
        }
        
        .price-amount {
            font-size: 24px;
            font-weight: bold;
            color: #667eea;
        }
        
        .description-section {
            margin: 20px 0;
        }
        
        .description-section h3 {
            color: #333;
            margin-bottom: 10px;
        }
        
        .owner-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }
        
        .owner-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
        }
        
        .owner-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
        }
        
        .owner-info h3 {
            margin: 0;
            color: #333;
        }
        
        .owner-rating {
            color: #f39c12;
            font-size: 14px;
        }
        
        .rental-form {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .rental-form h3 {
            color: #333;
            margin-bottom: 20px;
        }

        .validation-tooltip {
            display: none;
            position: absolute;
            background: #fef3c7;
            border: 1px solid #f59e0b;
            border-radius: 4px;
            padding: 6px 10px;
            font-size: 13px;
            color: #333;
            z-index: 9999;
            white-space: nowrap;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
            pointer-events: none;
        }

        .validation-tooltip::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 14px;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-bottom: 6px solid #f59e0b;
        }

        .validation-tooltip::after {
            content: '';
            position: absolute;
            top: -5px;
            left: 15px;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-bottom: 5px solid #fef3c7;
        }

        .validation-tooltip .tooltip-icon {
            display: inline-block;
            background: #f59e0b;
            color: white;
            border-radius: 50%;
            width: 16px;
            height: 16px;
            font-size: 11px;
            font-weight: bold;
            text-align: center;
            line-height: 16px;
            margin-right: 5px;
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #666;
            font-weight: 500;
        }
        
        .form-group input,
        .form-group select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
        }
        
        .rate-type-selector {
            display: flex;
            gap: 15px;
            margin: 15px 0;
        }
        
        .rate-option {
            flex: 1;
            padding: 15px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
        }
        
        .rate-option:has(input:checked) {
            border-color: #667eea;
            background: #f8f9ff;
        }
        
        .rate-option:hover {
            border-color: #667eea;
        }
        
        .rate-option input[type="radio"] {
            display: none;
        }
        
        .rate-label {
            display: block;
            font-size: 14px;
            color: #666;
            margin-bottom: 5px;
        }
        
        .rate-option:has(input:checked) .rate-label {
            color: #667eea;
            font-weight: bold;
        }
        
        .rate-price {
            font-size: 20px;
            font-weight: bold;
            color: #333;
        }
        
        .rate-option:has(input:checked) .rate-price {
            color: #667eea;
        }
        
        .total-cost {
            background: #f8f9ff;
            padding: 15px;
            border-radius: 8px;
            margin: 15px 0;
            text-align: center;
        }
        
        .total-label {
            font-size: 14px;
            color: #666;
            margin-bottom: 5px;
        }
        
        .total-amount {
            font-size: 28px;
            font-weight: bold;
            color: #667eea;
        }
        
        .suggestion-text {
            font-size: 12px;
            color: #f39c12;
            margin-top: 5px;
        }
        
        .btn-request {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s;
        }
        
        .btn-request:hover {
            transform: translateY(-2px);
        }
        
        .btn-request:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        
        .owner-badge {
            background: #f39c12;
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 14px;
            text-align: center;
            margin-top: 10px;
        }
        
        @media (max-width: 768px) {
            .detail-grid {
                grid-template-columns: 1fr;
            }
        }
        
        

       .map-layout {
           display: flex;
           height: calc(100vh - 70px);
           position: relative;
           min-height: 400px;
       }

       .map-sidebar {
           width: 340px;
           background: white;
           border-right: 1px solid #ddd;
           overflow-y: auto;
           padding: 20px;
           z-index: 2;
       }
       
.map-sidebar-header {
    position: relative;
    top: auto;
    z-index: 5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 10px;
    margin-bottom: 0;
    border-bottom: 1px solid #f1f1f1;
    flex: 0 0 auto;
}

#listingSidebar {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 12px;
    min-height: 0;
}
       .map-sidebar h2 {
           margin: 0;
           font-size: 22px;
           color: #222;
       }

       .map-sidebar-close {
           display: none;
       }

       .listing-preview {
           border: 1px solid #e3e3e3;
           border-radius: 12px;
           overflow: hidden;
           margin-bottom: 16px;
           background: #fff;
           box-shadow: 0 2px 6px rgba(0,0,0,0.06);
           cursor: pointer;
           transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
       }

       .listing-preview:hover {
           transform: translateY(-2px);
           box-shadow: 0 4px 12px rgba(0,0,0,0.12);
       }

       .listing-preview.active {
           border-color: #7c4dff;
           box-shadow: 0 0 0 2px rgba(124,77,255,0.15);
       }

      .listing-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

       .listing-preview-content {
           padding: 12px;
       }

       .listing-preview-content h3 {
           margin: 0 0 8px;
           font-size: 17px;
       }

       .listing-preview-content p {
           margin: 4px 0;
           font-size: 14px;
           color: #444;
       }

       .listing-price {
           color: #667eea;
           font-weight: bold;
           margin-top: 8px;
       }

       #map {
           flex: 1;
           min-width: 0;
           width: 100%;
           height: 100%;
       }

       .map-popup {
           width: 220px;
           font-family: Arial, sans-serif;
       }

       .popup-image-wrap {
           width: 100%;
           height: 120px;
           margin-bottom: 10px;
           border-radius: 8px;
           overflow: hidden;
           background: #f3f4f6;
           display: block;
       }

       .popup-image {
           width: 100%;
           height: 100%;
           object-fit: cover;
           display: block;
       }

       .popup-content h3 {
           margin: 0 0 8px 0;
           font-size: 16px;
       }

       .popup-content p {
           margin: 4px 0;
           font-size: 13px;
           color: #333;
       }

       .popup-btn {
           display: inline-block;
           margin-top: 10px;
           padding: 8px 12px;
           background: #667eea;
           color: white;
           text-decoration: none;
           border-radius: 6px;
           font-size: 13px;
       }

       .price-marker {
           background: white;
           color: #222;
           border: 2px solid #7c4dff;
           border-radius: 999px;
           padding: 6px 10px;
           font-size: 13px;
           font-weight: 700;
           line-height: 1;
           box-shadow: 0 2px 8px rgba(0,0,0,0.2);
           cursor: pointer;
           white-space: nowrap;
           transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
       }

       .price-marker:hover {
           transform: translateY(-2px);
           box-shadow: 0 4px 12px rgba(0,0,0,0.28);
       }

       .price-marker.active {
           background: #7c4dff;
           color: white;
           transform: scale(1.06);
           box-shadow: 0 4px 14px rgba(0,0,0,0.3);
       }

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

       .filter-dropdown {
           position: relative;
       }

       .filter-select {
           min-height: 42px;
       }

       #subcategoryContainerHome {
           min-width: 180px;
       }

       .filters-section .btn.btn-outline.btn-sm {
           display: inline-flex;
           align-items: center;
           justify-content: center;
           padding: 10px 14px;
           min-height: 42px;
           border: 1px solid #667eea;
           border-radius: 8px;
           background: #fff;
           color: #667eea !important;
           text-decoration: none;
           font-weight: 600;
           white-space: nowrap;
       }

       .filters-section .btn.btn-outline.btn-sm:hover {
           background: #667eea;
           color: #fff !important;
       }

       .price-filter-dropdown {
            position: relative;
        }

        .price-filter-dropdown .filter-select {
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .price-filter-menu {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            padding: 16px;
            min-width: 280px;
            z-index: 1000;
        }

        .price-filter-section {
            margin-bottom: 12px;
        }

        .filter-checkbox {
            display: flex;
            align-items: center;
            padding: 8px 0;
            cursor: pointer;
            user-select: none;
        }

        .filter-checkbox input[type="checkbox"] {
            margin-right: 10px;
            cursor: pointer;
            width: 18px;
            height: 18px;
        }

        .filter-checkbox span {
            font-size: 14px;
            color: #333;
        }

        .filter-checkbox:hover {
            background-color: #f5f5f5;
            margin: 0 -8px;
            padding-left: 8px;
            padding-right: 8px;
            border-radius: 4px;
        }

        .price-filter-divider {
            height: 1px;
            background: #e0e0e0;
            margin: 12px 0;
        }

        .custom-price-inputs {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .price-input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
        }

        .price-input:focus {
            outline: none;
            border-color: #667eea;
        }

        .price-filter-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e0e0e0;
        }

        .price-filter-actions .btn {
            flex: 1;
        }

        .mobile-listings-toggle,
        .mobile-sheet-backdrop,
        .mobile-detail-sheet {
            display: none;
        }

        .radius-status {
            font-size: 13px;
            color: #667eea;
            font-weight: 600;
            margin-top: 2px;
        }

        @media (max-width: 768px) {
            /* Keep shared mobile header/search/filter behavior from the main responsive rules above.
               Only map-page-specific mobile layout changes should live in this block. */

            #subcategoryContainerHome {
                min-width: 160px;
            }

            .price-filter-menu {
                left: 0;
                right: auto;
                width: min(320px, calc(100vw - 24px));
                max-width: calc(100vw - 24px);
                max-height: 70vh;
                overflow-y: auto;
            }

            .map-layout {
                position: relative;
                display: block;
                flex: 1;
                min-height: 0;
            }

            #map {
                width: 100%;
                height: 100%;
                min-height: 0;
                display: block;
            }

            .map-layout.mobile-list-open #map {
                display: none;
            }

            .mobile-listings-toggle {
                display: inline-flex;
                position: absolute;
                top: 12px;
                left: 50%;
                transform: translateX(-50%);
                z-index: 1004;
                border: none;
                background: rgba(102, 126, 234, 0.96);
                color: #fff;
                border-radius: 999px;
                padding: 10px 16px;
                font-weight: 700;
                font-size: 14px;
                box-shadow: 0 8px 24px rgba(0,0,0,0.16);
                align-items: center;
                gap: 8px;
                min-height: 44px;
                bottom: auto;
            }

            .mobile-listings-toggle.hidden {
                display: none !important;
            }

            .mobile-sheet-backdrop {
                position: absolute;
                inset: 0;
                background: rgba(17, 24, 39, 0.24);
                z-index: 1000;
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.22s ease;
                display: block;
            }

            .mobile-sheet-backdrop.show {
                opacity: 1;
                pointer-events: auto;
            }

            .mobile-detail-sheet {
                position: absolute;
                left: 12px;
                right: 12px;
                z-index: 1003;
                background: #fff;
                border-radius: 18px;
                box-shadow: 0 12px 28px rgba(0,0,0,0.18);
                padding: 12px;
                display: none;
                align-items: center;
                gap: 12px;
                pointer-events: auto;
                bottom: calc(152px + env(safe-area-inset-bottom));
            }

            .mobile-detail-sheet.show {
                display: flex;
            }

            .mobile-sheet-close {
                position: absolute;
                top: 8px;
                right: 8px;
                width: 32px;
                height: 32px;
                border: none;
                border-radius: 999px;
                background: #f3f4f6;
                color: #444;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
            }

            .mobile-detail-image-wrap {
                width: 84px;
                height: 84px;
                min-width: 84px;
                border-radius: 12px;
                overflow: hidden;
                background: #f3f4f6;
            }

            .mobile-detail-image {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

            .mobile-detail-content {
                min-width: 0;
                flex: 1;
                padding-right: 28px;
            }

            .mobile-detail-content h3 {
                margin: 0 0 4px;
                font-size: 15px;
                line-height: 1.25;
                color: #111827;
            }

            .mobile-detail-price {
                margin: 0 0 4px;
                font-size: 14px;
                font-weight: 700;
                color: #667eea;
            }

            .mobile-detail-meta {
                margin: 0 0 8px;
                font-size: 12px;
                color: #4b5563;
                line-height: 1.3;
            }

            .mobile-detail-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-height: 36px;
                padding: 8px 12px;
                background: #667eea;
                color: #fff;
                text-decoration: none;
                border-radius: 10px;
                font-size: 12px;
                font-weight: 700;
            }

       .map-sidebar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-right: none;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1002;
    transform: translateY(102%);
    transition: transform 0.28s ease, opacity 0.2s ease, visibility 0.2s ease;
    padding: 64px 16px calc(18px + env(safe-area-inset-bottom));
    touch-action: pan-y;
    will-change: transform;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

            .map-sidebar.open {
                transform: translateY(0);
                opacity: 1;
                visibility: visible;
                pointer-events: auto;
            }

            .map-sidebar::before {
                display: none;
            }

            .map-sidebar.dragging {
                transition: none !important;
            }

            .map-sidebar-header {
                position: sticky;
                top: 0;
                z-index: 5;
                background: #fff;
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 12px;
                padding: 4px 0 10px;
                margin-bottom: 12px;
                border-bottom: 1px solid #f1f1f1;
                touch-action: none;
            }

            .map-sidebar h2 {
                margin: 0;
                font-size: 18px;
                position: static;
                padding-top: 0;
            }

            .map-sidebar-close {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 36px;
                height: 36px;
                border: none;
                border-radius: 999px;
                background: #f3f4f6;
                color: #444;
                cursor: pointer;
                flex: 0 0 auto;
            }

            .listing-preview {
                margin-bottom: 12px;
                border-radius: 10px;
            }

            .listing-preview img {
                height: 120px;
            }

            .listing-preview-content {
                padding: 10px;
            }

            .listing-preview-content h3 {
                font-size: 15px;
                margin-bottom: 6px;
            }

            .listing-preview-content p {
                font-size: 13px;
            }

            .listing-price {
                font-size: 14px;
            }

            .price-marker {
                padding: 5px 9px;
                font-size: 12px;
            }

            .mapboxgl-popup {
                display: none !important;
            }

            .mobile-detail-sheet *,
            .map-sidebar * {
                pointer-events: auto;
            }

            .mobile-sheet-close,
            .map-sidebar-close,
            .mobile-listings-toggle,
            .mobile-detail-btn {
                touch-action: manipulation;
                -webkit-tap-highlight-color: transparent;
                pointer-events: auto;
                position: relative;
                z-index: 20;
            }
        }
        
             .listing-page-wrap {
            max-width: 720px;
            margin: 40px auto 80px;
            padding: 0 24px;
        }

        .listing-page-wrap > h1 {
            font-size: 28px;
            font-weight: 700;
            color: #1a1a2e;
            margin-bottom: 24px;
            text-align: center;
        }

        .notif-list { display: flex; flex-direction: column; gap: 0; }

        .notif-item {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 18px 24px;
            background: #fff;
            border-bottom: 1px solid #f0f0f0;
            transition: background 0.15s;
            cursor: pointer;
        }
        a.notif-item {
            display: flex;
            text-decoration: none;
            color: inherit;
        }
        a.notif-item:hover { background: #f9fafb; }
        a.notif-item.unread { background: #f0f2ff; }
        a.notif-item.unread:hover { background: #e8ebff; }

        .notif-item:first-child { border-radius: 12px 12px 0 0; }
        .notif-item:last-child  { border-radius: 0 0 12px 12px; border-bottom: none; }
        .notif-item:only-child  { border-radius: 12px; }

        .notif-item:hover { background: #f9fafb; }

        .notif-item.unread { background: #f0f2ff; }
        .notif-item.unread:hover { background: #e8ebff; }

        .notif-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 16px;
        }

        .notif-icon.type-1  { background: #dbeafe; color: #1d4ed8; }
        .notif-icon.type-2  { background: #d1fae5; color: #065f46; }
        .notif-icon.type-3  { background: #fee2e2; color: #991b1b; }
        .notif-icon.type-4  { background: #fef3c7; color: #92400e; }
        .notif-icon.type-5  { background: #ede9fe; color: #5b21b6; }
        .notif-icon.type-6  { background: #fce7f3; color: #9d174d; }
        .notif-icon.type-7  { background: #f0f0f0; color: #555;   }

        .notif-body { flex: 1; min-width: 0; }

        .notif-type {
            font-size: 12px;
            font-weight: 700;
            color: #667eea;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            margin-bottom: 3px;
        }

        .notif-message {
            font-size: 14px;
            color: #374151;
            line-height: 1.5;
            margin-bottom: 4px;
        }

        .notif-date {
            font-size: 12px;
            color: #9ca3af;
        }

        .unread-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #667eea;
            flex-shrink: 0;
            margin-top: 6px;
        }

        .notif-card {
            background: #fff;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            background: #fff;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            color: #9ca3af;
        }

        .empty-state i  { font-size: 48px; margin-bottom: 16px; display: block; }
        .empty-state h3 { font-size: 18px; color: #374151; margin-bottom: 8px; }
        
    .message-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 32px; /* smaller height, longer width */
    background: linear-gradient(135deg, #4facfe, #00c6ff);
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px; /* slightly smaller text */
    border: none;

    margin-top: 8px; /* move it up (reduce space above) */

    transition: all 0.3s ease;
}

.message-button i {
    font-size: 14px;
}

.message-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

     /* ── Crop modal ── */
        .crop-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.75);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .crop-modal-overlay.active { display: flex; }
        .crop-modal {
            background: white;
            border-radius: 16px;
            width: 100%;
            max-width: 480px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }
        .crop-modal-header {
            padding: 16px 20px;
            font-weight: 700;
            font-size: 16px;
            color: #1a1a2e;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .crop-modal-header i { color: #667eea; }
        .crop-modal-body { padding: 20px; background: #f3f4f6; }
        .crop-container {
            width: 100%;
            max-height: 340px;
            overflow: hidden;
            border-radius: 10px;
            background: #000;
        }
        .crop-container img { display: block; max-width: 100%; }
        .crop-hint {
            text-align: center;
            font-size: 13px;
            color: #6b7280;
            margin-top: 12px;
        }
        .crop-modal-footer {
            padding: 16px 20px;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            border-top: 1px solid #e5e7eb;
        }
        .crop-btn-cancel {
            padding: 9px 20px;
            border-radius: 8px;
            border: 1px solid #d1d5db;
            background: white;
            color: #374151;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        .crop-btn-cancel:hover { background: #f3f4f6; }
        .crop-btn-confirm {
            padding: 9px 20px;
            border-radius: 8px;
            border: none;
            background: #667eea;
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 7px;
        }
        .crop-btn-confirm:hover { background: #5a6fd6; }
        @media (max-width: 480px) {
            .crop-modal { border-radius: 12px; }
            .crop-container { max-height: 260px; }
            .crop-modal-footer { flex-direction: column-reverse; }
            .crop-btn-cancel, .crop-btn-confirm { width: 100%; justify-content: center; }
        }

        /* ── Profile photo upload ── */
        .photo-upload-zone {
            border: 2px dashed #d1d5db;
            border-radius: 12px;
            background: #fafafa;
            transition: border-color 0.2s, background 0.2s;
            overflow: hidden;
        }
        .photo-upload-zone.dragover {
            border-color: #667eea;
            background: #f0f2ff;
        }

        /* Hidden real file input — triggered by the browse button */
        #profilePhotoInput { display: none; }

        /* Drag & drop area — hidden on mobile */
        .photo-drop-area {
            padding: 24px 20px 16px;
            text-align: center;
            pointer-events: none; /* clicks fall through to browse btn below */
        }
        .photo-drop-area i {
            font-size: 30px;
            color: #667eea;
            margin-bottom: 8px;
            display: block;
        }
        .photo-drop-area p {
            margin: 0 0 4px;
            font-size: 14px;
            color: #6b7280;
            line-height: 1.5;
        }
        .photo-drop-area strong { color: #667eea; }

        /* Browse button row — always visible */
        .photo-browse-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 14px 20px;
            border-top: 1px dashed #e5e7eb;
            flex-wrap: wrap;
        }
        .photo-browse-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 9px 20px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        .photo-browse-btn:hover { background: #5a6fd6; }
        .photo-browse-hint {
            font-size: 12px;
            color: #9ca3af;
        }

        /* Preview state */
        .photo-preview-circle {
            padding: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            gap: 10px;
        }
        .photo-preview-circle img {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid #667eea;
        }
        .photo-remove-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            background: #fee2e2;
            color: #b91c1c;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            cursor: pointer;
        }
        .photo-remove-btn:hover { background: #fecaca; }

        /* Mobile: hide the drag & drop instruction text, keep browse button */
        @media (hover: none), (max-width: 480px) {
            .photo-drop-area { display: none; }
            .photo-browse-row {
                border-top: none;
                padding: 20px;
            }
            .photo-upload-zone { border-style: solid; }
        }

        /* ── Terms & Conditions box ── */
        .terms-box {
            margin-bottom: 20px;
        }
        .terms-scroll {
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px 18px;
            max-height: 220px;
            overflow-y: auto;
            font-size: 12.5px;
            color: #4b5563;
            line-height: 1.6;
            margin-bottom: 12px;
        }
        .terms-scroll h4 {
            font-size: 13px;
            font-weight: 700;
            color: #1a1a2e;
            margin: 0 0 12px;
        }
        .terms-scroll p {
            margin: 0 0 10px;
        }
        .terms-scroll strong {
            color: #374151;
        }
        .terms-checkbox-label {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 13px;
            color: #374151;
            cursor: pointer;
            line-height: 1.5;
        }
        .terms-checkbox-label input[type="checkbox"] {
            margin-top: 2px;
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            accent-color: #667eea;
        }
        
            .reviews-header {
            display: flex;
            align-items: center;
            gap: 20px;
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            margin-bottom: 24px;
        }
        .reviews-avatar {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 26px;
            font-weight: 700;
            flex-shrink: 0;
            overflow: hidden;
        }
        .reviews-tab-bar {
            display: flex;
            gap: 0;
            border-bottom: 2px solid #e5e7eb;
            margin-bottom: 24px;
        }
        .reviews-tab {
            padding: 12px 24px;
            font-size: 15px;
            font-weight: 600;
            color: #666;
            cursor: pointer;
            border: none;
            background: none;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            transition: color 0.2s, border-color 0.2s;
        }
        .reviews-tab.active {
            color: #667eea;
            border-bottom-color: #667eea;
        }
        .reviews-tab:hover { color: #667eea; }
        .review-card {
            background: white;
            border-radius: 12px;
            padding: 18px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            margin-bottom: 14px;
        }
        .review-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        .reviewer-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .reviewer-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            font-weight: 700;
        }
        .star-display { color: #f39c12; }
        .empty-reviews {
            text-align: center;
            padding: 40px;
            color: #999;
        }
        .tab-panel { display: none; }
        .tab-panel.active { display: block; }
        
    .mutualCancelBtn {
    border: 1px solid #f59e0b;
    color: #b45309;
    background: #fff7ed;
}

.mutualCancelBtn:hover {
    background: #ffedd5;
}

.pickup-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.pickup-preview-item {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #f8f8f8;
}
/* SHARED OUTER MODAL SHELL FOR BOTH PICKUP + RETURN */
.pickup-modal-content,
.return-modal-content,
.modal-popup-content,
.modal-content {
    background: #ffffff !important;
    border-radius: 22px;
    border: none;
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
    padding: 0;
    overflow: hidden;
}

/* SHARED INNER CARD LOOK */
.pickup-card,
.return-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: none;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.pickup-card h3,
.return-card h3 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
}

.pickup-card p,
.return-card p {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #6b7280;
}

.pickup-card strong,
.return-card strong {
    color: #111827;
}

/* CAMERA BUTTON AREAS MATCH */
.camera-btn,
.return-camera-btn {
    width: 100%;
    min-height: 140px;
    border: 2px dashed #d1d5db;
    outline: none;
    box-shadow: none;
    border-radius: 18px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 20px;
    margin-bottom: 14px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.camera-btn:hover,
.return-camera-btn:hover {
    background: #f9fafb;
    border-color: #c7ccd4;
    transform: translateY(-1px);
}

.camera-btn:focus,
.camera-btn:active,
.camera-btn:focus-visible,
.return-camera-btn:focus,
.return-camera-btn:active,
.return-camera-btn:focus-visible,
#cameraTakeBtn:focus,
#cameraTakeBtn:active,
#cameraTakeBtn:focus-visible,
#returnCameraTakeBtn:focus,
#returnCameraTakeBtn:active,
#returnCameraTakeBtn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ICONS MATCH */
.camera-icon,
.return-camera-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 18px rgba(99,102,241,0.25);
}

.camera-text,
.return-camera-text {
    font-size: 18px;
    font-weight: 600;
    color: #4b5563;
}
.pickup-preview-item {
    width: 100%;
    max-width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}
/* ACTION ROWS MATCH */
.pickup-actions,
.return-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.pickup-btn,
.return-btn {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.pickup-btn-primary,
.return-btn-primary {
    background: #22c55e;
    color: white;
}

.pickup-btn-primary:hover,
.return-btn-primary:hover {
    background: #16a34a;
}

.pickup-btn-secondary,
.return-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.pickup-btn-secondary:hover,
.return-btn-secondary:hover {
    background: #d1d5db;
}

/* MOBILE */
@media (max-width: 768px) {
    .pickup-card,
    .return-card {
        padding: 18px;
        border-radius: 16px;
    }

    .pickup-card h3,
    .return-card h3 {
        font-size: 22px;
    }

    .camera-btn,
    .return-camera-btn {
        min-height: 110px;
        border-radius: 16px;
    }

    .camera-text,
    .return-camera-text {
        font-size: 16px;
    }

    .pickup-actions,
    .return-actions {
        flex-direction: column;
    }

    .pickup-btn,
    .return-btn {
        width: 100%;
    }
}




.icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #444;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.chat-input {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 14px 14px;
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
}

.chat-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

#gifPicker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 44px;
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    padding: 12px;
    z-index: 1000;
    display: none;
}

#gifPicker.show {
    display: block;
}

.gif-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.gif-search-row input {
    flex: 1;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
}

.gif-search-row input:focus {
    border-color: #667eea;
}

.gif-search-btn {
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.gif-search-btn:hover {
    background: #5a67d8;
}

.gif-results {
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.gif-results img {
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    display: block;
}

.gif-attribution {
    margin-top: 8px;
    font-size: 11px;
    color: #777;
    text-align: right;
}

.file-preview {
    margin-top: 8px;
}

.gif-selected-preview {
    position: relative;
    display: inline-block;
}

.remove-gif-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}
.file-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-preview-item,
.gif-selected-preview {
    position: relative;
    display: inline-block;
}

.file-preview-thumb,
.gif-selected-preview img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: block;
    background: #f9fafb;
}

.file-preview-doc {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.file-preview-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: #667eea;
}

.file-preview-name {
    font-size: 12px;
    color: #374151;
    word-break: break-word;
    line-height: 1.2;
    max-height: 38px;
    overflow: hidden;
}

.remove-file-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}
rental-confirmation-media {
    margin: 18px 0 20px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.confirmation-media-title {
    font-size: 15px;
  
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirmation-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.confirmation-media-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.14);
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.06);
}

.confirmation-media-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
    overflow: hidden;
}

.confirmation-media-preview img,
.confirmation-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.confirmation-media-info {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.confirmation-media-info span {
   

    padding: 5px 8px;
    border-radius: 999px;
}