/* Modern Glassmorphism Design */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #4ade80;
    --text: #f8fafc;
    --glass: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
}

body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.8), transparent);
    top: -200px;
    left: -200px;
}

body::after {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8), transparent);
    bottom: -150px;
    right: -150px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 50px); }
    50% { transform: translate(0, 100px); }
    75% { transform: translate(-50px, 50px); }
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu { display: flex; gap: 1rem; align-items: center; }

.nav-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: var(--glass);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, white, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
}

.search-input::placeholder { color: rgba(255, 255, 255, 0.6); }

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 2rem 2rem;
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content { padding: 1.2rem; }

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.5); }

.hidden { display: none !important; }

/* Advanced Filters */
.advanced-filters {
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Drag & Drop Upload */
.drag-drop-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.drag-drop-area:hover,
.drag-drop-area.drag-over {
    border-color: var(--accent);
    background: rgba(240, 147, 251, 0.1);
    transform: scale(1.02);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drag-drop-text p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.drag-drop-text small {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Image Preview */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.image-preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
}

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

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Styles */
.chat-container {
    max-width: 600px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
}

.chat-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    max-width: 70%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.chat-message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-left: auto;
}

.chat-message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.15);
}

.chat-message .message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
    display: block;
}

.chat-message .message-reactions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.3rem;
}

.reaction {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

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

.typing-indicator {
    padding: 0.5rem;
    opacity: 0.7;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots::before {
    content: '●●●';
    animation: blink 1.4s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

/* Payment Styles */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.payment-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Alert Notification */
.alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-notification.success {
    border-left: 4px solid var(--success);
}

.alert-notification.error {
    border-left: 4px solid #ef4444;
}

.alert-notification.info {
    border-left: 4px solid #3b82f6;
}

/* Profile Dropdown */
.profile-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    animation: slideDown 0.3s ease;
}

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

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

.dropdown-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item:first-child {
    border-radius: 15px 15px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 15px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item span {
    font-size: 1.2rem;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border: none;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.profile-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Chats List */
.chats-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 500px;
    overflow-y: auto;
}

.chat-list-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.chat-list-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-list-info {
    flex: 1;
}

.chat-list-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.chat-list-info p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

.chat-unread-badge {
    background: var(--accent);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* My Items Section */
.my-items-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.my-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Enhanced Sell Modal */
.sell-modal-content {
    max-width: 700px !important;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--accent);
}

.step-label {
    font-size: 0.85rem;
    opacity: 0.7;
}

.step.active .step-label {
    opacity: 1;
    font-weight: 600;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input.modern,
.form-textarea.modern,
.form-select.modern {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input.modern:focus,
.form-textarea.modern:focus,
.form-select.modern:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}

/* Fix dropdown option visibility on all browsers */
.form-select option,
.form-select.modern option {
    background: #4a3f6b;
    color: white;
}

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

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.category-card {
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
}

.category-card.selected {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--accent);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Enhanced Drag & Drop */
.drag-drop-area.modern {
    padding: 3rem 2rem;
    text-align: center;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    opacity: 0.7;
    margin-bottom: 1rem;
}

.upload-info {
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.6;
    flex-wrap: wrap;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Range Slider */
.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.range-slider:hover {
    opacity: 1;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    border: 2px solid white;
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    border: 2px solid white;
}

.range-value {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Map Styles */
.location-map,
.filter-map {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.filter-map {
    height: 500px;
}

.map-filter-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1rem;
    height: calc(100% - 80px);
}

.map-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
}

.map-control-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control-item label {
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .listings-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .advanced-filters {
        grid-template-columns: 1fr;
    }
    .chat-container {
        height: 500px;
    }
    .profile-dropdown {
        right: 10px;
        min-width: 180px;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .map-filter-container {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
