/* ==================== CSS Variables & Base Styles ==================== */
:root {
    --primary-color: #d4af37;
    --dark-bg: #0a0a0a;
    --dark-secondary: #151515;
    --dark-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a2a;
    --shadow-sm: 0 2px 8px rgba(212, 175, 55, 0.1);
    --shadow-md: 0 4px 16px rgba(212, 175, 55, 0.15);
    --shadow-lg: 0 8px 32px rgba(212, 175, 55, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fluid layout & spacing */
    --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --space-sm: clamp(0.5rem, 1vw, 0.75rem);
    --space-md: clamp(0.75rem, 1.5vw, 1.25rem);
    --space-lg: clamp(1.25rem, 2.5vw, 2rem);
    --space-xl: clamp(2rem, 4vw, 3.5rem);
    --container-max: min(100rem, 100vw - 2rem);
    --navbar-height: clamp(3.5rem, 8vh, 5rem);
    --radius-sm: 0.3125rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;

    /* Fluid typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
    --text-xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
    --text-2xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
    --text-3xl: clamp(2rem, 1.6rem + 2vw, 3rem);
    --text-hero: clamp(2rem, 1.5rem + 3.5vw, 4rem);
}

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

html {
    scroll-behavior: smooth;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--text-base);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
}

img,
video,
svg,
canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

input,
select,
textarea,
button {
    font: inherit;
    max-width: 100%;
}

/* ==================== Theme Classes ==================== */
body.dark-theme {
    /* default variables already represent dark */
}

body.light-theme {
    --dark-bg: #f5f5f5;
    --dark-secondary: #ffffff;
    --dark-tertiary: #f8f8f8;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.95);
}

body.light-theme .search-form {
    background: rgba(248, 248, 248, 0.9);
}

body.light-theme .listing-card,
body.light-theme .stat-card {
    background: rgba(248, 248, 248, 0.6);
}

/* ==================== Layout ==================== */
.page-content {
    padding-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    min-height: calc(100dvh - var(--navbar-height));
    width: 100%;
}

/* ==================== Container & Utilities ==================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 3vw, 1.5rem);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-sm);
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    line-height: 1.2;
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
}

/* ==================== Navigation ==================== */
.navbar {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    padding-block: var(--space-sm);
    padding-inline: clamp(1rem, 3vw, 1.25rem);
    min-height: var(--navbar-height);
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    transition: var(--transition);
}

.logo-img {
    height: clamp(34px, 4vw, 52px);
    width: auto;
    display: block;
    object-fit: contain;
}

.navbar-brand .logo:hover {
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.875rem);
    flex: 1 1 auto;
    margin-left: clamp(0.5rem, 3vw, 3rem);
    flex-wrap: wrap;
    align-items: center;
}

.navbar-menu .nav-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.navbar-menu .nav-link:hover {
    color: var(--primary-color);
}

.navbar-menu .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.navbar-menu .nav-link.active {
    color: var(--primary-color);
}

.navbar-menu .nav-link.active::after {
    width: 100%;
}

.hamburger-menu {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    margin-left: 12px;
}

.navbar-menu .nav-link:hover::after {
    width: 100%;
}

.navbar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px 10px;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

/* ==================== Buttons ==================== */
.btn-primary, .btn-secondary, .btn-danger, .btn-search {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #f4d03f);
    color: var(--dark-bg);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.2);
}

.btn-danger {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.3);
}

.btn-search {
    background: linear-gradient(135deg, var(--primary-color), #f4d03f);
    color: var(--dark-bg);
    padding: 12px 30px;
    font-size: 1rem;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-view {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--primary-color);
}

.btn-view:hover {
    background: rgba(212, 175, 55, 0.2);
}

.btn-favorite {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.btn-favorite:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.1);
}

.btn-favorite.active {
    background: rgba(212, 175, 55, 0.3);
    color: #ff6b6b;
}

/* ==================== Hero Section ==================== */
.hero {
    margin-top: 0;
    min-height: clamp(22rem, 85vh, 56rem);
    min-height: clamp(22rem, 85dvh, 56rem);
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.7), rgba(21, 21, 21, 0.8));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: min(56rem, 100% - 2rem);
    margin: 0 auto;
    padding: var(--space-md);
}

.hero-title {
    font-size: var(--text-hero);
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    animation: slideInDown 0.8s ease;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    animation: slideInUp 0.8s ease 0.2s backwards;
}

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

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

/* ==================== Search Form ==================== */
.search-form {
    background: rgba(21, 21, 21, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 3vw, 1.875rem);
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.8s ease 0.4s backwards;
    width: 100%;
}

.search-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab-radio input[type="radio"] {
    accent-color: var(--primary-color);
}

.tab-radio input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.search-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: var(--space-md);
    align-items: end;
}

.search-input-group {
    display: flex;
    flex-direction: column;
}

.search-input-group input,
.search-input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input-group input::placeholder {
    color: var(--text-secondary);
}

.search-input-group input:focus,
.search-input-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* ==================== Featured Section ==================== */
.featured-section {
    padding-block: var(--space-xl);
    width: 100%;
    background: linear-gradient(135deg, rgba(21, 21, 21, 0.5), rgba(10, 10, 10, 0.5));
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
    gap: clamp(1rem, 2.5vw, 1.875rem);
    margin-bottom: var(--space-xl);
    width: 100%;
}

/* ==================== Listing Card ==================== */
.listing-card {
    background: rgba(21, 21, 21, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.listing-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.listing-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 9rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.listing-card:hover .listing-image img {
    transform: scale(1.1);
}

.badge-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary-color), #f4d03f);
    color: var(--dark-bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.listing-content {
    padding: 20px;
}

.listing-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.listing-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.listing-title a:hover {
    color: var(--primary-color);
}

.listing-price {
    font-size: var(--text-xl);
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    font-weight: bold;
}

.listing-price .currency {
    font-size: 1rem;
    margin-left: 5px;
}

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-meta i {
    color: var(--primary-color);
}

.listing-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-favorite {
    flex-shrink: 0;
}

.btn-view {
    flex: 1;
    text-align: center;
}

/* ==================== Statistics Section ==================== */
.statistics-section {
    padding-block: var(--space-xl);
    width: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.5), rgba(21, 21, 21, 0.5));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: clamp(1rem, 2.5vw, 1.875rem);
}

.stat-card {
    background: rgba(21, 21, 21, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-number {
    font-size: var(--text-2xl);
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: var(--space-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==================== Section Footer ==================== */
.section-footer {
    text-align: center;
    margin-top: 50px;
}

/* ==================== Footer ==================== */
.footer {
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    margin-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    transform: translateY(-3px);
}

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

/* Minimal cards used in some views */
.card {
    background: rgba(21, 21, 21, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

body.light-theme .card {
    background: rgba(248, 248, 248, 0.85);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--space-lg);
    width: 100%;
}

/* ==================== Loading & Animations ==================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: spin 1s linear infinite;
}

.shimmer {
    animation: pulse 2s ease-in-out infinite;
}

/* ==================== Accessibility ==================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .navbar, .footer {
        display: none;
    }
}
