﻿  
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            /* Light mode - Professional & Elegant Colors */
            --primary-color: #2c3e50;
            --primary-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
            --secondary-color: #34495e;
            --accent-color: #e74c3c;
            --accent-gradient: linear-gradient(45deg, #e74c3c, #c0392b);
            --background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
            --card-background: rgba(255, 255, 255, 0.95);
            --text-color: #2c3e50;
            --text-secondary: #7f8c8d;
            --border-color: #bdc3c7;
            --shadow: rgba(44, 62, 80, 0.1);
            --shadow-hover: rgba(44, 62, 80, 0.2);
            --nav-control-size: 44px;
            --page-padding: 20px;
        }

        [data-theme="dark"] {
            /* Dark mode colors - Enhanced visibility */
            --primary-color: #3498db;
            --primary-gradient: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            --secondary-color: #2c3e50;
            --accent-color: #e74c3c;
            --accent-gradient: linear-gradient(45deg, #e74c3c, #c0392b);
            --background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
            --card-background: rgba(42, 42, 42, 0.95);
            --text-color: #ffffff;
            --text-secondary: #bdc3c7;
            --border-color: #4a4a4a;
            --shadow: rgba(0, 0, 0, 0.5);
            --shadow-hover: rgba(0, 0, 0, 0.7);
            --input-background: #2c3e50;
            --input-focus-background: #34495e;
            --hover-background: rgba(52, 152, 219, 0.1);
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: var(--background);
            min-height: 100vh;
            overflow-x: hidden;
            transition: all 0.3s ease;
            color: var(--text-color);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            touch-action: manipulation;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding-inline: var(--page-padding);
            width: 100%;
        }

        @media (max-width: 768px) {
            :root {
                --page-padding: 16px;
                --nav-control-size: 40px;
            }
        }

        @media (max-width: 480px) {
            :root {
                --page-padding: 12px;
            }
        }

        /* Smooth scrolling for all devices */
        html {
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch;
        }

        /* Better input styling for mobile */
        input, textarea, select, button {
            font-family: inherit;
            font-size: inherit;
        }

        /* Prevent zoom on input focus for iOS */
        @media screen and (max-width: 768px) {
            input, textarea, select {
                font-size: 16px !important;
            }
        }

        /* Header Styles */
        .header {
            background: var(--card-background);
            backdrop-filter: blur(20px);
            box-shadow: 0 8px 32px var(--shadow);
            position: sticky;
            top: 0;
            z-index: 1000;
            transition: all 0.3s ease;
        }

        .nav {
            padding: 1.2rem 0;
            width: 100%;
            overflow: visible;
        }

        .nav-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 2rem;
            flex-wrap: nowrap;
            width: 100%;
            overflow: visible;
        }

        .logo {
            font-size: 1.8rem;
            font-weight: bold;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            cursor: pointer;
            transition: transform 0.3s ease;
            min-width: fit-content;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            line-height: 1.4;
            padding: 0.3rem 0.5rem;
            margin: 0.2rem 0;
            z-index: 10;
            position: relative;
            overflow: visible;
        }

        .logo:hover {
            transform: scale(1.05);
        }

        .nav-center {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex: 2;
            justify-content: center;
            min-width: 0;
        }

        .nav-links {
            display: flex;
            gap: 1.2rem;
            list-style: none;
            flex-wrap: wrap;
            justify-content: center;
            flex: 1;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            font-size: 1rem;
            transition: all 0.3s ease;
            padding: 0.6rem 1.1rem;
            border-radius: 25px;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        .nav-links a:hover {
            color: var(--primary-color);
            background: var(--hover-background, var(--card-background));
            transform: translateY(-2px);
            box-shadow: 0 5px 15px var(--shadow);
        }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 1.2rem;
            flex-shrink: 0;
        }

        .search-container {
            display: flex;
            align-items: center;
            margin-right: 0.8rem;
        }

        .nav-controls {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-right: 0.8rem;
        }

        .nav-auth {
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .nav-controls button,
        .nav-auth .login-btn,
        .nav-auth .user-account {
            min-height: var(--nav-control-size);
        }

        .search-bar {
            display: flex;
            background: var(--card-background);
            border-radius: 50px;
            box-shadow: 0 4px 20px var(--shadow);
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .search-bar:focus-within {
            transform: scale(1.02);
            box-shadow: 0 8px 30px var(--shadow-hover);
        }

        .search-input {
            border: none;
            padding: 0.9rem 1.2rem;
            font-size: 0.95rem;
            outline: none;
            min-width: 280px;
            background: transparent;
            color: var(--text-color);
            transition: all 0.3s ease;
        }

        [data-theme="dark"] .search-input {
            background: var(--input-background);
        }

        [data-theme="dark"] .search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .search-btn {
            background: var(--primary-gradient);
            border: none;
            color: white;
            padding: 0.9rem 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            border-radius: 0;
        }

        .search-btn:hover {
            opacity: 0.9;
        }

        .theme-toggle {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.7rem;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s ease;
            width: var(--nav-control-size);
            height: var(--nav-control-size);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 3px 12px var(--shadow);
            -webkit-tap-highlight-color: transparent;
        }

        .theme-toggle:hover {
            transform: translateY(-3px) scale(1.1) rotate(10deg);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .theme-toggle:active {
            transform: scale(0.9);
            transition: transform 0.1s ease;
        }

        /* Dark mode theme toggle styling */
        [data-theme="dark"] .theme-toggle {
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
            box-shadow: 0 3px 15px rgba(255, 215, 0, 0.4);
        }

        [data-theme="dark"] .theme-toggle:hover {
            box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
            transform: translateY(-3px) scale(1.1) rotate(-10deg);
        }

        .theme-toggle::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: all 0.5s ease;
        }

        .theme-toggle:hover::before {
            width: 150%;
            height: 150%;
        }

        .lang-toggle {
            background: var(--accent-gradient);
            color: white;
            border: none;
            padding: 0.7rem 1.2rem;
            border-radius: 22px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
            overflow: hidden;
            min-height: var(--nav-control-size);
            box-shadow: 0 3px 12px var(--shadow);
            -webkit-tap-highlight-color: transparent;
        }

        .lang-toggle .lang-icon {
            font-size: 1rem;
        }

        .lang-toggle .lang-text {
            font-size: 0.9rem;
            font-weight: 600;
        }

        .lang-toggle:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px var(--shadow-hover);
        }

        .lang-toggle:active {
            transform: scale(0.95);
            transition: transform 0.1s ease;
        }

        [data-theme="dark"] .lang-toggle {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
            box-shadow: 0 3px 15px rgba(231, 76, 60, 0.4);
        }

        [data-theme="dark"] .lang-toggle:hover {
            box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6);
        }

        .lang-toggle .lang-icon {
            transition: all 0.3s ease;
        }

        .lang-toggle:hover .lang-icon {
            transform: rotate(20deg);
        }

        .lang-toggle::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 0;
            background: rgba(0, 0, 0, 0.1);
            transition: height 0.3s ease;
        }

        .lang-toggle:hover::after {
            height: 100%;
        }

        .user-account {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            background: var(--card-background);
            padding: 0.7rem 1.2rem;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid var(--border-color);
            position: relative;
            overflow: hidden;
        }

        .user-account::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 100%;
            background: var(--primary-gradient);
            opacity: 0.1;
            transition: width 0.3s ease;
            z-index: 0;
        }

        .user-account:hover {
            box-shadow: 0 8px 20px var(--shadow-hover);
            transform: translateY(-3px);
        }

        .user-account:hover::before {
            width: 100%;
        }

        .user-account .user-avatar,
        .user-account .user-name {
            z-index: 1;
        }

        .user-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1rem;
            overflow: hidden;
            flex-shrink: 0;
            border: 2px solid var(--border-color);
            box-shadow: 0 3px 10px var(--shadow);
            transition: all 0.3s ease;
        }

        .user-account:hover .user-avatar {
            transform: scale(1.1);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .user-name {
            color: var(--text-color);
            font-weight: 500;
            font-size: 0.9rem;
        }

        .login-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.9rem 1.8rem;
            border-radius: 25px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        .login-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: all 0.5s ease;
            z-index: -1;
        }

        .login-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .login-btn:hover::before {
            left: 100%;
            transition: all 0.5s ease;
        }

        /* Main Content */
        .main {
            padding: 2rem 0;
        }

        @media (max-width: 768px) {
            .main {
                padding: 0.5rem 0 2rem;
            }

            body {
                background: linear-gradient(180deg, 
                    var(--background) 0%, 
                    rgba(102, 126, 234, 0.02) 100%);
            }
        }

        /* Hero Section */
        .hero {
            text-align: center;
            color: var(--text-color);
            margin-bottom: 3rem;
            animation: fadeInUp 1s ease;
        }

        .hero h1 {
            font-size: 3.5rem;
            margin-bottom: 1rem;
            text-shadow: 2px 2px 4px var(--shadow);
        }

        .hero p {
            font-size: 1.3rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto 2.5rem auto;
            color: var(--text-secondary);
        }

        /* Creative Hero Search Bar */
        .hero-search-container {
            max-width: 700px;
            margin: 0 auto;
            position: relative;
            z-index: 100;
            padding: 0 20px;
        }

        .hero-search-bar {
            display: flex;
            align-items: stretch;
            background: rgba(32, 33, 35, 0.9);
            border-radius: 0;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            position: relative;
        }

        .hero-search-btn {
            background: #E74C3C;
            border: none;
            color: white;
            padding: 0 24px;
            cursor: pointer;
            font-weight: 500;
            font-size: 14px;
            border-radius: 0;
            transition: all 0.2s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .hero-search-btn:hover {
            background: #C0392B;
        }

        @media (max-width: 768px) {
            .hero-search-btn {
                padding: 0 16px;
                font-size: 13px;
            }
        }

        @media (max-width: 768px) {
            .hero-search-container {
                padding: 0 1rem;
                margin-top: 1rem;
            }

            .hero-search-bar {
                padding: 0.5rem;
                border-radius: 12px;
            }

            .search-icon-wrapper {
                padding: 0.8rem;
                border-radius: 10px;
                margin-right: 0.5rem;
            }

            .hero-search-input {
                font-size: 1rem;
                padding: 0.8rem;
                min-width: 0;
            }

            .hero-search-btn {
                padding: 0.8rem 1.2rem;
                border-radius: 0;
                font-weight: 600;
                font-size: 0.9rem;
            }
        }

        @media (max-width: 480px) {
            .hero-search-container {
                padding: 0 0.5rem;
            }

            .hero-search-bar {
                padding: 0.4rem;
            }

            .search-icon-wrapper {
                padding: 0.6rem;
            }

            .hero-search-input {
                padding: 0.6rem;
                font-size: 0.95rem;
            }

            .hero-search-btn {
                padding: 0.6rem 1rem;
                font-size: 0.85rem;
            }
        }

        .hero-search-bar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--primary-gradient);
            border-radius: 60px;
            padding: 3px;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .hero-search-bar:focus-within {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 30px 80px var(--shadow-hover);
        }

        .hero-search-bar:focus-within::before {
            opacity: 1;
        }

        .search-icon-wrapper {
            padding: 8px 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 0.5);
            transition: all 0.2s ease;
        }

        .search-icon {
            font-size: 20px;
            color: currentColor;
        }

        .hero-search-input {
            flex: 1;
            border: none;
            padding: 1.5rem 2rem;
            font-size: 1.2rem;
            outline: none;
            background: transparent;
            color: var(--text-color);
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .hero-search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        [data-theme="dark"] .hero-search-input {
            background: var(--input-background);
        }

        [data-theme="dark"] .hero-search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.9;
        }

        .hero-search-btn {
            background: var(--accent-gradient);
            border: none;
            color: white;
            padding: 1.2rem 2rem;
            cursor: pointer;
            font-weight: 700;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            border-radius: 0;
            display: flex;
            align-items: center;
            gap: 0.8rem;
            position: relative;
            overflow: hidden;
        }

        .hero-search-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: all 0.6s ease;
            z-index: 0;
        }

        .hero-search-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
        }

        .hero-search-btn:hover::before {
            left: 100%;
        }

        .search-text,
        .search-arrow {
            z-index: 1;
            transition: all 0.3s ease;
        }

        .hero-search-btn:hover .search-arrow {
            transform: translateX(5px);
        }

        .search-suggestions {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-top: 16px;
            flex-wrap: wrap;
            opacity: 0;
            animation: fadeInUp 1s ease 0.5s forwards;
        }

        .suggestion-chip {
            background: rgba(32, 33, 35, 0.5);
            color: rgba(255, 255, 255, 0.9);
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid rgba(255, 255, 255, 0.1);
            font-weight: 500;
            font-size: 14px;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(10px);
        }

        .suggestion-chip::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 100%;
            background: var(--primary-gradient);
            transition: width 0.3s ease;
            z-index: -1;
        }

        .suggestion-chip:hover {
            color: white;
            transform: translateY(-3px);
            box-shadow: 0 10px 25px var(--shadow-hover);
            border-color: var(--primary-color);
        }

        .suggestion-chip:hover::before {
            width: 100%;
        }

        @keyframes searchFloat {

            0%,
            100% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-5px);
            }
        }

        .hero-search-bar:not(:focus-within) {
            animation: searchFloat 4s ease-in-out infinite;
        }

        /* Featured Carousel */
        .featured-section {
            margin-bottom: 3rem;
        }

        .section-title {
            color: var(--text-color);
            font-size: 2rem;
            margin-bottom: 1.5rem;
            text-align: center;
            text-shadow: 1px 1px 2px var(--shadow);
        }

        .carousel {
            display: flex;
            gap: 1.5rem;
            overflow-x: auto;
            padding: 1rem 0;
            scroll-behavior: smooth;
        }

        .carousel::-webkit-scrollbar {
            height: 8px;
        }

        .carousel::-webkit-scrollbar-track {
            background: var(--border-color);
            border-radius: 4px;
        }

        .carousel::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        .featured-card {
            min-width: 300px;
            background: var(--card-background);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 10px 30px var(--shadow);
            transition: all 0.3s ease;
            cursor: pointer;
            border: 1px solid var(--border-color);
        }

        .featured-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 20px 40px var(--shadow-hover);
        }

        .card-image {
            height: 200px;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: white;
        }

        .card-content {
            padding: 1.5rem;
        }

        .card-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
            color: var(--text-color);
        }

        .card-price {
            color: var(--primary-color);
            font-size: 1.3rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }

        .card-location {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        /* Filters and Listings */
        .content-area {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 2rem;
            background: var(--card-background);
            border-radius: 25px;
            padding: 2rem;
            box-shadow: 0 15px 35px var(--shadow);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
        }

        .sidebar {
            background: var(--card-background);
            padding: 1.5rem;
            border-radius: 20px;
            height: fit-content;
            position: sticky;
            top: 100px;
            border: 1px solid var(--border-color);
        }

        .filter-group {
            margin-bottom: 2rem;
        }

        .filter-title {
            font-weight: bold;
            margin-bottom: 1rem;
            color: var(--text-color);
            font-size: 1.1rem;
        }

        .filter-select,
        .filter-input {
            width: 100%;
            padding: 0.8rem;
            border: 2px solid var(--border-color);
            border-radius: 15px;
            font-size: 1rem;
            transition: all 0.3s ease;
            margin-bottom: 0.5rem;
            background: var(--card-background);
            color: var(--text-color);
        }

        .filter-select:focus,
        .filter-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        [data-theme="dark"] .filter-select,
        [data-theme="dark"] .filter-input {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .filter-select:focus,
        [data-theme="dark"] .filter-input:focus {
            background: var(--input-focus-background);
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .filter-select option {
            background: var(--input-background);
            color: var(--text-color);
        }

        .post-ad-btn {
            width: 100%;
            background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
            color: white;
            border: none;
            padding: 1rem;
            border-radius: 15px;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 2rem;
            box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
            position: relative;
            overflow: hidden;
        }

        .post-ad-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: all 0.5s ease;
            z-index: 1;
        }

        .post-ad-btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 12px 30px rgba(39, 174, 96, 0.4);
            background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
        }

        .post-ad-btn:hover::before {
            left: 100%;
        }

        .category-section {
            margin-bottom: 2rem;
        }

        .category-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .category-item {
            padding: 0.8rem;
            background: var(--card-background);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .category-item:hover {
            background: var(--primary-color);
            color: white;
            transform: translateX(5px);
        }

        [data-theme="dark"] .category-item {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .category-item:hover {
            background: var(--primary-color);
            color: white;
        }

        .brand-models {
            margin-left: 1rem;
            margin-top: 0.5rem;
            display: none;
        }

        .brand-models.active {
            display: block;
        }

        .brand-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem;
            margin: 0.25rem 0;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .brand-item:hover {
            background: var(--hover-background, var(--border-color));
        }

        [data-theme="dark"] .brand-item:hover {
            background: var(--hover-background);
        }

        .brand-logo {
            width: 20px;
            height: 20px;
            background: var(--primary-gradient);
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: white;
        }

        /* Enhanced subcategory styles */
        .category-arrow {
            margin-left: auto;
            font-size: 0.8rem;
            transition: transform 0.3s ease;
            opacity: 0.7;
        }

        .category-item.expanded .category-arrow {
            transform: rotate(180deg);
        }

        .subcategories {
            display: none;
            margin-left: 1.5rem;
            margin-top: 0.5rem;
            padding-left: 1rem;
            border-left: 2px solid var(--border-color);
            animation: slideDown 0.3s ease;
        }

        .subcategories.active {
            display: block;
        }

        .subcategory-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem 0.8rem;
            margin: 0.25rem 0;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            background: var(--card-background);
            border: 1px solid transparent;
        }

        .subcategory-item:hover {
            background: var(--primary-color);
            color: white;
            transform: translateX(5px);
            border-color: var(--primary-color);
        }

        .subcategory-item.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .subcategory-item {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .subcategory-item:hover {
            background: var(--primary-color);
            color: white;
        }

        .model-list {
            display: none;
            margin-left: 2rem;
            margin-top: 0.5rem;
            padding: 0.5rem;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 8px;
            border-left: 3px solid var(--accent-color);
        }

        [data-theme="dark"] .model-list {
            background: rgba(255, 255, 255, 0.05);
        }

        .model-list.active {
            display: block;
            animation: fadeInUp 0.3s ease;
        }

        .model-item {
            padding: 0.4rem 0.8rem;
            margin: 0.2rem 0;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.3s ease;
            border: 1px solid transparent;
            background: var(--card-background);
            color: var(--text-color);
        }

        .model-item:hover {
            background: var(--accent-color);
            color: white;
            transform: translateX(3px);
            border-color: var(--accent-color);
        }

        .model-item.active {
            background: var(--accent-color);
            color: white;
            border-color: var(--accent-color);
            font-weight: 600;
        }

        [data-theme="dark"] .model-item {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .model-item:hover {
            background: var(--accent-color);
            color: white;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                max-height: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                max-height: 500px;
                transform: translateY(0);
            }
        }

        /* Listings Grid */
        .listings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
            align-items: start;
        }

        .listing-card {
            background: var(--card-background);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 5px 20px var(--shadow);
            transition: all 0.3s ease;
            cursor: pointer;
            border: 1px solid var(--border-color);
            height: fit-content;
        }

        .listing-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px var(--shadow-hover);
        }

        .listing-image {
            height: 250px;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2rem;
        }

        .listing-content {
            padding: 1.2rem;
        }

        .listing-title {
            font-weight: bold;
            margin-bottom: 0.5rem;
            color: var(--text-color);
        }

        .listing-price {
            color: var(--primary-color);
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }

        .listing-location {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 0.8rem;
        }

        .listing-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 0.8rem;
        }

        .listing-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.8rem;
        }

        .message-seller-btn {
            flex: 1;
            background: var(--accent-gradient);
            color: white;
            border: none;
            padding: 0.7rem 1rem;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .message-seller-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
        }

        .view-details-btn {
            flex: 1;
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.7rem 1rem;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .view-details-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            backdrop-filter: blur(10px);
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--card-background);
            border-radius: 25px;
            max-width: 1200px;
            width: 90%;
            max-height: 95vh;
            overflow-y: auto;
            animation: modalSlideIn 0.3s ease;
        }

        .modal-header {
            padding: 2rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-body {
            padding: 2rem;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: color 0.3s ease;
        }

        .close-btn:hover {
            color: var(--text-color);
        }

        /* Share Button Styles */
        .share-listing-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
        }

        .share-listing-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
        }

        .share-listing-btn:active {
            transform: translateY(0);
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
        }

        .share-listing-btn .share-icon {
            font-size: 1.2rem;
            animation: shareIconPulse 2s ease-in-out infinite;
        }

        @keyframes shareIconPulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        /* Safety Banner */
        .safety-banner {
            background: var(--accent-gradient);
            color: white;
            padding: 1rem;
            border-radius: 15px;
            margin-bottom: 1.5rem;
            text-align: center;
        }

        /* Photo Upload Styles */
        .photo-upload-area {
            border: 2px dashed var(--border-color);
            border-radius: 10px;
            padding: 2rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            background: var(--card-background);
        }

        .photo-upload-area:hover {
            border-color: var(--primary-color);
            background: var(--shadow);
        }

        .photo-upload-area.dragover {
            border-color: var(--primary-color);
            background: var(--shadow);
        }

        .photo-preview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }

        .photo-preview {
            position: relative;
            width: 100px;
            height: 100px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 2px 10px var(--shadow);
        }

        .photo-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .photo-remove {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(231, 76, 60, 0.9);
            color: white;
            border: none;
            border-radius: 50%;
            width: 25px;
            height: 25px;
            cursor: pointer;
            font-size: 12px;
        }

        /* Chat Modal Styles */
        .chat-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2500;
            backdrop-filter: blur(10px);
        }

        .chat-modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--card-background);
            border-radius: 20px;
            max-width: 500px;
            width: 90%;
            max-height: 600px;
            overflow: hidden;
            animation: modalSlideIn 0.3s ease;
            box-shadow: 0 20px 60px var(--shadow-hover);
        }

        .chat-header {
            background: var(--primary-gradient);
            color: white;
            padding: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .mobile-conversations-toggle {
            display: none;
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            margin-right: 1rem;
            flex-shrink: 0;
        }

        .mobile-conversations-toggle:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.05);
        }

        .mobile-conversations-toggle:active {
            transform: scale(0.95);
        }

        .mobile-conversations-toggle svg {
            display: block;
        }

        .mobile-welcome-toggle {
            position: absolute;
            top: 1rem;
            left: 1rem;
            z-index: 10;
            background: var(--primary-gradient);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .mobile-welcome-toggle:hover {
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        }

        /* Hide welcome toggle when active chat is showing */
        .active-chat:not([style*="display: none"]) ~ .chat-welcome .mobile-welcome-toggle,
        .chat-area:has(.active-chat:not([style*="display: none"])) .mobile-welcome-toggle {
            display: none !important;
        }

        .chat-user-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .chat-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .chat-user-name {
            font-weight: 600;
            font-size: 1.1rem;
        }

        .chat-close {
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 50%;
            transition: background 0.3s ease;
        }

        .chat-close:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .chat-messages {
            height: 300px;
            overflow-y: auto;
            padding: 1rem;
            background: var(--background);
        }

        /* Force layout direction for message alignment while keeping bubble text RTL */
        .chat-messages, .messages-container {
            direction: ltr; /* layout uses LTR so flex-end means visual right */
        }

        .message {
            margin-bottom: 1rem;
            display: flex;
            gap: 0.5rem;
        }

        /* Smooth fade/slide for newly appended messages to hide small reflow flashes */
        .message-new {
            opacity: 0;
            transform: translateY(6px);
            transition: opacity 160ms ease, transform 160ms ease;
        }

        .message.own {
            justify-content: flex-end;
        }

        .message.own .message-bubble {
            background: var(--primary-gradient);
            color: white;
            border-radius: 18px 18px 4px 18px;
        }

        .message:not(.own) .message-bubble {
            background: var(--card-background);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 18px 18px 18px 4px;
        }

        .message-bubble {
            max-width: 70%;
            /* Keep message content readable for RTL languages */
            direction: rtl;
            text-align: right;
            padding: 0.8rem 1.2rem;
            word-wrap: break-word;
            box-shadow: 0 2px 8px var(--shadow);

            /* 🚩 new limits for uploaded media */
            max-width: 800px;
            max-height: 1200px;
            overflow: hidden;
        }

        .message-bubble img {
            max-width: 100%;
            max-height: 1000px;
            height: auto;
            width: auto;
            object-fit: contain;
        }

        /* NEW: audio player should span the bubble width */
        .message-bubble audio {
            display: block;
            width: 100px;
            max-width: 100%;
            height: 40px;
            /* typical control height; remove if you prefer auto */
            outline: none;
            border-radius: 10px;
            /* optional: match bubble vibe */
        }

        .message-time {
            font-size: 0.8rem;
            opacity: 0.7;
            margin-top: 0.3rem;
        }

        .chat-input-container {
            padding: 1rem;
            background: var(--card-background);
            border-top: 1px solid var(--border-color);
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        .chat-input {
            flex: 1;
            padding: 1rem;
            border: 2px solid var(--border-color);
            border-radius: 25px;
            background: var(--background);
            color: var(--text-color);
            outline: none;
            transition: all 0.3s ease;
        }

        .chat-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        [data-theme="dark"] .chat-input {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .chat-input:focus {
            background: var(--input-focus-background);
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .chat-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .chat-send-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.3s ease;
        }

        .chat-send-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .chat-send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }


        /* File Upload Area Styles */
        .file-upload-area {
            margin: 0.5rem 1rem;
            border-radius: 15px;
            background: var(--card-background);
            border: 2px solid var(--border-color);
            overflow: hidden;
            box-shadow: 0 4px 15px var(--shadow);
        }

        .file-drop-zone {
            padding: 2rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--background);
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            margin: 1rem;
            min-height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .file-drop-zone:hover,
        .file-drop-zone.dragover {
            border-color: var(--primary-color);
            background: var(--hover-background, rgba(52, 152, 219, 0.05));
            transform: translateY(-2px);
        }

        .drop-zone-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .upload-icon {
            font-size: 2.5rem;
            color: var(--primary-color);
            animation: float 2s ease-in-out infinite;
        }

        .upload-text {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-color);
            margin: 0;
        }

        .upload-hint {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin: 0;
        }

        /* File Preview Container */
        .file-preview-container {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            padding: 1rem;
            background: var(--background);
            border-top: 1px solid var(--border-color);
            max-height: 150px;
            overflow-y: auto;
        }

        .file-preview-item {
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.8rem;
            background: var(--card-background);
            border: 2px solid var(--border-color);
            border-radius: 12px;
            min-width: 200px;
            max-width: 300px;
            transition: all 0.3s ease;
        }

        .file-preview-item:hover {
            border-color: var(--primary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px var(--shadow);
        }

        .file-preview-item img {
            width: 50px;
            height: 50px;
            object-fit: cover;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .file-icon {
            width: 50px;
            height: 50px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
            flex-shrink: 0;
        }

        .file-icon.video-icon {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }

        .file-icon.audio-icon {
            background: linear-gradient(135deg, #9b59b6, #8e44ad);
        }

        .file-icon.document-icon {
            background: linear-gradient(135deg, #3498db, #2980b9);
        }

        .file-info {
            flex: 1;
            min-width: 0;
        }

        .file-name {
            font-weight: 600;
            color: var(--text-color);
            font-size: 0.9rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 0.2rem;
        }

        .file-size {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .remove-file-btn {
            position: absolute;
            top: -8px;
            right: -8px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--accent-color);
            color: white;
            border: 2px solid var(--card-background);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px var(--shadow);
        }

        .remove-file-btn:hover {
            transform: scale(1.1);
            background: #c0392b;
        }

        .upload-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--border-color);
            border-radius: 0 0 12px 12px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            background: var(--primary-gradient);
            transition: width 0.3s ease;
        }

        /* Drag Overlay */
        .drag-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(52, 152, 219, 0.9);
            color: white;
            display: none;
            align-items: center;
            justify-content: center;
            border-radius: 20px;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }

        .drag-overlay-content {
            text-align: center;
            font-size: 1.2rem;
            font-weight: 600;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes scaleIn {
            from {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.8);
            }

            to {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
        }

        @keyframes scaleOut {
            from {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }

            to {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.8);
            }
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                max-height: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                max-height: 300px;
                transform: translateY(0);
            }
        }

        @keyframes slideUp {
            from {
                opacity: 1;
                max-height: 300px;
                transform: translateY(0);
            }

            to {
                opacity: 0;
                max-height: 0;
                transform: translateY(-10px);
            }
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-8px);
            }
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translate(-50%, -60%);
            }

            to {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }

            100% {
                transform: scale(1);
            }
        }

        @keyframes shimmer {
            0% {
                background-position: -200% 0;
            }

            100% {
                background-position: 200% 0;
            }
        }

        /* Loading spinner */
        .loading-spinner {
            width: 20px;
            height: 20px;
            border: 2px solid #f3f3f3;
            border-top: 2px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            display: inline-block;
            margin-right: 10px;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* Responsive Design */
        @media (min-width: 769px) {
            /* Desktop: Show sidebar, hide mobile elements */
            .sidebar {
                display: block !important;
            }

            .mobile-post-ad,
            .mobile-filter-btn {
                display: none !important;
            }

            .filter-overlay {
                display: none !important;
            }
        }

        @media (max-width: 1024px) {
            .container {
                padding: 0 1rem;
            }

            .content-area {
                gap: 1.5rem;
            }

            .listings-grid {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
                gap: 1.25rem;
            }
        }

        @media (max-width: 768px) {
            /* Header Mobile Styles - Solid Background */
            .header {
                padding: 0.75rem 0;
                position: sticky;
                top: 0;
                z-index: 1000;
                background: #ffffff;
                box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
                border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            }
            
            [data-theme="dark"] .header {
                background: #1a1a1a;
                border-bottom: 1px solid rgba(255, 255, 255, 0.08);
                box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
            }

            .nav {
                padding: 0.5rem 0;
            }

            .nav-top {
                flex-direction: row;
                align-items: center;
                justify-content: space-between;
                gap: 0.5rem;
                flex-wrap: nowrap;
            }

            .logo {
                font-size: 1.4rem;
                justify-content: flex-start;
                padding: 0;
                border-bottom: none;
                flex-shrink: 0;
            }

            [data-theme="dark"] .logo {
                border-bottom-color: transparent;
            }

            .nav-center {
                display: none;
            }

            .nav-right {
                display: flex;
                align-items: center;
                justify-content: flex-end;
                gap: 0.5rem;
                flex-shrink: 0;
            }

            .nav-controls,
            .nav-auth {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                flex: 1;
            }

            .nav-controls {
                justify-content: flex-start;
            }

            .nav-auth {
                justify-content: flex-end;
            }

            .lang-toggle,
            .login-btn {
                padding-inline: 0.9rem;
                border-radius: 14px;
            }

            .user-account {
                padding: 0.35rem 0.75rem;
                border-radius: 16px;
            }

            .search-btn {
                width: 36px;
                height: 36px;
                border-radius: 0;
                font-size: 1rem;
                background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
                color: white;
                border: none;
                cursor: pointer;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                justify-content: center;
                box-shadow: 0 2px 8px rgba(52, 152, 219, 0.25);
            }
            
            .search-btn:hover {
                transform: scale(1.02);
                box-shadow: 0 3px 12px rgba(52, 152, 219, 0.35);
            }
            
            .search-btn:active {
                transform: scale(0.98);
            }

            /* Search Icon Positioning */
            .search-container::before {
                content: "🔍";
                position: absolute;
                left: 1rem;
                top: 50%;
                transform: translateY(-50%);
                font-size: 1.1rem;
                z-index: 2;
                opacity: 0.5;
                transition: opacity 0.3s ease;
            }
            
            .search-bar:focus-within + .search-container::before,
            .search-container:focus-within::before {
                opacity: 0.8;
                color: #3498db;
            }

            /* Dark Mode Search Bar */
            [data-theme="dark"] .search-bar {
                background: rgba(255, 255, 255, 0.08);
                border-color: rgba(255, 255, 255, 0.1);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
            }
            
            [data-theme="dark"] .search-bar:focus-within {
                border-color: #3498db;
                background: rgba(255, 255, 255, 0.12);
                box-shadow: 0 4px 20px rgba(52, 152, 219, 0.2);
            }
            
            [data-theme="dark"] .search-input {
                color: #ffffff;
            }
            
            [data-theme="dark"] .search-input::placeholder {
                color: rgba(255, 255, 255, 0.4);
            }
            
            [data-theme="dark"] .search-container::before {
                opacity: 0.6;
            }

            /* Compact Button Styling */
            .theme-toggle {
                width: var(--nav-control-size);
                height: var(--nav-control-size);
                font-size: 1.1rem;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid rgba(0, 0, 0, 0.08);
                background: white;
            }

            .lang-toggle {
                min-height: var(--nav-control-size);
                font-size: 0.85rem;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                border-radius: 14px;
            }

            /* Hide language text on mobile, show only icon */
            .lang-toggle .lang-text {
                display: none;
            }

            .lang-toggle .lang-icon {
                font-size: 1rem;
                margin: 0;
            }

            .theme-toggle:active,
            .lang-toggle:active {
                transform: scale(0.95);
            }

            /* Dark mode button colors for mobile */
            [data-theme="dark"] .theme-toggle {
                background: #2c3e50;
                border: 1px solid rgba(255, 255, 255, 0.1);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
                color: #ffd700;
            }
            
            [data-theme="dark"] .lang-toggle {
                background: var(--accent-gradient);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
            }

            /* Clean User Account Button */
            .user-account {
                padding: 0.35rem 0.75rem;
                border-radius: 16px;
                background: #f8f9fa;
                border: 1px solid rgba(0, 0, 0, 0.08);
                display: flex;
                align-items: center;
                gap: 0.5rem;
                transition: all 0.2s ease;
            }
            
            [data-theme="dark"] .user-account {
                background: rgba(255, 255, 255, 0.08);
                border-color: rgba(255, 255, 255, 0.1);
            }

            .login-btn {
                padding: 0.625rem 1.25rem;
                font-size: 0.9rem;
                border-radius: 12px;
                font-weight: 600;
            }

            .user-name {
                display: none;
            }

            .user-avatar {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                border: 2px solid rgba(255, 255, 255, 0.9);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }
            
            [data-theme="dark"] .user-avatar {
                border-color: rgba(255, 255, 255, 0.2);
            }

            /* Mobile Body Background */
            body {
                background: #f5f7fa;
            }

            [data-theme="dark"] body {
                background: #0f0f0f;
            }

            /* Hero Section Mobile */
            .hero {
                padding: 2.5rem 0 3rem;
                margin-left: calc(-1 * var(--page-padding));
                margin-right: calc(-1 * var(--page-padding));
                padding-left: calc(var(--page-padding) + 0.75rem);
                padding-right: calc(var(--page-padding) + 0.75rem);
                border-radius: 0 0 28px 28px;
                background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
            }

            [data-theme="dark"] .hero {
                background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
            }

            .hero h1 {
                font-size: 2.25rem;
                margin-bottom: 1rem;
                line-height: 1.3;
                font-weight: 700;
            }

            .hero p {
                font-size: 1.05rem;
                margin-bottom: 2rem;
                opacity: 0.9;
                line-height: 1.5;
            }

            .hero-search-bar {
                flex-direction: column;
                padding: 1.5rem;
                gap: 1rem;
                border-radius: 24px;
                box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12);
                background: var(--card-background);
            }

            .search-icon-wrapper {
                position: absolute;
                top: 2rem;
                left: 2rem;
            }

            .search-icon {
                font-size: 1.5rem;
                color: var(--primary-color);
            }

            .hero-search-input {
                padding: 1.125rem 1.25rem 1.125rem 3.75rem;
                font-size: 1rem;
                border-radius: 16px;
                border: 2px solid transparent;
                background: var(--background);
                transition: all 0.3s ease;
            }

            .hero-search-input:focus {
                border-color: var(--primary-color);
                box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
            }

            .hero-search-btn {
                width: 100%;
                padding: 1.125rem 1.5rem;
                font-size: 1.05rem;
                border-radius: 0;
                font-weight: 600;
                box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
            }

            .hero-search-btn:active {
                transform: scale(0.98);
            }

            [data-theme="dark"] .hero-search-bar {
                background: rgba(42, 42, 42, 0.98);
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
                border: 1px solid rgba(255, 255, 255, 0.1);
            }

            [data-theme="dark"] .hero-search-input {
                background: rgba(30, 30, 30, 0.95);
                border: 1px solid rgba(255, 255, 255, 0.05);
                color: #ffffff;
            }
            
            [data-theme="dark"] .hero-search-input::placeholder {
                color: rgba(255, 255, 255, 0.4);
            }
            
            [data-theme="dark"] .hero-search-input:focus {
                border-color: #3498db;
                background: rgba(40, 40, 40, 0.98);
                box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
            }
            
            [data-theme="dark"] .search-icon {
                color: #3498db;
            }
            
            [data-theme="dark"] .hero-search-btn {
                background: linear-gradient(45deg, #e74c3c, #c0392b);
                box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
                color: white;
            }

            [data-theme="dark"] .hero-search-input:focus {
                border-color: var(--primary-color);
                background: rgba(255, 255, 255, 0.08);
            }

            .search-suggestions {
                flex-wrap: wrap;
                gap: 0.625rem;
                padding: 0.5rem 0;
                justify-content: center;
            }

            .suggestion-chip {
                font-size: 0.875rem;
                padding: 0.625rem 1.125rem;
                border-radius: 14px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
                background: var(--background);
            }

            .suggestion-chip:active {
                transform: scale(0.95);
            }

            [data-theme="dark"] .suggestion-chip {
                background: rgba(42, 42, 42, 0.95);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
                border: 1px solid rgba(255, 255, 255, 0.08);
                color: #ffffff;
            }
            
            [data-theme="dark"] .suggestion-chip:hover {
                background: rgba(52, 152, 219, 0.2);
                border-color: rgba(52, 152, 219, 0.3);
            }

            [data-theme="dark"] .suggestion-chip:hover {
                background: rgba(255, 255, 255, 0.1);
            }

            /* Content Area Mobile */
            .content-area {
                grid-template-columns: 1fr;
                gap: 1.5rem;
                padding-top: 1rem;
            }

            /* Mobile Post Ad Button */
            .mobile-post-ad {
                display: block !important;
                width: 100%;
                padding: 1rem;
                background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
                color: white;
                border: none;
                border-radius: 16px;
                font-size: 1rem;
                font-weight: 600;
                cursor: pointer;
                margin-bottom: 1rem;
                box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
                transition: all 0.3s ease;
            }

            .mobile-post-ad:active {
                transform: scale(0.98);
                background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
            }

            /* Mobile Filter Button */
            .mobile-filter-btn {
                display: block !important;
                width: 100%;
                padding: 1rem;
                background: var(--primary-gradient);
                color: white;
                border: none;
                border-radius: 16px;
                font-size: 1rem;
                font-weight: 600;
                cursor: pointer;
                margin-bottom: 1.5rem;
                box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
                transition: all 0.3s ease;
            }

            .mobile-filter-btn:active {
                transform: scale(0.98);
            }

            /* Full Screen Filter Overlay */
            .filter-overlay {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: var(--background);
                z-index: 9999;
                overflow-y: auto;
                transform: translateY(100%);
                transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
                visibility: hidden;
                opacity: 0;
            }

            .filter-overlay.active {
                transform: translateY(0);
                visibility: visible;
                opacity: 1;
            }

            .filter-overlay-header {
                position: sticky;
                top: 0;
                background: var(--card-background);
                padding: 1.25rem;
                border-bottom: 1px solid var(--border-color);
                display: flex;
                justify-content: space-between;
                align-items: center;
                z-index: 10;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            }

            .filter-overlay-title {
                font-size: 1.25rem;
                font-weight: 700;
                color: var(--text-color);
            }

            .filter-overlay-close {
                background: none;
                border: none;
                font-size: 1.75rem;
                color: var(--text-color);
                cursor: pointer;
                padding: 0.5rem;
                display: flex;
                align-items: center;
                justify-content: center;
                width: 40px;
                height: 40px;
                border-radius: 50%;
                transition: all 0.3s ease;
            }

            .filter-overlay-close:active {
                background: rgba(0, 0, 0, 0.05);
            }

            .filter-overlay-content {
                padding: 1.5rem;
            }

            .filter-overlay-footer {
                position: sticky;
                bottom: 0;
                background: var(--card-background);
                padding: 1.25rem;
                border-top: 1px solid var(--border-color);
                display: flex;
                gap: 1rem;
                box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
            }

            .filter-apply-btn,
            .filter-reset-btn {
                flex: 1;
                padding: 1rem;
                border: none;
                border-radius: 12px;
                font-size: 1rem;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.3s ease;
            }

            .filter-apply-btn {
                background: var(--primary-gradient);
                color: white;
            }

            .filter-apply-btn:active {
                transform: scale(0.98);
            }

            .filter-reset-btn {
                background: var(--card-background);
                color: var(--text-color);
                border: 2px solid var(--border-color);
            }

            .filter-reset-btn:active {
                background: rgba(0, 0, 0, 0.05);
            }

            /* Hide desktop sidebar on mobile, show overlay content instead */
            .sidebar {
                display: none;
            }

            /* Hide post-ad button inside mobile filter overlay */
            .filter-overlay .post-ad-btn {
                display: none !important;
            }

            [data-theme="dark"] .sidebar {
                background: rgba(30, 30, 30, 0.98);
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
                border: 1px solid rgba(255, 255, 255, 0.05);
            }

            .filter-group {
                margin-bottom: 1.25rem;
            }

            .filter-title {
                font-size: 1.05rem;
                margin-bottom: 0.75rem;
                font-weight: 600;
            }

            .filter-select,
            .filter-input {
                padding: 0.875rem 1rem;
                font-size: 0.95rem;
                border-radius: 12px;
            }

            .post-ad-btn {
                width: 100%;
                padding: 1rem 1.5rem;
                font-size: 1.05rem;
                border-radius: 16px;
                font-weight: 600;
            }

            /* Listings Grid Mobile */
            .listings-grid {
                grid-template-columns: 1fr;
                gap: 1.25rem;
            }

            .listing-card {
                display: grid;
                grid-template-columns: 130px 1fr;
                gap: 1rem;
                padding: 1rem;
                border-radius: 20px;
                background: white;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
            }
            
            [data-theme="dark"] .listing-card {
                background: rgba(30, 30, 30, 0.98);
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
                border: 1px solid rgba(255, 255, 255, 0.05);
            }

            .listing-image {
                height: 130px;
                width: 130px;
                border-radius: 16px;
            }

            .listing-content {
                padding: 0;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
            }

            .listing-title {
                font-size: 1rem;
                margin-bottom: 0.5rem;
                line-clamp: 2;
                -webkit-line-clamp: 2;
                font-weight: 600;
                line-height: 1.4;
            }

            .listing-price {
                font-size: 1.2rem;
                margin-bottom: 0.375rem;
                font-weight: 700;
            }

            .listing-location {
                font-size: 0.9rem;
                opacity: 0.8;
            }

            .listing-actions {
                display: none;
            }

            /* Make entire card clickable on mobile */
            .listing-card {
                cursor: pointer;
                transition: all 0.3s ease;
            }

            .listing-card:active {
                transform: scale(0.98);
            }

            [data-theme="dark"] .listing-card {
                background: var(--card-background);
                border-color: rgba(255, 255, 255, 0.1);
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            }

            [data-theme="dark"] .listing-card:hover {
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            }

            /* Featured Section Mobile */
            .featured-section {
                margin-bottom: 2rem;
                padding: 1.5rem 0;
            }

            .section-title {
                font-size: 1.75rem;
                margin-bottom: 1.5rem;
                font-weight: 700;
            }

            .carousel {
                gap: 1rem;
                padding: 0.5rem;
            }

            .featured-card {
                min-width: 280px;
                border-radius: 20px;
                background: white;
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            }

            [data-theme="dark"] .featured-card {
                background: rgba(30, 30, 30, 0.98);
                box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
                border: 1px solid rgba(255, 255, 255, 0.05);
            }

            [data-theme="dark"] .featured-card:hover {
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
                border-color: rgba(255, 255, 255, 0.1);
            }

            .card-image {
                height: 200px;
                border-radius: 20px 20px 0 0;
            }

            .card-content {
                padding: 1rem;
            }

            .card-title {
                font-size: 1rem;
                margin-bottom: 0.5rem;
                font-weight: 600;
            }

            .card-price {
                font-size: 1.25rem;
                font-weight: 700;
                margin-bottom: 0.375rem;
            }

            .card-location {
                font-size: 0.9rem;
            }

            /* Category Section Mobile */
            .category-list {
                gap: 0.75rem;
            }

            .category-item {
                padding: 0.875rem 1rem;
                font-size: 0.95rem;
                border-radius: 12px;
            }

            .subcategory-item {
                padding: 0.625rem 0.875rem 0.625rem 2rem;
                font-size: 0.9rem;
                border-radius: 10px;
            }

            .model-item {
                padding: 0.625rem 0.875rem 0.625rem 2.5rem;
                font-size: 0.9rem;
                border-radius: 10px;
            }

            /* Modal Mobile - Full Screen Redesign */
            .modal {
                padding: 0;
            }

            .modal-content {
                width: 100%;
                max-width: 100vw;
                height: 100vh;
                max-height: 100vh;
                margin: 0;
                border-radius: 0;
                display: flex;
                flex-direction: column;
                background: #ffffff;
            }
            
            [data-theme="dark"] .modal-content {
                background: #0f0f0f;
            }

            .modal-header {
                padding: 1rem 1.25rem;
                position: sticky;
                top: 0;
                background: #ffffff;
                z-index: 10;
                border-radius: 0;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
                flex-shrink: 0;
            }
            
            [data-theme="dark"] .modal-header {
                background: #1a1a1a;
                border-bottom: 1px solid rgba(255, 255, 255, 0.08);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
            }

            .modal-body {
                padding: 0;
                flex: 1;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            /* Listing Modal Content Layout */
            #listingModal .modal-body {
                display: flex;
                flex-direction: column;
            }

            /* Listing Image - Full Width & More Viewable */
            #listingModal .listing-image {
                width: 100%;
                height: 600px;
                border-radius: 0;
                object-fit: cover;
                background: #000;
            }
            
            [data-theme="dark"] #listingModal .listing-image {
                background: #1a1a1a;
            }

            /* Listing Details Section */
            #listingModal .listing-details {
                padding: 1.25rem;
            }

            #listingModal .listing-title {
                font-size: 1.5rem;
                font-weight: 700;
                margin-bottom: 1rem;
                line-height: 1.3;
            }

            #listingModal .listing-price {
                font-size: 1.75rem;
                font-weight: 800;
                color: var(--primary-color);
                margin-bottom: 1rem;
            }

            #listingModal .listing-meta {
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
                margin-bottom: 1.5rem;
                padding: 1rem;
                background: rgba(102, 126, 234, 0.05);
                border-radius: 16px;
            }
            
            [data-theme="dark"] #listingModal .listing-meta {
                background: rgba(52, 152, 219, 0.1);
                border: 1px solid rgba(52, 152, 219, 0.2);
            }

            #listingModal .meta-item {
                display: flex;
                align-items: center;
                gap: 0.75rem;
                font-size: 0.95rem;
            }

            #listingModal .meta-icon {
                font-size: 1.25rem;
                color: var(--primary-color);
            }

            #listingModal .listing-description {
                font-size: 1rem;
                line-height: 1.6;
                margin-bottom: 1.5rem;
                color: var(--text-color);
            }

            /* Action Buttons Fixed at Bottom */
            #listingModal .modal-actions {
                position: sticky;
                bottom: 0;
                left: 0;
                right: 0;
                background: #ffffff;
                padding: 1rem 1.25rem;
                box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
                z-index: 10;
            }
            
            [data-theme="dark"] #listingModal .modal-actions {
                background: #1a1a1a;
                border-top: 1px solid rgba(255, 255, 255, 0.08);
                box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.5);
            }

            #listingModal .modal-actions .message-seller-btn,
            #listingModal .modal-actions .share-listing-btn {
                width: 100%;
                padding: 1rem;
                font-size: 1rem;
                border-radius: 14px;
                font-weight: 600;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 0.5rem;
            }

            .close-btn {
                width: 40px;
                height: 40px;
                font-size: 1.5rem;
                background: rgba(0, 0, 0, 0.1);
                border-radius: 12px;
            }

            [data-theme="dark"] .close-btn {
                background: rgba(255, 255, 255, 0.1);
                color: var(--text-color);
            }

            [data-theme="dark"] .close-btn:hover {
                background: rgba(255, 255, 255, 0.2);
            }

            [data-theme="dark"] .modal-header {
                background: var(--card-background);
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }

            [data-theme="dark"] .modal-actions {
                background: var(--card-background);
                border-top: 1px solid rgba(255, 255, 255, 0.1);
            }

            /* Chat Modal Mobile */
            .chat-modal-content {
                width: 100vw;
                height: 100vh;
                max-height: 100vh;
                border-radius: 0;
                margin: 0;
            }

            .chat-header {
                padding: 1rem;
            }

            .chat-messages {
                height: calc(100vh - 140px);
                padding: 1rem;
            }

            .message-bubble {
                max-width: 85%;
                padding: 0.75rem 1rem;
                font-size: 0.95rem;
            }

            .chat-input-container {
                padding: 0.875rem 1rem;
            }

            .chat-input {
                padding: 0.75rem 1rem;
                font-size: 0.95rem;
            }

            .chat-send-btn {
                width: 40px;
                height: 40px;
            }

            /* Floating Action Button */
            .fab {
                width: 60px;
                height: 60px;
                font-size: 1.5rem;
                bottom: 24px;
                right: 24px;
                box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
            }

            /* Safety Banner Mobile */
            .safety-banner {
                padding: 0.75rem 1rem;
                font-size: 0.85rem;
            }

            /* User Menu Mobile */
            .user-menu {
                position: fixed;
                top: auto;
                right: 0;
                left: 0;
                bottom: 0;
                width: 100%;
                max-width: none;
                margin: 0;
                border-radius: 24px 24px 0 0;
                box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
                max-height: 85vh;
                overflow-y: auto;
            }

            .menu-item {
                padding: 1rem 1.5rem;
                font-size: 1rem;
            }

            .menu-icon {
                width: 24px;
                height: 24px;
                font-size: 1.25rem;
            }

            .menu-text {
                font-size: 1rem;
            }

            .menu-divider {
                margin: 0.5rem 0;
            }

            [data-theme="dark"] .user-menu {
                background: var(--card-background);
                box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.5);
            }

            [data-theme="dark"] .menu-item:hover {
                background: rgba(255, 255, 255, 0.05);
            }
        }

        @media (max-width: 480px) {
            /* Extra Small Mobile Adjustments */
            .container {
                padding: 0 1rem;
            }

            .hero {
                padding: 2rem 0 2.5rem;
            }

            .hero h1 {
                font-size: 1.875rem;
                margin-bottom: 0.875rem;
            }

            .hero p {
                font-size: 0.95rem;
                margin-bottom: 1.75rem;
            }

            .hero-search-bar {
                padding: 1.25rem;
                border-radius: 20px;
            }

            .search-icon-wrapper {
                top: 1.75rem;
                left: 1.75rem;
            }

            .hero-search-input {
                padding: 1rem 1rem 1rem 3.5rem;
                font-size: 0.95rem;
            }

            .hero-search-btn {
                padding: 1rem 1.25rem;
                font-size: 1rem;
            }

            .suggestion-chip {
                font-size: 0.8rem;
                padding: 0.5rem 1rem;
            }

            .featured-card {
                min-width: 260px;
            }

            .card-image {
                height: 180px;
            }

            .listing-card {
                grid-template-columns: 110px 1fr;
                gap: 0.875rem;
                padding: 0.875rem;
            }

            .listing-image {
                height: 110px;
                width: 110px;
                border-radius: 14px;
            }

            .listing-title {
                font-size: 0.95rem;
            }

            .listing-price {
                font-size: 1.1rem;
            }

            .listing-location {
                font-size: 0.85rem;
            }

            .listing-actions {
                display: none;
            }

            /* Modal actions stay the same */
            #listingModal .modal-actions {
                padding: 1rem;
                gap: 0.625rem;
            }

            #listingModal .modal-actions .message-seller-btn,
            #listingModal .modal-actions .share-listing-btn {
                padding: 0.875rem;
                font-size: 0.95rem;
            }

            .card-title {
                font-size: 0.95rem;
            }

            .modal-content {
                width: 100%;
                height: 100%;
                max-height: 100vh;
                border-radius: 0;
                margin: 0;
            }
        }

        @media (max-width: 768px) {
            /* File Upload Mobile */
            .file-upload-area {
                margin: 0.5rem 0.75rem;
            }

            .file-drop-zone {
                padding: 1.5rem 1rem;
                min-height: 100px;
                margin: 0.75rem;
            }

            .upload-icon {
                font-size: 2rem;
            }

            .upload-text {
                font-size: 1rem;
            }

            .upload-hint {
                font-size: 0.8rem;
            }

            .file-preview-item {
                min-width: 100%;
                max-width: 100%;
            }

            .file-preview-container {
                padding: 0.75rem;
                max-height: 120px;
            }

            /* Media Upload Dropdown Mobile */
            .media-upload-dropdown {
                width: calc(100% - 2rem);
                left: 1rem;
                right: 1rem;
            }

            .media-upload-option {
                padding: 0.875rem 1rem;
                font-size: 0.95rem;
            }

            /* Media Preview Mobile */
            .media-preview-container {
                padding: 0.75rem;
                gap: 0.5rem;
            }

            .media-preview-item {
                width: 80px;
                height: 80px;
            }

            /* Voice Recording Mobile */
            .voice-recording-container {
                padding: 0.875rem 1rem;
            }

            .recording-btn {
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
            }
        }

        /* Floating Action Button */
        .fab {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            width: 60px;
            height: 60px;
            background: var(--accent-gradient);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            box-shadow: 0 8px 25px var(--shadow-hover);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .fab:hover {
            transform: scale(1.1);
            box-shadow: 0 12px 35px var(--shadow-hover);
        }

        /* Additional Filter Styles */
        .price-range-container {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .price-inputs {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .price-inputs .filter-input {
            flex: 1;
            margin-bottom: 0;
        }

        .price-separator {
            color: var(--text-secondary);
            font-weight: bold;
        }

        .apply-filter-btn {
            display: none !important; /* Hide apply button - filters apply in real-time */
        }

        .condition-filter {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .condition-option {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.5rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .condition-option:hover {
            background: rgba(102, 126, 234, 0.1);
        }

        .condition-option input[type="checkbox"] {
            margin: 0;
            accent-color: var(--primary-color);
        }

        .reset-filters-btn {
            width: 100%;
            background: var(--border-color);
            color: var(--text-color);
            border: none;
            padding: 0.8rem;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            margin-top: 1rem;
        }

        .reset-filters-btn:hover {
            background: var(--primary-color);
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .category-item.active {
            background: var(--primary-color);
            color: white;
            transform: translateX(5px);
        }

        /* Inbox Page Styles - Complete Facebook Marketplace Style */
        .inbox-page {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: var(--background);
            z-index: 2000;
            overflow: hidden;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .inbox-header {
            background: var(--card-background);
            padding: 1rem 0;
            box-shadow: 0 1px 10px var(--shadow);
            position: sticky;
            top: 0;
            z-index: 10;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
            min-height: 70px;
        }

        .inbox-title {
            font-size: 1.8rem;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: space-between;
        }

        /* Enhanced Back Button Design */
        .inbox-back-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.8rem 1.2rem;
            border-radius: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 1rem;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 4px 15px var(--shadow);
            position: relative;
            overflow: hidden;
            min-width: 100px;
        }

        .inbox-back-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
            z-index: 0;
        }

        .inbox-back-btn:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .inbox-back-btn:hover::before {
            left: 100%;
        }

        .inbox-back-btn span {
            position: relative;
            z-index: 1;
        }

        .inbox-stats {
            display: flex;
            gap: 1.5rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
            align-items: center;
        }

        .inbox-content {
            height: calc(100vh - 90px);
            overflow: hidden;
        }

        .inbox-container {
            display: grid;
            grid-template-columns: 350px 1fr;
            height: 100%;
            background: var(--card-background);
            margin: 0;
            border-radius: 0;
            overflow: hidden;
            box-shadow: none;
            border: none;
        }

        /* Conversations Sidebar */
        .conversations-sidebar {
            border-right: 2px solid var(--border-color);
            background: var(--card-background);
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .conversations-header {
            padding: 1.2rem 1.5rem;
            border-bottom: 2px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--primary-gradient);
            color: white;
            flex-shrink: 0;
            gap: 1rem;
        }

        .mobile-back-btn {
            display: none;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .mobile-back-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateX(-3px);
        }

        .mobile-back-btn:active {
            transform: scale(0.95);
        }

        .mobile-back-btn svg {
            display: block;
        }

        .conversations-header h3 {
            font-size: 1.2rem;
            font-weight: 600;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .conversations-header-actions {
            display: flex;
            gap: 0.5rem;
        }

        .conversation-action-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .conversation-action-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        /* Conversation Search Styles */
        .conversation-search {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--card-background);
            animation: slideDown 0.3s ease;
        }

        .search-input-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        .conversation-search-input {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid var(--border-color);
            border-radius: 20px;
            background: var(--background);
            color: var(--text-color);
            font-size: 0.9rem;
            outline: none;
            transition: all 0.3s ease;
            padding-right: 40px;
        }

        .conversation-search-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        [data-theme="dark"] .conversation-search-input {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .conversation-search-input:focus {
            background: var(--input-focus-background);
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .conversation-search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .search-clear-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: var(--accent-color);
            color: white;
            border: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        .search-clear-btn:hover {
            background: #c0392b;
            transform: translateY(-50%) scale(1.1);
        }

        /* Conversation Filters Styles */
        .conversation-filters {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--card-background);
            animation: slideDown 0.3s ease;
        }

        .filter-tabs {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .filter-tab {
            background: var(--background);
            color: var(--text-color);
            border: 2px solid var(--border-color);
            padding: 0.6rem 1rem;
            border-radius: 15px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .filter-tab:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            transform: translateY(-2px);
        }

        .filter-tab.active {
            background: var(--primary-gradient);
            color: white;
            border-color: var(--primary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px var(--shadow);
        }

        [data-theme="dark"] .filter-tab {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .filter-tab:hover {
            background: var(--hover-background);
            color: var(--primary-color);
        }

        [data-theme="dark"] .filter-tab.active {
            background: var(--primary-gradient);
            color: white;
        }

        .conversation-count {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border-radius: 12px;
            padding: 0.2rem 0.6rem;
            font-size: 0.8rem;
            font-weight: 700;
            min-width: 24px;
            text-align: center;
        }

        .conversations-list {
            flex: 1;
            overflow-y: auto;
            padding: 0;
            /* Ensure it stretches to fill available space */
            min-height: 0;
        }

        /* Custom scrollbar for conversations list */
        .conversations-list::-webkit-scrollbar {
            width: 6px;
        }

        .conversations-list::-webkit-scrollbar-track {
            background: var(--border-color);
            border-radius: 3px;
        }

        .conversations-list::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 3px;
        }

        .conversations-list::-webkit-scrollbar-thumb:hover {
            background: var(--accent-color);
        }

        .conversation-item {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 1rem;
            position: relative;
            background: var(--card-background);
        }

        .conversation-item:last-child {
            border-bottom: none;
        }

        .conversation-item:hover {
            background: var(--hover-background, rgba(52, 152, 219, 0.05));
            transform: translateX(5px);
        }

        .conversation-item.active {
            background: var(--primary-gradient);
            color: white;
            transform: translateX(5px);
        }

        .conversation-item.active .conversation-name,
        .conversation-item.active .conversation-preview,
        .conversation-item.active .conversation-time {
            color: white;
        }

        .conversation-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1.1rem;
            flex-shrink: 0;
            border: 2px solid var(--border-color);
            overflow: hidden;
        }

        .conversation-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .conversation-item.active .conversation-avatar {
            border-color: white;
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
        }

        .conversation-details {
            flex: 1;
            min-width: 0;
        }

        .conversation-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.3rem;
        }

        .conversation-name {
            font-weight: 600;
            font-size: 1rem;
            color: var(--text-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .conversation-time {
            font-size: 0.8rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .conversation-preview {
            font-size: 0.9rem;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
        }

        /* Block user button */
        .conversation-actions {
            position: absolute;
            top: 50%;
            right: 1rem;
            transform: translateY(-50%);
            opacity: 0;
            transition: opacity 0.3s ease;
            display: flex;
            gap: 0.5rem;
        }

        .conversation-item:hover .conversation-actions {
            opacity: 1;
        }

        .block-user-btn {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.2);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
            white-space: nowrap;
        }

        .block-user-btn:hover {
            background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
        }

        .block-user-btn.blocked {
            background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
            box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
        }

        .block-user-btn.blocked:hover {
            background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
            box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
        }

        .conversation-item.blocked {
            opacity: 0.7;
            background: rgba(231, 76, 60, 0.08);
            border-left: 3px solid rgba(231, 76, 60, 0.3);
        }

        .conversation-item.blocked:hover {
            background: rgba(231, 76, 60, 0.12);
        }

        .conversation-item.archived {
            opacity: 0.8;
            background: rgba(149, 165, 166, 0.1);
            border-left: 3px solid rgba(149, 165, 166, 0.3);
        }

        .blocked-avatar {
            opacity: 0.6;
            filter: grayscale(50%);
        }

        .blocked-name {
            color: var(--text-secondary) !important;
        }

        .blocked-preview {
            font-style: italic;
            color: var(--accent-color) !important;
            font-size: 0.85rem;
        }

        .status-indicator {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            margin-left: 6px;
            font-size: 10px;
        }

        .blocked-indicator {
            background: rgba(231, 76, 60, 0.15);
            color: var(--accent-color);
        }

        .archived-indicator {
            background: rgba(149, 165, 166, 0.15);
            color: var(--text-secondary);
        }

        .empty-conversations {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            padding: 2rem;
            text-align: center;
            color: var(--text-secondary);
        }

        .empty-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            opacity: 0.6;
        }

        .empty-conversations h4 {
            color: var(--text-color);
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
        }

        .empty-conversations p {
            line-height: 1.5;
            max-width: 250px;
        }

        .empty-hint {
            margin-top: 1rem !important;
            padding: 0.75rem 1rem;
            background: var(--primary-gradient);
            color: white !important;
            border-radius: 12px;
            font-weight: 500;
            font-size: 0.9rem;
            max-width: 280px !important;
        }

        /* Chat Area */
        .chat-area {
            display: flex;
            flex-direction: column;
            height: 100vh;
            background: var(--background);
            position: relative;
        }

        .chat-welcome {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            background: var(--card-background);
        }

        .welcome-content {
            text-align: center;
            color: var(--text-secondary);
            max-width: 400px;
            padding: 2rem;
        }

        .welcome-icon {
            font-size: 4rem;
            margin-bottom: 1.5rem;
            opacity: 0.7;
        }

        .welcome-content h3 {
            color: var(--text-color);
            margin-bottom: 1rem;
            font-size: 1.4rem;
        }

        .welcome-content p {
            line-height: 1.6;
            font-size: 1rem;
        }

        .active-chat {
            display: none;
            flex-direction: column;
            height: 100vh;
            position: relative;
        }

        .active-chat-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--card-background);
            position: sticky;
            top: 0;
            z-index: 10;
            flex-shrink: 0;
            min-height: 70px;
        }

        .chat-participant-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .participant-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1.3rem;
            border: 2px solid var(--border-color);
            overflow: hidden;
        }

        .participant-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .participant-details {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }

        .participant-name {
            font-weight: 600;
            font-size: 1.1rem;
            color: var(--text-color);
        }

        .participant-status {
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .chat-actions {
            display: flex;
            gap: 0.5rem;
        }

        .chat-action-btn {
            background: var(--card-background);
            color: var(--text-color);
            border: 2px solid var(--border-color);
            width: 40px;
            height: 40px;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: hidden;
            box-shadow: 0 2px 8px var(--shadow);
        }
        
        .chat-action-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
            z-index: 0;
        }

        .chat-action-btn:hover {
            transform: translateY(-2px) scale(1.05);
            box-shadow: 0 6px 20px var(--shadow-hover);
            border-color: var(--primary-color);
        }
        
        .chat-action-btn:hover::before {
            left: 100%;
        }
        
        .chat-action-btn > * {
            position: relative;
            z-index: 1;
        }

        .chat-action-btn.block-btn {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
            color: white;
            border-color: #c0392b;
        }

        .chat-action-btn.block-btn:hover {
            background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
            border-color: #a93226;
            box-shadow: 0 6px 20px rgba(192, 57, 43, 0.4);
        }
        
        .chat-action-btn.unblock-btn {
            background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
            color: white;
            border-color: #229954;
        }
        
        .chat-action-btn.unblock-btn:hover {
            background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
            border-color: #1e8449;
            box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
        }
        
        .chat-action-btn.archive-btn {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
            color: white;
            border-color: #e67e22;
        }
        
        .chat-action-btn.archive-btn:hover {
            background: linear-gradient(135deg, #e67e22 0%, #d68910 100%);
            border-color: #d68910;
            box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
        }
        
        .chat-action-btn.info-btn {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            color: white;
            border-color: #2980b9;
        }
        
        .chat-action-btn.info-btn:hover {
            background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
            border-color: #21618c;
            box-shadow: 0 6px 20px rgba(41, 128, 185, 0.4);
        }

        /* User Info Panel Overlay */
        .user-info-panel {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--card-background);
            z-index: 1000;
            display: none;
            flex-direction: column;
            animation: slideInRight 0.3s ease;
        }

        .user-info-panel.show {
            display: flex;
        }

        .user-info-header {
            display: flex;
            align-items: center;
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--primary-gradient);
            color: white;
        }

        .user-info-close {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-right: 1rem;
            transition: all 0.3s ease;
        }

        .user-info-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: rotate(90deg);
        }

        .user-info-title {
            font-size: 1.2rem;
            font-weight: 600;
        }

        .user-info-content {
            flex: 1;
            overflow-y: auto;
            padding: 2rem;
        }

        .user-info-avatar-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 2rem;
            padding: 2rem;
            background: var(--background-color);
            border-radius: 15px;
        }

        .user-info-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--primary-gradient);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            font-weight: 600;
            margin-bottom: 1rem;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .user-info-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .user-info-name {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.5rem;
        }

        .user-info-meta {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        /* User Actions Section */
        .user-actions-section {
            margin-top: 1.5rem;
            border-top: 1px solid var(--border-color);
            padding-top: 1.5rem;
        }

        .user-action-item {
            display: flex;
            align-items: center;
            padding: 1rem;
            margin-bottom: 0.8rem;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            background: var(--card-background);
        }

        .user-action-item:hover {
            background: rgba(52, 152, 219, 0.05);
            border-color: rgba(52, 152, 219, 0.2);
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .action-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 1rem;
            font-size: 1.3rem;
            transition: all 0.3s ease;
        }

        .block-icon {
            background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
            color: var(--accent-color);
        }

        .archive-icon {
            background: linear-gradient(135deg, rgba(241, 196, 15, 0.1) 0%, rgba(230, 126, 34, 0.1) 100%);
            color: #f39c12;
        }

        .action-content {
            flex: 1;
        }

        .action-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.3rem;
            transition: all 0.3s ease;
        }

        .action-description {
            font-size: 0.85rem;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Block action states */
        .user-action-item.block-action:hover .action-title {
            color: var(--accent-color);
        }

        .user-action-item.block-action.blocked {
            background: rgba(39, 174, 96, 0.05);
            border-color: rgba(39, 174, 96, 0.2);
        }

        .user-action-item.block-action.blocked .block-icon {
            background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(34, 153, 84, 0.1) 100%);
            color: #27ae60;
        }

        .user-action-item.block-action.blocked:hover .action-title {
            color: #27ae60;
        }

        /* Archive action states */
        .user-action-item.archive-action:hover .action-title {
            color: #f39c12;
        }

        .user-action-item.archive-action.archived {
            background: rgba(149, 165, 166, 0.05);
            border-color: rgba(149, 165, 166, 0.2);
        }

        .user-action-item.archive-action.archived .archive-icon {
            background: linear-gradient(135deg, rgba(149, 165, 166, 0.1) 0%, rgba(127, 140, 141, 0.1) 100%);
            color: #95a5a6;
        }

        .user-action-item.archive-action.archived:hover .action-title {
            color: #95a5a6;
        }

        /* Responsive adjustments for user info panel */
        @media (max-width: 768px) {
            .user-info-panel {
                left: 0;
                right: 0;
            }
            
            .user-info-content {
                padding: 1.5rem;
            }
            
            .user-info-avatar-section {
                padding: 1.5rem;
            }
            
            .user-info-avatar {
                width: 100px;
                height: 100px;
                font-size: 2.5rem;
            }
            
            .user-action-item {
                padding: 0.8rem;
            }
            
            .action-icon {
                width: 40px;
                height: 40px;
                font-size: 1.1rem;
            }
        }

        .user-info-details {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .user-info-item {
            display: flex;
            align-items: center;
            padding: 1rem;
            background: var(--background-color);
            border-radius: 10px;
            gap: 1rem;
        }

        .user-info-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary-gradient);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .user-info-label {
            flex: 1;
        }

        .user-info-label strong {
            display: block;
            color: var(--text-color);
            margin-bottom: 0.25rem;
        }

        .user-info-label span {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        /* Messages Container */
        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            padding-bottom: 200px;
            /* Space for fixed input area */
            background: var(--background);
            position: relative;
            height: calc(100vh - 140px);
            min-height: 0;
            scroll-behavior: smooth;
        }

        /* Enhanced scrollbar for messages */
        .messages-container::-webkit-scrollbar {
            width: 8px;
        }

        .messages-container::-webkit-scrollbar-track {
            background: var(--border-color);
            border-radius: 4px;
        }

        .messages-container::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        .messages-container::-webkit-scrollbar-thumb:hover {
            background: var(--accent-color);
        }

        .messages-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-secondary);
        }

        .messages-loading .loading-spinner {
            width: 30px;
            height: 30px;
            margin-bottom: 1rem;
        }

        .message {
            margin-bottom: 1rem;
            display: flex;
            gap: 0.5rem;
            animation: messageSlideIn 0.3s ease;
        }

        .message.own {
            justify-content: flex-end;
        }

        .message.own .message-bubble {
            background: var(--primary-gradient);
            color: white;
            border-radius: 20px 20px 5px 20px;
        }

        .message:not(.own) .message-bubble {
            background: var(--card-background);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 20px 20px 20px 5px;
        }

        .message-bubble {
            max-width: 75%;
            padding: 1rem 1.3rem;
            word-wrap: break-word;
            box-shadow: 0 2px 10px var(--shadow);
            position: relative;
            line-height: 1.4;
        }

        /* Message actions (delete button) */
        .message-actions {
            position: absolute;
            top: 4px;
            right: 4px;
            opacity: 0;
            transition: opacity 0.2s ease;
            z-index: 10;
        }

        .message:hover .message-actions {
            opacity: 1;
        }

        .delete-message-btn {
            background: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: bold;
            line-height: 1;
            transition: all 0.2s ease;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            padding: 0;
        }

        .delete-message-btn:hover {
            background: rgba(231, 76, 60, 0.95);
            transform: scale(1.15);
            box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
        }

        .message-deleted {
            opacity: 0.5;
            font-style: italic;
        }

        .message-deleted .message-bubble {
            background: repeating-linear-gradient(
                45deg,
                var(--card-background),
                var(--card-background) 10px,
                rgba(0, 0, 0, 0.05) 10px,
                rgba(0, 0, 0, 0.05) 20px
            );
        }

        .message-time {
            font-size: 0.75rem;
            opacity: 0.7;
            margin-top: 0.4rem;
            text-align: right;
        }

        .message.own .message-time {
            text-align: left;
        }

        /* Date Separator Styles */
        .date-separator {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 1.5rem 0;
            position: relative;
        }

        .date-separator::before,
        .date-separator::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border-color);
        }

        .date-separator-text {
            background: var(--card-background);
            color: var(--text-secondary);
            padding: 0.5rem 1rem;
            margin: 0 1rem;
            border-radius: 15px;
            font-size: 0.8rem;
            font-weight: 500;
            border: 1px solid var(--border-color);
            white-space: nowrap;
            box-shadow: 0 2px 8px var(--shadow);
            position: relative;
            z-index: 1;
        }

        .date-separator-text.today {
            background: var(--primary-gradient);
            color: white;
            border-color: var(--primary-color);
        }

        .date-separator-text.yesterday {
            background: var(--accent-gradient);
            color: white;
            border-color: var(--accent-color);
        }
        
        .date-separator-text.this-week {
            background: linear-gradient(45deg, #9b59b6, #8e44ad);
            color: white;
            border-color: #9b59b6;
        }

        @keyframes messageSlideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Message Input Area */
        .message-input-area {
            padding: 0.8rem 1rem;
            background: var(--card-background);
            border-top: 1px solid var(--border-color);
            position: fixed;
            bottom: 0;
            left: 350px;
            right: 0;
            z-index: 1000;
            flex-shrink: 0;
            min-height: 70px;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        }

        .input-container {
            display: flex;
            align-items: flex-end;
            gap: 0.8rem;
            background: var(--background);
            border-radius: 20px;
            padding: 0.4rem;
            border: 2px solid var(--border-color);
            transition: all 0.3s ease;
            max-height: 100px;
        }

        .input-container:focus-within {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        .message-input-wrapper {
            display: flex;
            align-items: flex-end;
            gap: 0.8rem;
            background: var(--background);
            border-radius: 25px;
            padding: 0.5rem;
            border: 2px solid var(--border-color);
            transition: all 0.3s ease;
        }

        .message-input-wrapper:focus-within {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        .attachment-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            flex-shrink: 0;
            position: relative;
        }

        .attachment-btn:hover {
            background: var(--border-color);
            color: var(--text-color);
            transform: scale(1.1);
        }

        /* Media upload dropdown */
        .media-upload-dropdown {
            position: absolute;
            bottom: 110%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--card-background);
            border: 2px solid var(--border-color);
            border-radius: 12px;
            padding: 0.5rem;
            display: none;
            flex-direction: column;
            gap: 0.5rem;
            box-shadow: 0 8px 25px var(--shadow-hover);
            z-index: 1000;
            min-width: 200px;
            backdrop-filter: blur(10px);
        }

        .media-upload-dropdown.show {
            display: flex;
            animation: slideUpFade 0.3s ease;
        }

        .media-upload-option {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.8rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
            background: transparent;
            color: var(--text-color);
            font-size: 0.9rem;
            width: 100%;
            text-align: left;
        }

        .media-upload-option:hover {
            background: var(--primary-color);
            color: white;
            transform: translateX(5px);
        }

        .media-upload-option .icon {
            font-size: 1.2rem;
            width: 20px;
            flex-shrink: 0;
        }

        /* Media preview area */
        .media-preview-container {
            display: none;
            max-height: 120px;
            overflow-x: auto;
            padding: 0.8rem;
            background: var(--background);
            border-top: 1px solid var(--border-color);
            gap: 0.8rem;
        }

        .media-preview-container.show {
            display: flex;
        }

        .media-preview-item {
            position: relative;
            flex-shrink: 0;
            border-radius: 8px;
            overflow: hidden;
            background: var(--card-background);
            border: 2px solid var(--border-color);
        }

        .media-preview-item img,
        .media-preview-item video {
            width: 80px;
            height: 80px;
            object-fit: cover;
            display: block;
        }

        .media-preview-item .file-preview {
            width: 80px;
            height: 80px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0.5rem;
            background: var(--primary-gradient);
            color: white;
            font-size: 0.7rem;
            text-align: center;
        }

        .media-preview-item .file-preview .file-icon {
            font-size: 1.5rem;
            margin-bottom: 0.2rem;
        }

        .media-preview-item .file-preview .file-name {
            font-size: 0.6rem;
            word-break: break-all;
            max-lines: 2;
            overflow: hidden;
        }

        .media-remove-btn {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--accent-color);
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px var(--shadow);
        }

        .media-remove-btn:hover {
            transform: scale(1.1);
            background: #c0392b;
        }

        /* Voice recording styles */
        .voice-recording-container {
            display: none;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: var(--accent-gradient);
            color: white;
            border-radius: 20px;
            margin: 0.5rem;
            animation: pulse 2s ease-in-out infinite;
        }

        .voice-recording-container.show {
            display: flex;
        }

        .voice-recording-indicator {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex: 1;
        }

        .recording-dot {
            width: 12px;
            height: 12px;
            background: white;
            border-radius: 50%;
            animation: pulse 1s ease-in-out infinite;
        }

        .recording-time {
            font-weight: 600;
            font-size: 1rem;
        }

        .recording-actions {
            display: flex;
            gap: 0.5rem;
        }

        .recording-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .recording-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .recording-btn.stop {
            background: rgba(255, 255, 255, 0.9);
            color: var(--accent-color);
        }

        /* Hidden file inputs */
        .hidden-file-input {
            display: none;
        }

        @keyframes slideUpFade {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        .message-input {
            flex: 1;
            border: none;
            background: transparent;
            color: var(--text-color);
            font-size: 0.95rem;
            line-height: 1.3;
            resize: none;
            outline: none;
            min-height: 44px;
            max-height: 144px;
            /* 6 lines * 24px line height */
            padding: 10px 12px;
            font-family: inherit;
            border-radius: 18px;
            transition: all 0.3s ease;
            overflow-y: auto;
            width: 100%;
        }

        .message-input:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            background: var(--border-color);
        }

        .message-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        [data-theme="dark"] .message-input {
            background: transparent;
        }

        [data-theme="dark"] .message-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.9;
        }

        .send-message-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            flex-shrink: 0;
            box-shadow: 0 2px 8px var(--shadow);
            margin-left: 0.3rem;
        }

        .send-message-btn:hover:not(:disabled) {
            transform: scale(1.1);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .send-message-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: var(--border-color);
            transform: none;
            box-shadow: 0 2px 6px var(--shadow);
        }

        .input-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 0.5rem;
            padding: 0 1rem;
        }

        .character-count {
            font-size: 0.8rem;
            color: var(--text-secondary);
            user-select: none;
        }

        .input-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 0.5rem;
            padding: 0 0.5rem;
        }

        .character-count {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .typing-indicator {
            font-size: 0.8rem;
            color: var(--primary-color);
            font-style: italic;
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .typing-indicator::before {
            content: '💭';
            animation: pulse 1.5s ease-in-out infinite;
        }

        /* Responsive Design for Inbox */
        @media (max-width: 768px) {
            .inbox-container {
                grid-template-columns: 1fr;
                margin: 0;
                height: 100vh;
                overflow: hidden;
            }

            /* Ensure smooth scrolling on mobile */
            .messages-container {
                -webkit-overflow-scrolling: touch;
                scroll-behavior: smooth;
            }

            .conversations-list {
                -webkit-overflow-scrolling: touch;
                scroll-behavior: smooth;
            }

            .conversations-sidebar {
                display: none;
            }

            .inbox-container.show-conversations .conversations-sidebar {
                display: flex;
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100vh;
                z-index: 100;
                border-right: none;
            }

            .inbox-container.show-conversations .chat-area {
                display: none;
            }

            .mobile-conversations-toggle,
            .mobile-welcome-toggle {
                display: flex !important;
            }

            .mobile-back-btn {
                display: flex !important;
                width: 40px;
                height: 40px;
                border-radius: 50%;
                align-items: center;
                justify-content: center;
                background: var(--hover-background);
                border: none;
                color: var(--text-color);
                cursor: pointer;
                transition: all 0.3s ease;
            }

            .mobile-back-btn:hover,
            .mobile-back-btn:active {
                background: var(--border-color);
                transform: scale(0.95);
            }

            .conversations-header h3 {
                flex: 1;
                font-size: 1.1rem;
            }

            /* Mobile conversation search */
            .conversation-search {
                margin: 0.5rem 1rem;
            }

            .conversation-search input {
                padding: 0.8rem 1rem;
                font-size: 0.9rem;
                border-radius: 20px;
            }

            /* Mobile conversation list improvements */
            .conversations-list {
                padding: 0;
            }

        /* Better mobile interaction feedback */
        .message-bubble:active {
            transform: scale(0.98);
            transition: transform 0.1s ease;
        }

        .send-message-btn:active {
            transform: scale(0.95);
        }

        .attachment-btn:active {
            transform: scale(0.95);
        }

        /* Prevent zoom on double tap for input fields */
        .message-input {
            font-size: 16px; /* Prevents zoom on iOS */
        }

        /* Loading spinner optimizations */
        .conversations-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100px;
            color: var(--text-secondary);
            gap: 0.5rem;
        }

        .loading-spinner-small {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-color);
            border-top: 2px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Simple Last Message Status */
        .last-message-status {
            font-size: 0.7rem;
            margin-top: 0.25rem;
            margin-bottom: 0.5rem;
            font-weight: 500;
            opacity: 0.95;
            display: flex; /* use flex so we can align the status relative to the message */
            width: 100%;
            gap: 0.5rem;
            box-sizing: border-box;
        }

        /* Align status to the right for own messages, left for others */
        .message.own + .last-message-status {
            justify-content: flex-end; /* visually right inside LTR container */
            text-align: right;
            padding-right: 1rem;
        }

        .message:not(.own) + .last-message-status {
            justify-content: flex-start; /* visually left */
            text-align: left;
            padding-left: 1rem;
        }

        .last-message-status.delivered {
            color: var(--text-secondary);
        }

        .last-message-status.seen {
            color: var(--primary-color);
        }

        /* Online Status Indicators */
        .online-indicator {
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid var(--card-background);
            transition: all 0.3s ease;
        }

        .online-indicator.online {
            background: #4ade80;
            box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
        }

        .online-indicator.offline {
            background: #9ca3af;
        }

        /* Conversation avatar positioning */
        .conversation-avatar {
            position: relative;
        }

        /* Chat header status indicators */
        .chat-user-status {
            font-size: 0.8rem;
            margin-top: 0.2rem;
            font-weight: 500;
        }

        .chat-user-status.online {
            color: #4ade80;
        }

        .chat-user-status.offline {
            color: var(--text-secondary);
        }

        /* Participant status styling */
        .participant-status {
            font-size: 0.8rem;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .participant-status.online {
            color: #4ade80;
        }

        .participant-status.offline {
            color: var(--text-secondary);
        }

        /* Mobile responsive adjustments for status indicators */
        @media (max-width: 768px) {
            .last-message-status {
                font-size: 0.65rem;
                margin-top: 0.2rem;
                padding-right: 0.8rem;
            }

            .online-indicator {
                width: 10px;
                height: 10px;
                bottom: -1px;
                right: -1px;
            }
        }

        @media (max-width: 480px) {
            .last-message-status {
                font-size: 0.6rem;
                padding-right: 0.6rem;
            }

            .online-indicator {
                width: 8px;
                height: 8px;
            }
        }            .inbox-title {
                flex-direction: column;
                gap: 0.5rem;
                align-items: flex-start;
            }

            .inbox-stats {
                justify-content: center;
                width: 100%;
            }

            .messages-container {
                height: calc(100vh - 125px);
                padding-bottom: 200px;
                padding: 0.75rem;
            }
            /* Mobile devices */
@media (max-width: 768px) {
    .messages-container {
        padding-bottom: 250px; /* Increase padding for mobile */
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .messages-container {
        padding-bottom: 300px; /* Even more padding for smaller screens if needed */
    }
}
            .active-chat-header {
                padding: 0.8rem 1rem;
                min-height: 60px;
            }

            .chat-user-info h4 {
                font-size: 1rem;
                margin: 0;
            }

            .chat-user-status {
                font-size: 0.8rem;
            }

            .header-actions {
                gap: 0.5rem;
            }

            .header-action-btn {
                width: 40px;
                height: 40px;
                font-size: 1.1rem;
            }

            .message-input-area {
                left: 0;
                right: 0;
                padding: 0.8rem 1rem;
                min-height: 65px;
            }

            /* Mobile message bubble adjustments */
            .message {
                margin-bottom: 0.875rem;
            }

            .message-bubble {
                max-width: 85%;
                padding: 0.875rem 1rem;
                font-size: 0.95rem;
            }

            /* Improve touch targets for mobile */
            .conversation-item {
                min-height: 60px;
                padding: 1rem 0.8rem;
            }

            .conversation-item:active {
                background: var(--hover-background);
                transform: scale(0.98);
            }

            /* Mobile-friendly user info panel */
            .user-info-panel {
                max-width: 100%;
                margin: 0;
            }

            .user-action-item {
                padding: 1rem;
                font-size: 0.95rem;
                min-height: 50px;
                border-radius: 12px;
            }

            .message.own .message-bubble {
                border-radius: 18px 18px 4px 18px;
            }

            .message:not(.own) .message-bubble {
                border-radius: 18px 18px 18px 4px;
            }

            .message-time {
                font-size: 0.7rem;
                margin-top: 0.375rem;
            }

            /* Message text within bubble */
            .message-text {
                font-size: 0.95rem;
                line-height: 1.5;
            }

            /* Ensure product cards fit nicely in mobile bubbles */
            .message-bubble .product-reference-card {
                margin: 0;
                max-width: 100%;
            }

            /* Date separators on mobile */
            .date-separator {
                margin: 1.25rem 0 1rem;
            }

            .date-separator-text {
                font-size: 0.75rem;
                padding: 0.35rem 0.75rem;
            }
        }

        /* Extra adjustments for very small screens */
        @media (max-width: 480px) {
            .messages-container {
                padding: 0.5rem;
            }

            /* Optimize input area for small screens */
            .message-input-area {
                padding: 0.6rem 0.8rem;
                min-height: 60px;
            }

            .message-input-wrapper {
                padding: 0.4rem;
                border-radius: 20px;
            }

            .message-input {
                font-size: 0.9rem;
                min-height: 20px;
            }

            .send-message-btn,
            .attachment-btn {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }

            /* Smaller message bubbles on very small screens */
            .message-bubble {
                max-width: 90%;
                padding: 0.75rem 0.9rem;
                font-size: 0.9rem;
            }

            .message-bubble {
                max-width: 90%;
                padding: 0.75rem 0.875rem;
                font-size: 0.9rem;
            }

            .message-time {
                font-size: 0.65rem;
            }

            .message-text {
                font-size: 0.9rem;
            }

            /* Smaller action buttons on very small screens */
            .message-actions {
                top: 2px;
                right: 2px;
            }

            .delete-message-btn {
                width: 26px;
                height: 26px;
                font-size: 0.7rem;
            }
        }

        /* Settings Page Styles */
        .settings-page,
        .my-ads-page {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--background);
            z-index: 2000;
            overflow-y: auto;
        }

        .settings-header,
        .my-ads-header {
            background: var(--card-background);
            padding: 2rem;
            box-shadow: 0 2px 10px var(--shadow);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .settings-title,
        .my-ads-title {
            font-size: 2rem;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .settings-back,
        .my-ads-back {
            background: var(--primary-gradient);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.3s ease;
        }

        .settings-back:hover,
        .my-ads-back:hover {
            transform: scale(1.1);
        }

        .settings-content,
        .my-ads-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }

        .settings-sections {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .settings-section {
            background: var(--card-background);
            border-radius: 20px;
            padding: 2rem;
            box-shadow: 0 5px 20px var(--shadow);
            border: 1px solid var(--border-color);
        }

        .settings-section-title {
            font-size: 1.5rem;
            color: var(--text-color);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .settings-card {
            background: var(--background);
            border-radius: 15px;
            padding: 1.5rem;
            border: 1px solid var(--border-color);
        }

        .profile-info {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 2rem;
            align-items: start;
        }

        .profile-avatar-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--primary-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: white;
            overflow: hidden;
            border: 4px solid var(--border-color);
        }

        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .change-avatar-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .change-avatar-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .profile-details {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            position: relative;
        }

        .form-group label {
            font-weight: 600;
            color: var(--text-color);
            font-size: 0.9rem;
        }

        .settings-input {
            padding: 1rem;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            background: var(--card-background);
            color: var(--text-color);
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .settings-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow);
        }

        .settings-input:read-only {
            background: var(--border-color);
            opacity: 0.7;
        }

        [data-theme="dark"] .settings-input {
            background: var(--input-background);
            border-color: var(--border-color);
        }

        [data-theme="dark"] .settings-input:focus {
            background: var(--input-focus-background);
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .settings-input:read-only {
            background: var(--border-color);
            opacity: 0.6;
        }

        [data-theme="dark"] .settings-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .edit-btn {
            position: absolute;
            top: 2rem;
            right: 1rem;
            background: var(--accent-gradient);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 15px;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.3s ease;
        }

        .edit-btn:hover {
            transform: scale(1.05);
        }

        .save-profile-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 1rem 2rem;
            border-radius: 15px;
            cursor: pointer;
            font-weight: 600;
            font-size: 1.1rem;
            transition: all 0.3s ease;
        }

        .save-profile-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .preference-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem;
            border: 1px solid var(--border-color);
            border-radius: 15px;
            margin-bottom: 1rem;
            background: var(--card-background);
            transition: all 0.3s ease;
        }

        .preference-item:hover {
            box-shadow: 0 5px 15px var(--shadow);
        }

        .preference-label {
            flex: 1;
        }

        .preference-label span {
            font-weight: 600;
            color: var(--text-color);
            font-size: 1.1rem;
            display: block;
            margin-bottom: 0.3rem;
        }

        .preference-label p {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin: 0;
        }

        .toggle-switch,
        .language-switch {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.8rem 1.2rem;
            border-radius: 20px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
            min-width: 60px;
        }

        .toggle-switch:hover,
        .language-switch:hover {
            transform: scale(1.1);
            box-shadow: 0 5px 15px var(--shadow-hover);
        }

        .account-actions {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .settings-action-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 1rem 1.5rem;
            border-radius: 15px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .settings-action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .settings-action-btn.danger {
            background: var(--accent-gradient);
        }

        .settings-action-btn.danger:hover {
            background: linear-gradient(45deg, #c0392b, #a93226);
        }

        /* My Ads Page Styles */
        .ads-stats {
            display: flex;
            gap: 2rem;
            font-size: 1rem;
            color: var(--text-secondary);
        }

        .stats-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .stats-item span {
            background: var(--primary-gradient);
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 15px;
            font-weight: bold;
        }

        .my-ads-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .primary-btn {
            background: var(--accent-gradient);
            color: white;
            border: none;
            padding: 1rem 2rem;
            border-radius: 15px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            font-size: 1rem;
        }

        .primary-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--shadow-hover);
        }

        .ads-filters {
            display: flex;
            gap: 1rem;
        }

        .my-ads-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .my-ad-card {
            background: var(--card-background);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 5px 20px var(--shadow);
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            position: relative;
        }

        .my-ad-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px var(--shadow-hover);
        }

        .ad-status-badge {
            position: absolute;
            top: 1rem;
            left: 1rem;
            padding: 0.3rem 0.8rem;
            border-radius: 15px;
            font-size: 0.8rem;
            font-weight: 600;
            z-index: 5;
        }

        .ad-status-badge.active {
            background: #27ae60;
            color: white;
        }

        .ad-status-badge.sold {
            background: #f39c12;
            color: white;
        }

        .ad-status-badge.expired {
            background: #95a5a6;
            color: white;
        }

        .my-ad-actions {
            position: absolute;
            top: 1rem;
            right: 1rem;
            display: flex;
            gap: 0.5rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .my-ad-card:hover .my-ad-actions {
            opacity: 1;
        }

        .ad-action-btn {
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border: none;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .ad-action-btn:hover {
            transform: scale(1.1);
        }

        .ad-action-btn.edit {
            background: var(--primary-color);
        }

        .ad-action-btn.delete {
            background: var(--accent-color);
        }

        .ad-action-btn.promote {
            background: #f39c12;
        }

        .empty-ads {
            grid-column: 1 / -1;
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-secondary);
            background: var(--card-background);
            border-radius: 20px;
            border: 2px dashed var(--border-color);
        }

        .empty-ads-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
        }

        .empty-ads h3 {
            margin-bottom: 1rem;
            color: var(--text-color);
        }

        .empty-ads p {
            margin-bottom: 2rem;
        }

        /* Enhanced User Menu Styles */
        .user-menu {
            backdrop-filter: blur(20px);
            border: 2px solid var(--border-color);
            overflow: hidden;
        }

        @keyframes menuPopIn {
            0% {
                opacity: 0;
                transform: scale(0.9) translateY(-10px);
            }

            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 0.9rem 1.2rem;
            border-radius: 12px;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .menu-item:hover {
            background: var(--primary-color);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px var(--shadow);
        }

        .menu-item::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 100%;
            background: rgba(255, 255, 255, 0.1);
            transition: width 0.3s ease;
            z-index: 0;
        }

        .menu-item:hover::after {
            width: 100%;
        }

        .menu-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: var(--card-background);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            margin-right: 1rem;
            box-shadow: 0 4px 8px var(--shadow);
            transition: all 0.3s ease;
            z-index: 1;
        }

        .menu-item:hover .menu-icon {
            transform: rotate(10deg) scale(1.1);
            box-shadow: 0 6px 12px var(--shadow-hover);
        }

        .menu-text {
            font-weight: 500;
            font-size: 1rem;
            flex: 1;
            z-index: 1;
        }

        .menu-divider {
            height: 2px;
            background: var(--border-color);
            margin: 0.5rem 0 1rem 0;
            border-radius: 2px;
        }

        .menu-danger {
            color: var(--accent-color);
        }

        .menu-danger:hover {
            background: var(--accent-gradient);
            color: white;
        }

        .menu-badge {
            background: var(--accent-color);
            color: white;
            border-radius: 20px;
            min-width: 24px;
            height: 24px;
            font-size: 0.8rem;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 0.5rem;
            z-index: 1;
        }

        /* Product Reference Card Styles */
        .product-reference-card {
            background: var(--card-background);
            border: 2px solid var(--primary-color);
            border-radius: 15px;
            padding: 1rem;
            margin: 0.75rem 0;
            display: flex;
            gap: 1rem;
            align-items: center;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
            position: relative;
            overflow: hidden;
        }

        .product-reference-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 4px;
            height: 100%;
            background: var(--primary-gradient);
        }

        .product-reference-card:hover {
            box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
            transform: translateY(-3px);
            border-color: var(--accent-color);
        }

        .product-reference-card:active {
            transform: translateY(-1px);
        }

        .product-ref-image {
            width: 80px;
            height: 80px;
            border-radius: 12px;
            object-fit: cover;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            background: #f0f0f0;
        }

        .product-ref-details {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .product-ref-title {
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.25rem;
            display: -webkit-box;
            line-clamp: 2;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
            font-size: 0.95rem;
        }

        .product-ref-price {
            color: var(--primary-color);
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 0.25rem;
        }

        .product-ref-badge {
            background: var(--primary-gradient);
            color: white;
            padding: 0.3rem 0.75rem;
            border-radius: 20px;
            font-size: 0.7rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            width: fit-content;
            white-space: nowrap;
        }

        /* Mobile-specific enhancements for product cards */
        @media (max-width: 768px) {
            .product-reference-card {
                padding: 0.875rem;
                margin: 0.5rem 0;
                gap: 0.875rem;
                border-width: 2px;
                border-radius: 12px;
            }

            .product-ref-image {
                width: 70px;
                height: 70px;
                border-radius: 10px;
            }

            .product-ref-title {
                font-size: 0.9rem;
                line-clamp: 2;
                -webkit-line-clamp: 2;
                line-height: 1.35;
            }

            .product-ref-price {
                font-size: 1rem;
                font-weight: 700;
            }

            .product-ref-badge {
                font-size: 0.65rem;
                padding: 0.25rem 0.65rem;
            }

            /* Better tap targets on mobile */
            .product-reference-card {
                -webkit-tap-highlight-color: rgba(52, 152, 219, 0.1);
                touch-action: manipulation;
            }

            /* Smooth animations on mobile */
            .product-reference-card:active {
                transform: scale(0.98);
                transition: transform 0.1s ease;
            }
        }

        /* Extra small screens */
        @media (max-width: 480px) {
            .product-reference-card {
                padding: 0.75rem;
                gap: 0.75rem;
            }

            .product-ref-image {
                width: 60px;
                height: 60px;
                border-radius: 8px;
            }

            .product-ref-title {
                font-size: 0.85rem;
            }

            .product-ref-price {
                font-size: 0.95rem;
            }

            .product-ref-badge {
                font-size: 0.6rem;
                padding: 0.2rem 0.5rem;
            }
        }

        /* Message Confirmation Dialog Styles */
        .message-confirm-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 10001;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        .message-confirm-modal.show {
            display: flex;
        }

        .message-confirm-content {
            background: var(--card-background);
            border-radius: 20px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: modalSlideIn 0.3s ease;
        }

        .message-confirm-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--border-color);
        }

        .message-confirm-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-color);
        }

        .message-confirm-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: color 0.3s ease;
        }

        .message-confirm-close:hover {
            color: var(--accent-color);
        }

        .message-confirm-body {
            margin-bottom: 1.5rem;
        }

        .message-preview-label {
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 0.5rem;
            display: block;
        }

        .message-preview-textarea {
            width: 100%;
            min-height: 120px;
            padding: 1rem;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 1rem;
            font-family: inherit;
            resize: vertical;
            transition: border-color 0.3s ease;
            background: var(--background-color);
            color: var(--text-color);
        }

        .message-preview-textarea:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .message-preview-textarea {
            background: #1e1e1e;
        }

        .message-confirm-actions {
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
        }

        .message-confirm-btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 1rem;
        }

        .message-confirm-btn.cancel {
            background: var(--background-color);
            color: var(--text-color);
            border: 2px solid var(--border-color);
        }

        .message-confirm-btn.cancel:hover {
            background: var(--border-color);
        }

        .message-confirm-btn.send {
            background: var(--primary-gradient);
            color: white;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .message-confirm-btn.send:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
        }

        .message-confirm-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {

            .settings-content,
            .my-ads-content {
                padding: 1rem;
            }

            .profile-info {
                grid-template-columns: 1fr;
                text-align: center;
            }

            .my-ads-actions {
                flex-direction: column;
                align-items: stretch;
            }

            .ads-stats {
                justify-content: center;
                flex-wrap: wrap;
            }

            /* IMAGE PREVIEW STUFF*/
            /* Message files container */
            /* ===== adjustable size ===== */
            :root {
                --card-max: 250px;
            }

            /* change this to control MAX card width */

            /* ===== gallery grid ===== */
            .message-files {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(0, var(--card-max)));
                /* cards never exceed --card-max */
                gap: 16px;
                margin: 16px 0;
                justify-content: start;
                /* left-align leftover space */
                justify-items: start;
                /* prevent items from stretching to full track */
                width: 100%;
                box-sizing: border-box;
            }

            /* ===== image card ===== */
            .image-card {
                position: relative;
                border-radius: 12px;
                overflow: hidden;
                background: white;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
                cursor: pointer;
                transition: all 0.3s ease;

                /* critical: respect the max width instead of stretching */
                width: auto;
                max-width: var(--card-max);
            }

            .image-card:hover {
                transform: translateY(-4px);
                box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            }

            /* ===== image box & image ===== */
            .image-wrapper {
                position: relative;
                /* anchor for the download button */
                aspect-ratio: 4 / 3;
                /* keep consistent thumbnail shape */
                overflow: hidden;
            }

            .preview-image {
                display: block;
                /* removes baseline gap */
                width: 100%;
                height: 100%;
                object-fit: cover;
                /* use 'contain' if you don't want cropping */
                transition: transform 0.3s ease;
            }

            .image-card:hover .preview-image {
                transform: scale(1.05);
            }

            /* ===== download button (overlay, consistent across devices) ===== */
            .download-btn {
                position: absolute;
                top: 12px;
                right: 12px;
                z-index: 3;

                width: 40px;
                height: 40px;
                background: rgba(255, 255, 255, 0.95);
                border: none;
                border-radius: 8px;
                cursor: pointer;

                display: flex;
                align-items: center;
                justify-content: center;

                color: #374151;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                transition: all 0.2s ease;
                backdrop-filter: blur(4px);

                appearance: none;
                -webkit-appearance: none;
                -moz-appearance: none;
                line-height: 0;
            }

            .download-btn:hover {
                background: white;
                color: #059669;
                transform: scale(1.1);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }

            /* ===== modal (single, non-duplicated block) ===== */
            .image-modal {
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                z-index: 1000;
                display: none;
                align-items: center;
                justify-content: center;
                animation: fadeIn 0.2s ease;
            }

            @keyframes fadeIn {
                from {
                    opacity: 0;
                }

                to {
                    opacity: 1;
                }
            }

            .modal-overlay {
                position: absolute;
                inset: 0;
                background: rgba(0, 0, 0, 0.85);
                backdrop-filter: blur(6px);
            }

            .modal-content {
                position: relative;
                max-width: 95vw;
                max-height: 95vh;
                background: white;
                border-radius: 16px;
                overflow: hidden;
                box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
                animation: slideIn 0.2s ease;
            }

            @keyframes slideIn {
                from {
                    transform: scale(0.96) translateY(8px);
                    opacity: 0;
                }

                to {
                    transform: scale(1) translateY(0);
                    opacity: 1;
                }
            }

            .modal-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 20px 24px;
                background: #f8f9fa;
                border-bottom: 1px solid #e9ecef;
            }

            .modal-title {
                font-weight: 600;
                color: #1e293b;
                font-size: 18px;
                flex: 1;
                margin-right: 16px;
                word-break: break-word;
            }

            .modal-controls {
                display: flex;
                gap: 8px;
            }

            .modal-download-btn,
            .modal-close-btn {
                width: 40px;
                height: 40px;
                background: white;
                border: 1px solid #e5e7eb;
                border-radius: 8px;
                cursor: pointer;
                color: #6b7280;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .modal-download-btn:hover {
                background: #f0fdf4;
                border-color: #bbf7d0;
                color: #16a34a;
            }

            .modal-close-btn:hover {
                background: #fef2f2;
                border-color: #fecaca;
                color: #dc2626;
            }

            .modal-image-container {
                padding: 24px;
                text-align: center;
                max-height: calc(95vh - 100px);
                overflow: auto;
            }

            #modalImage {
                max-width: 100%;
                max-height: 100%;
                border-radius: 8px;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            }

            /* ===== non-image file preview ===== */
            .file-preview {
                display: flex;
                align-items: center;
                padding: 12px;
                border-radius: 8px;
                background: #f8f9fa;
                cursor: pointer;
                transition: background 0.2s ease;
                min-width: 200px;
            }

            .file-preview:hover {
                background: #e9ecef;
            }

            .file-icon {
                margin-right: 12px;
                color: #666;
            }

            .file-info {
                flex: 1;
            }

            .file-name {
                font-weight: 500;
                color: #333;
                font-size: 14px;
                margin-bottom: 4px;
            }

            .file-size {
                font-size: 12px;
                color: #666;
            }

            /* ===== responsive tweaks (optional) ===== */
            @media (max-width: 768px) {
                .message-files {
                    gap: 12px;
                    /* same max width; just tighter gap on small screens */
                }

                .modal-content {
                    max-width: 98vw;
                    max-height: 98vh;
                }

                .modal-header {
                    padding: 16px 20px;
                }

                .modal-title {
                    font-size: 16px;
                }
            }

        }
    