/**
 * Look Ahead Listings - Mobile-First Global Styles
 * 
 * All styles for the platform optimized for mobile app look and feel.
 * Features compact cards, touch-friendly interactions, and bottom navigation.
 * 
 * @package LookAheadListings
 */

:root {
    --primary: #ef6101;
    --primary-dark: #d45400;
    --primary-light: #fef0e6;
    --primary-glow: rgba(239, 97, 1, 0.25);
    --secondary: #1a1a2e;
    --ink: #1a1a2e;
    --ink-soft: #4a4a6a;
    --bg: #f6f8fc;
    --surface: #ffffff;
    --line: #e8ecf1;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 28px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.10);
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-bottom: env(safe-area-inset-bottom, 12px);
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --bg: #0e0e1a;
    --surface: #1a1a2e;
    --ink: #f0f0f8;
    --ink-soft: #a0a0c0;
    --line: #2a2a44;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 28px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --primary-light: #2a1a0a;
}

/* ===== Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    transition: background 0.2s, color 0.2s;
    overflow-x: hidden;
    padding-bottom: 76px; /* Space for bottom nav */
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

.wrap {
    max-width: 480px; /* Mobile-first max width */
    margin: 0 auto;
    padding: 0 16px;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 20px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}

/* ===== Buttons ===== */
.btn {
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--line);
    width: 100%;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    width: auto;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-success {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
    border-color: #f39c12;
}

.btn-text {
    background: transparent;
    color: var(--ink-soft);
    padding: 8px 12px;
    border: none;
    width: auto;
}

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

/* ===== Forms ===== */
.form-container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--ink);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--bg);
    transition: var(--transition);
    color: var(--ink);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.form-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 100px;
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 14px;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
    border-left-color: #c0392b;
}

.alert-success {
    background: #e8f8ed;
    color: #1e8449;
    border-left-color: #27ae60;
}

.alert-warning {
    background: #fef9e7;
    color: #7d6608;
    border-left-color: #f39c12;
}

/* ===== Boost Cards ===== */
.boost-levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

@media (max-width: 400px) {
    .boost-levels {
        grid-template-columns: 1fr;
    }
}

.boost-card {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.boost-card:hover,
.boost-card.selected {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.boost-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.boost-card .boost-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.boost-card .boost-badge.free {
    background: #6c757d;
    color: #fff;
}

.boost-card .boost-badge.popular {
    background: #f39c12;
    color: #fff;
}

.boost-card .boost-badge.best {
    background: #e74c3c;
    color: #fff;
}

.boost-card .boost-badge.urgent {
    background: #9b59b6;
    color: #fff;
}

.boost-card .boost-badge.premium {
    background: #9b59b6;
    color: #fff;
}

.boost-card .boost-price {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

.boost-card .boost-price .currency {
    font-size: 14px;
}

.boost-card .boost-label {
    font-weight: 600;
    font-size: 15px;
    margin: 4px 0;
}

.boost-card .boost-features {
    text-align: left;
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 10px;
}

.boost-card .boost-features li {
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.boost-card .boost-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 700;
}

.boost-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.boost-card .radio-custom {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line);
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
    margin-bottom: 6px;
}

.boost-card.selected .radio-custom {
    border-color: var(--primary);
}

.boost-card.selected .radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* ===== Media Gallery ===== */
.media-gallery {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.media-gallery-main {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.media-gallery-main img,
.media-gallery-main video {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.media-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
}

.media-gallery-thumbs .gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.media-gallery-thumbs .gallery-thumb:hover {
    border-color: var(--primary);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
    width: auto;
}

.toast {
    background: var(--surface);
    color: var(--ink);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.4s ease forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid var(--line);
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px calc(8px + var(--safe-bottom));
    z-index: 30;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(26, 26, 46, 0.96);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 30px;
    transition: var(--transition);
    gap: 2px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-item .material-symbols-outlined {
    font-size: 26px;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-item:active {
    opacity: 0.6;
}

/* ===== App Bar ===== */
.app-bar {
    background: var(--surface);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .app-bar {
    background: rgba(26, 26, 46, 0.92);
}

.app-bar .logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-bar .logo-area img {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.app-bar .logo-area span {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-bar .actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-bar .actions .icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    padding: 6px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.app-bar .actions .icon-btn:active {
    background: var(--primary-light);
}

.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 20px;
    border: 2px solid var(--surface);
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    min-width: 16px;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    transition: var(--transition);
}

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

.card-header h3 {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
}

/* ===== Listing Cards ===== */
.listing-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.listing-card:active {
    transform: scale(0.99);
}

.listing-card .thumb {
    height: 160px;
    background: var(--bg);
    position: relative;
}

.listing-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-card .thumb .badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.listing-card .thumb .badges span {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    backdrop-filter: blur(2px);
    text-transform: capitalize;
}

.listing-card .thumb .badges .verified {
    background: #27ae60;
}

.listing-card .thumb .price-pill {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--surface);
    padding: 4px 14px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.listing-card .body {
    padding: 12px 14px;
}

.listing-card .body .title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.listing-card .body .meta {
    font-size: 12px;
    color: var(--ink-soft);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.listing-card .body .meta .loc {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ===== Hero Card ===== */
.hero-card {
    background: linear-gradient(135deg, var(--secondary), #2d2d5e);
    color: #fff;
    border: none;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.hero-card .badge {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 500;
}

.hero-card h2 {
    font-family: var(--font-head);
    font-size: 22px;
    margin: 4px 0;
}

.hero-card h2 span {
    color: var(--primary);
}

.hero-card p {
    opacity: 0.8;
    font-size: 14px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.hero-actions .btn {
    flex: 1;
}

.hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===== Chips ===== */
.chip {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.chip:active {
    opacity: 0.7;
    transform: scale(0.95);
}

.chip-primary {
    background: var(--primary);
    color: #fff;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--ink-soft);
}

.empty-state .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== Verified Badge ===== */
.verified-badge {
    color: #27ae60;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== Utility ===== */
.flex {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }

.text-center { text-align: center; }
.text-muted { color: var(--ink-soft); font-size: 13px; }

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .wrap {
        padding: 0 16px;
    }
    .form-container {
        padding: 16px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 8px 12px 20px;
    }
    
    .listing-card .thumb {
        height: 140px;
    }
    
    .hero-card h2 {
        font-size: 20px;
    }
    
    .hero-card {
        padding: 16px;
    }
    
    .boost-levels {
        grid-template-columns: 1fr;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        min-width: unset;
    }
    
    .card {
        padding: 14px;
    }
}

@media (max-width: 360px) {
    .app-bar .logo-area span {
        font-size: 15px;
    }
    
    .listing-card .thumb {
        height: 120px;
    }
    
    .nav-item {
        font-size: 9px;
        padding: 2px 8px;
    }
    
    .nav-item .material-symbols-outlined {
        font-size: 22px;
    }
}

/* ===== Dark Theme Overrides for Mobile ===== */
[data-theme="dark"] .hero-card {
    background: linear-gradient(135deg, #1a1a2e, #2d2d5e);
}

[data-theme="dark"] .chip {
    background: #2a1a0a;
    color: var(--primary);
}

[data-theme="dark"] .listing-card .thumb .badges span {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .toast {
    background: #2a2a44;
    border-color: #3a3a5e;
}

[data-theme="dark"] .toast.success {
    background: #1e3a2a;
}

[data-theme="dark"] .toast.error {
    background: #3a1a1a;
}

/* ===== Touch-friendly improvements ===== */
button,
.btn,
.chip,
.nav-item,
.listing-card,
.icon-btn {
    touch-action: manipulation;
}

input,
select,
textarea {
    font-size: 16px; /* Prevents iOS zoom */
}

@media (max-width: 480px) {
    input,
    select,
    textarea {
        font-size: 16px;
    }
}