/* Modern Sleek Dark Theme UI / UX */
:root {
    /* Colors */
    --bg-main: #0a0a0c;
    --bg-secondary: #141418;
    --bg-tertiary: #1f1f25;
    --accent-primary: #00d2ff;
    --accent-secondary: #3a7bd5;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a5;
    --text-tertiary: #6c6c75;
    
    --border-color: rgba(255,255,255,0.08);
    --hover-bg: rgba(255,255,255,0.05);

    /* Gradients */
    --grad-1: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --grad-2: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --grad-3: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --grad-4: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --grad-5: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-btn: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;

    /* Shadows */
    --shadow-glow: 0 0 20px rgba(0, 210, 255, 0.3);
    --shadow-card: 0 8px 30px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-primary);
}

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

/* NAVBAR */
.navbar {
    background: rgba(20, 20, 24, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    cursor: pointer;
}

.logo-text { color: var(--text-primary); }
.logo-dot { color: var(--accent-primary); }
.logo-tld { color: var(--text-secondary); font-weight: 500; }

.search-bar {
    flex: 1;
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    padding: 6px 6px 6px 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.2);
}

.search-bar input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-tertiary);
}

.search-bar button {
    background: var(--grad-btn);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-bar button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.location-select {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.location-select:hover {
    color: var(--text-primary);
}

.user-profile {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.user-profile:hover {
    color: var(--text-primary);
}

.post-ad-btn {
    background: var(--text-primary);
    color: var(--bg-main);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-ad-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* CATEGORIES */
.categories-section {
    padding: 60px 0 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}

.categories-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.categories-grid::-webkit-scrollbar {
    display: none; /* Chrome */
}

.category-card {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card:hover span {
    color: var(--text-primary);
}

.cat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.category-card span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    transition: color 0.3s ease;
}

.bg-gradient-1 { background: var(--grad-1); }
.bg-gradient-2 { background: var(--grad-2); }
.bg-gradient-3 { background: var(--grad-3); }
.bg-gradient-4 { background: var(--grad-4); }
.bg-gradient-5 { background: var(--grad-5); }


/* MAIN CONTENT GRID */
.main-content {
    padding: 20px 0 80px;
}

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

.view-all {
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 15px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* PRODUCT CARD */
.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-card), 0 0 15px rgba(0, 210, 255, 0.15);
}

.card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    background: var(--bg-tertiary);
    transition: transform 0.5s ease;
}

.product-card:hover .card-img {
    transform: scale(1.05);
}

.img-container {
    overflow: hidden;
    position: relative;
}

.badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

.card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: auto;
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* MODAL */
.modal {
    display: none; 
    position: fixed; 
    z-index: 999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-glow);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    color: white;
    background: var(--accent-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-img-wrapper {
    flex: 1.5;
    background: var(--bg-tertiary);
}

.modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 500px;
}

.modal-details {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.modal-date {
    color: var(--text-tertiary);
    font-size: 13px;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 30px;
}

.modal-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    flex-grow: 1;
}

.modal-user-card {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--grad-5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.modal-user-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.modal-user-info span {
    font-size: 13px;
    color: var(--text-tertiary);
}

.btn-contact {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--text-primary);
    color: var(--bg-main);
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-contact:hover {
    background: var(--grad-btn);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* FOOTER */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-col {
    max-width: 300px;
}

.footer-col .logo {
    margin-bottom: 16px;
    display: inline-block;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-col h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 14px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-actions {
        display: none;
    }
    .search-bar {
        order: 3;
        flex: 1 1 100%;
        margin-top: 10px;
    }
    .nav-container {
        flex-wrap: wrap;
    }
}
