/* style.css - Defind Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #FFA500;
    --primary-hover: #e69500;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --border: #2e2e2e;
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --success: #4dff94;
    --error: #ff4d4d;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}
.logo span { color: var(--primary); }

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: var(--primary-hover); }

/* Forms */
.form-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.form-group { margin-bottom: 25px; }
.form-row { display: flex; gap: 20px; }

.form-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.02);
    box-shadow: 0 0 0 4px rgba(255,165,0,0.05);
}
.form-textarea { min-height: 150px; resize: vertical; }

/* File Upload Button Styled */
.file-upload-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.05);
    border: 2px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    color: var(--text-muted);
}
.file-upload-btn:hover { border-color: var(--primary); color: var(--primary); }
.file-upload-btn input { display: none; }

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

/* Radio Type Selector */
.type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.type-option {
    flex: 1;
    cursor: pointer;
}
.type-option input { display: none; }
.type-box {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: 0.2s;
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-weight: 600;
}
.type-option input:checked + .type-box {
    border-color: var(--primary);
    background: rgba(255, 165, 0, 0.1);
    color: var(--primary);
}

/* User Dropdown & Notifications */
.nav-right { display: flex; align-items: center; gap: 20px; }

.notification-wrapper { position: relative; }
.notification-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding: 5px;
    transition: 0.2s;
}
.notification-btn:hover { color: var(--text-main); transform: scale(1.1); }
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

.notif-dropdown {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}
.notif-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    transition: 0.2s;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(255, 165, 0, 0.05); color: var(--text-main); border-left: 3px solid var(--primary); }
.notif-time { font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* User Dropdown */
.user-menu {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s;
}
.user-trigger:hover {
    transform: scale(1.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    user-select: none;
}

.user-info {
    display: flex;
    flex-direction: column;
}

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

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    margin-top: 0;
    background: var(--bg-card);
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.user-menu:hover .dropdown-content {
    /* display: block;  <-- REMOVED HOVER BEHAVIOR */
}

.dropdown-item {
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 14px;
    transition: 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--primary); }

.dropdown-divider { height: 1px; background: var(--border); margin: 0; }

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.alert-error { background: rgba(255, 77, 77, 0.1); color: #ff6b6b; border: 1px solid rgba(255, 77, 77, 0.2); }
.alert-success { background: rgba(77, 255, 148, 0.1); color: #4dff94; border: 1px solid rgba(77, 255, 148, 0.2); }

/* --- Homepage Styles --- */

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: radial-gradient(circle at center, rgba(255, 165, 0, 0.08), transparent 60%);
    margin-bottom: 40px;
}
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 30px;
    letter-spacing: -1px;
}

/* Search Tabs */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.search-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}
.search-tab {
    flex: 1;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    transition: 0.3s;
}
.search-tab:hover { color: var(--text-main); background: rgba(255,255,255,0.02); }
.search-tab.active {
    color: var(--primary);
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
}
.search-body { padding: 20px; }
.search-form-row {
    display: flex;
    gap: 10px;
}
.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.search-btn:hover { background: var(--primary-hover); }

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.section-title { font-size: 24px; font-weight: 700; }
.section-link { color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 600; }

/* Listing Grid */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border-color: var(--text-muted);
}
.card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}
.tag-sell { background: var(--success); color: #000; }
.tag-buy { background: var(--primary); color: #fff; }

.card-img {
    width: 100%;
    height: 150px;
    background: #2a2a2a;
    object-fit: cover;
}
.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-cat { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-price { font-weight: 700; color: var(--text-main); font-size: 17px; }
.card-loc { font-size: 12px; color: var(--text-muted); }

