/* Font Import (Outfit) is in HTML head */

:root {
    /* Palette: Premium Dark/Deep Theme with Vibrant Accents */
    --color-bg: #0f111a;
    --color-surface: #1a1d2d;
    --color-surface-glass: rgba(26, 29, 45, 0.7);
    --color-primary: #6366f1;
    /* Indigo 500 */
    --color-primary-hover: #4f46e5;
    --color-accent: #8b5cf6;
    /* Violet 500 */
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-border: rgba(255, 255, 255, 0.1);

    /* Spacing */
    --nav-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --glass-blur: blur(12px);

    /* Transitions */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

button {
    font-family: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-highlight {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-text {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-text:hover {
    color: var(--color-text-main);
}

.btn-block {
    width: 100%;
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}

.glass {
    background: var(--color-surface-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.nav-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text {
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--color-text-muted);
    font-weight: 500;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--color-text-main);
}

.auth-buttons {
    display: flex;
    gap: 15px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hero Section */
.hero-section {
    padding-top: calc(var(--nav-height) + 80px);
    padding-bottom: 100px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar */
.search-bar {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.search-input-group {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

.search-input-group label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-input-group input,
.search-input-group select {
    background: none;
    border: none;
    color: var(--color-text-main);
    font-size: 1rem;
    outline: none;
    width: 200px;
}

.search-input-group select option {
    background: var(--color-bg);
}

.divider {
    width: 1px;
    height: 40px;
    background: var(--color-border);
}

.btn-search {
    padding: 12px 32px;
    border-radius: 8px;
    margin-left: 20px;
}

/* Background Blobs */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: -10%;
    left: -5%;
    animation: float 10s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--color-accent);
    bottom: -10%;
    right: -5%;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* Grid Layout */
.section-padding {
    padding: 80px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 30px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Card */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s var(--ease-out);
    position: relative;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.card-image {
    width: 100%;
    height: 200px;
    background-color: #2e3248;
    /* Skeleton color */
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.card-price span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.card-title {
    font-size: 1.1rem;
    margin: 5px 0 10px;
    font-weight: 600;
}

.card-meta {
    display: flex;
    gap: 15px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1e2235;
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    position: relative;
    z-index: 1001;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s var(--ease-out);
    max-height: 90vh;
    overflow-y: auto;
}

/* Specific Styles for Listing Modal */
.listing-modal-content {
    max-width: 900px;
    padding: 0;
    /* Remove default padding for full-width image effect if desired, or keep it */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.listing-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 40px;
    overflow-y: auto;
    max-height: 80vh;
}

.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 15px;
}

.modal-header h2 {
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.modal-description h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--color-text-main);
    margin-top: 20px;
}

.modal-description p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .listing-details {
        grid-template-columns: 1fr;
    }

    .modal-image {
        height: 250px;
    }

    .modal-info {
        padding: 25px;
    }
}

.modal.hidden .modal-content {
    transform: scale(0.95);
}

.btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-main);
    font-size: 1rem;
}

.form-group input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.auth-switch a {
    color: var(--color-primary);
    font-weight: 500;
}

/* Skeleton */
.skeleton {
    height: 300px;
    background: linear-gradient(110deg, #1e2235 8%, #2a304a 18%, #1e2235 33%);
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .search-bar {
        flex-direction: column;
        width: 100%;
    }

    .search-input-group {
        padding: 10px 0;
        width: 100%;
    }

    .search-input-group input,
    .search-input-group select {
        width: 100%;
    }

    .divider {
        display: none;
    }

    .btn-search {
        width: 100%;
        margin: 10px 0 0 0;
    }

    .nav-links {
        display: none;
        /* simple mobile hide for now */
    }
}