/* ============================================================
   IronBid — Extra Frontend Styles
   ============================================================ */

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #1f2937;
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    animation: slideIn .3s ease;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.success { border-left: 4px solid #10b981; }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.info    { border-left: 4px solid #4a90e2; }
@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* ── Image Gallery Lightbox ──────────────────────────────────── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.2); }

/* ── Vehicle Detail Gallery ──────────────────────────────────── */
.gallery-main img:hover { cursor: zoom-in; }

/* ── Skeleton Loading ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Price Highlight ─────────────────────────────────────────── */
.price-highlight {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* ── Sticky Sidebar ──────────────────────────────────────────── */
@media (min-width: 900px) {
    .price-box { position: static !important; }
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumb a { color: #4a90e2; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #d1d5db; }

/* ── Back to top button ──────────────────────────────────────── */
#backToTop {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--navy-dark);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    transition: all .2s;
    z-index: 999;
}
#backToTop.visible { display: flex; }
#backToTop:hover { background: var(--blue-accent); transform: translateY(-2px); }

/* ── Form validation ─────────────────────────────────────────── */
.auth-input.invalid { border-color: #ef4444; }
.auth-input.valid   { border-color: #10b981; }
.field-error { color: #ef4444; font-size: 12px; margin-top: 4px; display: block; }

/* ── Print styles ────────────────────────────────────────────── */
@media print {
    .header, .main-nav, footer, .vehicle-actions, #loadMoreContainer { display: none !important; }
    .vehicle-detail-grid { grid-template-columns: 1fr !important; }
}
