/* Save path: src/MercadoDireto.Web/wwwroot/css/site.css */

/* ===========================
   MercadoDireto.pt - Site CSS
   =========================== */

:root {
    --cl-blue:       #0d2d5e;   /* azul escuro — confiança */
    --cl-blue-mid:   #1a4a8a;   /* azul médio — hover */
    --cl-green:      #28a45e;   /* verde — negócio e crescimento */
    --cl-green-dark: #1e7d48;   /* verde escuro — hover */
    --cl-teal:       #4dbcd4;   /* ciano — acento círculo logo */
    --cl-bg:         #f4f6f9;
    --cl-text:       #1e2a3a;
}

/* Global */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--cl-bg);
    color: var(--cl-text);
}

/* ---- Navbar ---- */
.navbar {
    background-color: var(--cl-blue) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    padding: 0;
}

.navbar-brand img.logo-img {
    height: 44px;
    width: auto;
    filter: brightness(1.1);
}

/* ---- Buttons primários — verde ---- */
.btn-primary {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--cl-green-dark);
    border-color: var(--cl-green-dark);
    color: #fff;
}
.btn-outline-primary {
    color: var(--cl-green);
    border-color: var(--cl-green);
}
.btn-outline-primary:hover {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
    color: #fff;
}

/* btn-danger reutilizado como CTA verde nesta plataforma */
.btn-danger {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
    color: #fff;
}
.btn-danger:hover {
    background-color: var(--cl-green-dark);
    border-color: var(--cl-green-dark);
    color: #fff;
}
.btn-outline-danger {
    color: var(--cl-green);
    border-color: var(--cl-green);
}
.btn-outline-danger:hover {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
    color: #fff;
}

/* ---- Forms ---- */
.form-control:focus,
.form-select:focus {
    border-color: var(--cl-green);
    box-shadow: 0 0 0 0.25rem rgba(40, 164, 94, 0.25);
}

/* ---- Hero Banner ---- */
.hero-banner {
    background: linear-gradient(135deg, #0a1f40 0%, #0d2d5e 55%, #0f4a3a 100%);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 55%;
    height: 180%;
    background: radial-gradient(circle, rgba(40, 164, 94, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Stats no hero */
.hero-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cl-green);
    line-height: 1;
}
.hero-stat-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Item Cards ---- */
.item-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
    overflow: hidden;
}
.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(13, 45, 94, 0.15) !important;
}
.item-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e8eef5;
    transition: opacity 0.2s;
}
.item-card:hover .item-thumbnail { opacity: 0.92; }

/* ---- Auction Timer ---- */
.auction-timer {
    font-family: 'Courier New', monospace;
    font-weight: 700;
}
.auction-timer.urgent {
    color: #dc3545 !important;
    animation: pulse-urgent 1s infinite;
}
@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ---- Badges ---- */
.badge { font-size: 0.7rem; font-weight: 500; }

/* Text-danger → verde no contexto da marca */
.text-danger { color: var(--cl-green) !important; }
.text-success { color: var(--cl-green) !important; }

/* ---- Cards ---- */
.card { border-radius: 10px; }

/* ---- Drop zone ---- */
#dropZone { transition: all 0.3s ease; }
#dropZone:hover, #dropZone.dragover {
    border-color: var(--cl-green) !important;
    background-color: rgba(40, 164, 94, 0.05);
}

/* ---- Toast ---- */
.toast-container { z-index: 9999; }

/* ---- Tables ---- */
.table-hover tbody tr:hover {
    background-color: rgba(40, 164, 94, 0.06);
    cursor: pointer;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #eef1f5; }
::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cl-green); }

/* ---- Countdown ---- */
.countdown-large {
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--cl-green);
}

/* ---- Profile image ---- */
.profile-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid var(--cl-green);
}

/* ---- Navbar shadow ---- */
.navbar.sticky-top {
    box-shadow: 0 2px 12px rgba(13, 45, 94, 0.4);
}

/* ---- Footer ---- */
footer, footer.bg-dark {
    background-color: #071629 !important;
}
.footer-desc {
    color: #8a9bb0;
    line-height: 1.6;
}
.footer-links li { margin-bottom: 6px; }
.footer-links a {
    color: #8ab4cc;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--cl-green); }
.footer-links a:hover { color: var(--cl-green); }

/* ---- Loading spinner ---- */
.spinner-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

/* ---- Condition badges ---- */
.condition-New        { background-color: var(--cl-green); color: white; }
.condition-UsedLikeNew{ background-color: #17a2b8; color: white; }
.condition-UsedGood   { background-color: #ffc107; color: black; }
.condition-UsedFair   { background-color: #fd7e14; color: white; }
.condition-ForParts   { background-color: #6c757d; color: white; }

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .item-thumbnail { height: 160px; }
    .hero-banner h1 { font-size: 1.7rem; }
    .hero-stat-number { font-size: 1.5rem; }
}
@media (min-width: 1200px) {
    .item-thumbnail { height: 220px; }
}

/* ---- Watchlist heart button ---- */
.watchlist-btn { background: none; border: none; line-height: 1; }
.watchlist-btn i { transition: transform 0.2s ease, color 0.2s ease; }
.watchlist-btn:hover i { transform: scale(1.3); }
.heart-pop { animation: heartPop 0.35s ease; }
@keyframes heartPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* ---- Mini card (Recently Viewed) ---- */
.mini-card {
    width: 90px;
    flex-shrink: 0;
}
.mini-card-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    display: block;
}
.mini-heart {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.heart-shadow { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7)); }

/* ---------- Home hero carousel (admin configurable) ----------
   Lives inside the hero's right column. Images are shown at their
   natural proportions (contain, never cropped) on the hero's own
   gradient, so no extra background is introduced.               */
.hero-carousel { padding-bottom: 1.75rem; }

.hero-carousel .hero-slide {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 190px;
}

/* Neutral translucent panel so pale product photos stay visible
   against the dark hero without looking like a pasted-on box. */
.hero-carousel .hero-slide-figure {
    flex: 0 0 170px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: .65rem;
}

.hero-carousel .hero-slide-figure img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.hero-carousel .hero-slide-body { flex: 1 1 auto; min-width: 0; }

.hero-carousel .hero-slide-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: .35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-carousel .hero-slide-subtitle {
    font-size: .9rem;
    color: rgba(255, 255, 255, .65);
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-carousel .hero-slide-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #28a45e;
    margin-bottom: .6rem;
}

.hero-carousel .hero-carousel-indicators { bottom: -.35rem; margin-bottom: 0; }
.hero-carousel .hero-carousel-indicators [data-bs-target] {
    width: 26px; height: 3px; border-radius: 2px;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next { width: 32px; opacity: .5; }
.hero-carousel .carousel-control-prev { left: -32px; }
.hero-carousel .carousel-control-next { right: -32px; }
.hero-carousel:hover .carousel-control-prev,
.hero-carousel:hover .carousel-control-next { opacity: .9; }

/* Arrows would overlap the content once the column narrows. */
@media (max-width: 1399.98px) {
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next { display: none; }
}

@media (max-width: 991.98px) {
    .hero-carousel { margin-top: 1.5rem; }
    .hero-carousel .hero-slide { gap: 1rem; min-height: 150px; }
    .hero-carousel .hero-slide-figure { flex-basis: 120px; height: 120px; }
    .hero-carousel .hero-slide-title { font-size: 1.1rem; }
    .hero-carousel .hero-slide-price { font-size: 1.3rem; }
}

@media (max-width: 575.98px) {
    .hero-carousel .hero-slide { flex-direction: column; text-align: center; }
    .hero-carousel .hero-slide-figure { flex-basis: auto; width: 140px; height: 140px; }
}
