/* ============================================
   Half Off Hotels — Marketplace Styles
   Dark theme with gold accents matching landing page
   ============================================ */

/* Design Tokens */
:root {
    --gold: #D4A843;
    --gold-light: #F0D78C;
    --gold-dark: #B8922E;
    --dark: #0A0A0A;
    --darker: #050505;
    --card: #111111;
    --card-hover: #161616;
    --card-border: #1a1a1a;
    --card-border-hover: #2a2a2a;
    --text: #E8E8E8;
    --text-muted: #888888;
    --text-dim: #555555;
    --accent: #C9302C;
    --green: #2ECC71;
    --green-dark: #27AE60;
    --blue: #3498DB;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--darker);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-logo:hover { color: var(--gold-light) !important; }

.logo-icon {
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.nav-links a.active {
    color: var(--gold);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--card-border);
    margin: 0 0.5rem;
}

/* Nav user dropdown */
.nav-user {
    position: relative;
}

.nav-user-btn {
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.2);
    color: var(--gold);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-btn:hover {
    background: rgba(212, 168, 67, 0.18);
    border-color: rgba(212, 168, 67, 0.35);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
}

.nav-user:hover .nav-dropdown,
.nav-dropdown.open {
    display: block;
}

.nav-dropdown a {
    display: block;
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.nav-dropdown a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

/* Mobile nav toggle */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 1.3rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Gold button in nav */
.btn-nav-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
    color: var(--darker) !important;
    font-weight: 600 !important;
    padding: 0.45rem 1.1rem !important;
    border-radius: 100px !important;
}

.btn-nav-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold)) !important;
}

/* ============================================
   Main Content Area
   ============================================ */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Page header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ============================================
   Filter / Search Bar
   ============================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.filter-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.filter-input:focus {
    border-color: var(--gold);
    background: rgba(212, 168, 67, 0.04);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.08);
}

.filter-input::placeholder {
    color: var(--text-dim);
}

/* ============================================
   Listing Cards Grid
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.listing-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none !important;
    color: var(--text) !important;
    position: relative;
    overflow: hidden;
}

.listing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.listing-card:hover {
    border-color: rgba(212, 168, 67, 0.3);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 20px rgba(212, 168, 67, 0.05);
}

.listing-card:hover::before {
    opacity: 1;
}

.card-casino {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.verified-badge-lg {
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
}

.badge-unverified {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: rgba(136, 136, 136, 0.1);
    border: 1px solid rgba(136, 136, 136, 0.2);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.badge-unverified-lg {
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
}

.badge-expiring {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: rgba(212, 168, 67, 0.12);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.badge-expiring-lg {
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-dates, .card-room {
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.card-nights {
    background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    margin-left: auto;
}

.card-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.card-price {
    display: flex;
    flex-direction: column;
}

.price-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.price-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.card-resort-fee {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.04);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.45;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 360px;
    line-height: 1.5;
}

.empty-state .btn {
    margin-top: 1.5rem;
}

/* Inline field validation error */
.field-error {
    display: block;
    font-size: 0.78rem;
    color: var(--accent);
    margin-top: 0.3rem;
}

.form-input.input-invalid {
    border-color: rgba(201, 48, 44, 0.6);
    background: rgba(201, 48, 44, 0.04);
}

/* ============================================
   Listing Detail Page
   ============================================ */
.detail-page {
    max-width: 1000px;
}

.detail-header {
    margin-bottom: 2rem;
}

.back-link {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.back-link:hover {
    color: var(--gold) !important;
}

.detail-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

.detail-section {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.meta-value {
    font-size: 1rem;
    font-weight: 500;
}

.detail-description {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.verification-image {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.verification-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
}

.resort-fee-disclosure {
    border-color: rgba(212, 168, 67, 0.2);
    background: rgba(212, 168, 67, 0.03);
}

.resort-fee-disclosure h3 {
    color: var(--gold);
}

.resort-fee-disclosure p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.92rem;
}

/* Booking sidebar card */
.booking-card {
    position: sticky;
    top: 88px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.booking-price {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 1.25rem;
}

.booking-price-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
    line-height: 1;
}

.booking-price-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: block;
}

.booking-breakdown {
    margin-bottom: 1.5rem;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breakdown-total {
    border-top: 1px solid var(--card-border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

.booking-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.75rem;
}

.booking-unavailable {
    text-align: center;
    padding: 1rem;
    background: rgba(201, 48, 44, 0.08);
    border: 1px solid rgba(201, 48, 44, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 2rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ============================================
   Forms
   ============================================ */
.form-page {
    max-width: 640px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.form-container {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--gold);
    background: rgba(212, 168, 67, 0.04);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.08);
}

.form-input::placeholder {
    color: var(--text-dim);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

select.form-input option {
    background: var(--card);
    color: var(--text);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

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

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.form-error {
    background: rgba(201, 48, 44, 0.08);
    border: 1px solid rgba(201, 48, 44, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--accent);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.input-prefix {
    position: relative;
}

.input-prefix span {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.92rem;
    pointer-events: none;
}

.input-prefix .form-input {
    padding-left: 1.75rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--darker);
}

.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 4px 16px rgba(212, 168, 67, 0.3);
    color: var(--darker);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 168, 67, 0.04);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

/* ============================================
   Bookings List
   ============================================ */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.booking-item {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.booking-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.booking-item-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.booking-status {
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.booking-status-pending {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.25);
    color: var(--blue);
}

.booking-status-confirmed {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.25);
    color: var(--green);
}

.booking-status-cancelled {
    background: rgba(201, 48, 44, 0.1);
    border: 1px solid rgba(201, 48, 44, 0.25);
    color: var(--accent);
}

.booking-status-pending_payment {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold);
}

.booking-item-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
}

.booking-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.booking-item-details strong {
    color: var(--text-dim);
    font-weight: 500;
}

/* ============================================
   Success Page
   ============================================ */
.success-page {
    text-align: center;
    max-width: 560px;
    margin: 3rem auto;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.12);
    border: 2px solid var(--green);
    color: var(--green);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-weight: 700;
}

.success-page h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.success-page > p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.success-details {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.success-note {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ============================================
   Error / 404 Page
   ============================================ */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1, .error-page h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ============================================
   Loading
   ============================================ */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Spinner component — gold ring, centered */
.spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(212, 168, 67, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton shimmer for card placeholders */
.skeleton {
    background: linear-gradient(90deg, var(--card) 25%, rgba(255,255,255,0.04) 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Toast Notifications
   ============================================ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    max-width: 380px;
    box-shadow: var(--shadow);
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--green);
}

.toast-error {
    background: rgba(201, 48, 44, 0.12);
    border: 1px solid rgba(201, 48, 44, 0.3);
    color: var(--accent);
}

.toast-info {
    background: rgba(52, 152, 219, 0.12);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: var(--blue);
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
    border-top: 1px solid var(--card-border);
    padding: 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-brand {
    color: var(--gold);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer-links a:hover {
    color: var(--gold);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .booking-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--darker);
        border-bottom: 1px solid var(--card-border);
        padding: 1rem;
        gap: 0.25rem;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-divider {
        display: none;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .main {
        padding: 1.5rem 1rem 3rem;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-group {
        min-width: auto;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

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

    .detail-meta {
        grid-template-columns: 1fr;
    }

    .success-details {
        grid-template-columns: 1fr;
    }

    .success-actions {
        flex-direction: column;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .listing-card {
        padding: 1.25rem;
    }

    .price-amount {
        font-size: 1.3rem;
    }
}

/* ============================================
   My Listings Dashboard
   ============================================ */

.page-header-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.75rem;
}

.my-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.my-listing-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    transition: border-color var(--transition);
}

.my-listing-card:hover {
    border-color: var(--card-border-hover);
}

.my-listing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.my-listing-header h3 {
    font-size: 1.05rem;
    color: var(--text);
    margin: 0;
}

.status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-active   { background: rgba(46, 204, 113, 0.15); color: var(--green); border: 1px solid rgba(46,204,113,0.3); }
.status-reserved { background: rgba(52, 152, 219, 0.15); color: var(--blue);  border: 1px solid rgba(52,152,219,0.3); }
.status-booked   { background: rgba(212, 168, 67, 0.15); color: var(--gold);  border: 1px solid rgba(212,168,67,0.3); }
.status-canceled { background: rgba(136, 136, 136, 0.12); color: var(--text-muted); border: 1px solid rgba(136,136,136,0.2); }

.my-listing-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.my-listing-details div {
    color: var(--text);
}

.text-dim { color: var(--text-dim); }

.listing-buyer-info {
    background: rgba(212, 168, 67, 0.07);
    border: 1px solid rgba(212, 168, 67, 0.18);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.85rem;
}

.buyer-info-title {
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.buyer-contact {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.my-listing-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px solid var(--card-border);
}

/* Danger button */
.btn-danger {
    background: transparent;
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

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

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--card-border-hover);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

@media (max-width: 640px) {
    .my-listings-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }
}

/* ============================================
   Browse: enhanced filter bar with rows, sort,
   price range inputs, mobile toggle, summary
   ============================================ */

/* Filter rows — each row wraps a group of related controls */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    align-items: flex-end;
}

/* Wide group spans more horizontal space */
.filter-group-wide {
    flex: 2;
    min-width: 200px;
}

/* Smaller prefix for price inputs inside filter bar */
.input-prefix-sm .form-input,
.input-prefix-sm input.filter-input {
    padding-left: 1.65rem;
}

.input-prefix-sm span {
    font-size: 0.85rem;
}

/* Filter action buttons side-by-side */
.filter-btn-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-btn-row .btn {
    white-space: nowrap;
}

/* "Showing X of Y" summary line above the grid */
.browse-summary {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-top: -1rem; /* tighten gap below filter bar */
    letter-spacing: 0.01em;
}

/* Inline load-more spinner appended inside the grid */
.loading-inline {
    padding: 1.5rem 0;
    grid-column: 1 / -1;
}

/* Mobile: filter toggle button (hidden on desktop) */
.filter-toggle-btn {
    display: none;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition), color var(--transition);
}

.filter-toggle-btn:hover {
    border-color: var(--gold);
    color: var(--text);
}

/* On mobile, filter-bar starts collapsed */
@media (max-width: 768px) {
    .filter-toggle-btn {
        display: block;
    }

    /* Collapsed by default — only show when toggled */
    .filter-bar {
        display: none;
        flex-direction: column;
    }

    .filter-bar.filter-bar-open {
        display: flex;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group,
    .filter-group-wide {
        width: 100%;
        min-width: auto;
    }

    .filter-actions {
        flex-direction: row;
        align-items: flex-end;
    }

    .filter-btn-row {
        width: 100%;
    }

    .filter-btn-row .btn {
        flex: 1;
    }

    .browse-summary {
        margin-top: 0;
    }
}

/* ============================================
   Legal Pages (Terms + Privacy)
   ============================================ */
.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.legal-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.legal-header h1 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.legal-body h2 {
    font-size: 1.1rem;
    color: var(--gold);
    margin: 2rem 0 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
}

.legal-body h3 {
    font-size: 0.95rem;
    color: var(--text);
    margin: 1.25rem 0 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

.legal-body p {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.legal-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.legal-body ul li {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.75;
    padding-left: 1.25rem;
    position: relative;
    margin-bottom: 0.35rem;
}

.legal-body ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--gold);
}

.legal-body a {
    color: var(--gold);
}

.legal-body a:hover {
    color: var(--gold-light);
}

.legal-body strong {
    color: var(--text);
    font-weight: 600;
}

.legal-back {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

/* Registration consent notice */
.auth-consent {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.auth-consent a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-consent a:hover {
    color: var(--gold);
}

/* ── Listing type badges (browse cards + detail page) ─────────────────── */
.badge-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.badge-type-flexible  { background: rgba(100, 160, 255, 0.15); color: #64a0ff; border: 1px solid rgba(100,160,255,0.3); }
.badge-type-code      { background: rgba(160, 255, 100, 0.12); color: #90d050; border: 1px solid rgba(160,255,100,0.3); }
.badge-type-experience{ background: rgba(200, 120, 255, 0.12); color: #c878ff; border: 1px solid rgba(200,120,255,0.3); }

.badge-type-lg {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    margin-top: 0.5rem;
}

.card-availability {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* ── Listing type selector grid (create listing form) ─────────────────── */
.listing-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.listing-type-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.875rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
    color: var(--text);
}

.listing-type-btn:hover {
    border-color: var(--gold);
    background: rgba(201,168,76,0.06);
}

.listing-type-btn.active {
    border-color: var(--gold);
    background: rgba(201,168,76,0.1);
}

.listing-type-btn .type-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.1rem;
}

.listing-type-btn .type-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}

.listing-type-btn .type-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.3;
}

@media (max-width: 480px) {
    .listing-type-grid {
        grid-template-columns: 1fr 1fr;
    }
    .listing-type-btn .type-desc {
        display: none;
    }
}
