/* ===========================================
   Ibex Arms - Stylesheet (Ricardo-style)
   =========================================== */

:root {
    --brand-dark:    #1d1d1b;
    --brand-navy:    #2d2d2d;
    --brand-accent:  #D52B1E;
    --brand-accent2: #b82218;
    --card-radius:   8px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
    --shadow:        0 2px 8px rgba(0,0,0,.07);
    --shadow-lg:     0 4px 20px rgba(0,0,0,.11);
    --bg:            #f5f6f7;
    --border:        #e3e3e3;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: #1d1d1b;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar-dark.bg-dark {
    background: var(--brand-dark) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    border-bottom: none;
}
.navbar-brand { font-size: 1rem; }
.navbar .form-control {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 6px 0 0 6px;
}
.navbar .form-control::placeholder { color: rgba(255,255,255,.4); }
.navbar .form-control:focus {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.3);
    color: #fff;
    box-shadow: none;
}

/* ---- Hero Banner ---- */
.hero-banner {
    background: #1d1d1b;
    min-height: 160px;
    border-radius: 8px;
}

/* ---- Cards ---- */
.card {
    border-radius: var(--card-radius) !important;
    border: 1px solid var(--border) !important;
    background: #fff;
}
.card.shadow-sm { box-shadow: var(--shadow) !important; }

/* ---- Listing Cards ---- */
.listing-card {
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
    border-radius: var(--card-radius) !important;
    overflow: hidden;
    border: 1px solid var(--border) !important;
    background: #fff;
}
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
}
.listing-img-wrap {
    position: relative;
    overflow: hidden;
    height: 185px;
    background: #ebebeb;
}
.listing-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}
.listing-card:hover .listing-img { transform: scale(1.03); }

.badge-condition {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 9px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    font-weight: 500;
}

/* ---- Listing Gallery ---- */
.listing-gallery-img {
    max-height: 440px;
    object-fit: contain;
    background: #1d1d1b;
    border-radius: 6px;
}
.carousel-thumbnails {
    overflow-x: auto;
    background: rgba(0,0,0,.4);
}
.thumb-img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s;
    flex-shrink: 0;
}
.thumb-img:hover,
.thumb-img.active { opacity: 1; outline: 2px solid var(--brand-accent); }

/* ---- Listing description ---- */
.listing-description {
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Chat ---- */
.chat-box {
    height: 420px;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg-bubble {
    max-width: 75%;
    padding: 9px 15px;
    border-radius: 16px;
    font-size: .92rem;
    line-height: 1.55;
    word-break: break-word;
}
.msg-bubble .msg-meta {
    font-size: .70rem;
    opacity: .6;
    margin-top: 4px;
}
.msg-mine {
    align-self: flex-end;
    background: var(--brand-dark);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.msg-other {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid var(--border);
    color: #1d1d1b;
    border-bottom-left-radius: 4px;
}
.msg-date-sep {
    text-align: center;
    font-size: .72rem;
    color: #aaa;
    margin: 4px 0;
}

/* ---- Buttons ---- */
.btn-dark { background: var(--brand-navy); border-color: var(--brand-navy); }
.btn-dark:hover { background: #444; border-color: #444; }

/* Override Bootstrap warning → Swiss red */
.btn-warning,
.btn-warning:focus {
    background-color: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    color: #fff !important;
    font-weight: 600;
}
.btn-warning:hover {
    background-color: var(--brand-accent2) !important;
    border-color: var(--brand-accent2) !important;
    color: #fff !important;
}

/* Swiss red utility */
.text-swiss { color: var(--brand-accent) !important; }
.bg-swiss   { background-color: var(--brand-accent) !important; }

/* ---- Form Controls ---- */
.form-control:focus,
.form-select:focus {
    border-color: #aaa;
    box-shadow: 0 0 0 .2rem rgba(0,0,0,.08);
}

/* ---- Badges ---- */
.badge { font-weight: 500; letter-spacing: .2px; }

/* ---- Table ---- */
.table th {
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #777;
}

/* ---- Admin ---- */
.admin-sidebar { min-width: 220px; }

/* ---- Footer ---- */
footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
}
.footer-link {
    color: rgba(255,255,255,.6) !important;
    transition: color .15s;
}
.footer-link:hover { color: #fff !important; }
footer .text-muted {
    color: rgba(255,255,255,.5) !important;
}

/* ---- Price tag ---- */
.price-tag {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-dark);
}

/* ---- Placeholder image ---- */
.no-img-placeholder {
    background: #ebebeb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

/* ---- Section titles ---- */
.section-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
    .hero-banner { min-height: 120px; padding: 1.5rem 1rem !important; }
    .hero-banner h1 { font-size: 1.4rem; }
    .listing-img-wrap { height: 155px; }
    .chat-box { height: 300px; }
}
