/**
 * AgriShop 2.0 — Hub CSS
 * Styles pour le Home Hub, la navbar 2.0, les cartes modules, le widget bar
 * Fichier ADDITIONNEL — ne remplace pas style.css existant
 */

/* ============================================================
   TOP BAR — Barre supérieure sombre
   ============================================================ */
.agrishop-topbar {
    background: #071f0e;
    padding: 7px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(46,204,113,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1031;
}
.topbar-link { color: rgba(255,255,255,0.65); text-decoration: none; transition: color .2s; }
.topbar-link:hover { color: #2ecc71; }

/* ============================================================
   NAVBAR BRAND
   ============================================================ */
.agrishop-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #27ae60 !important;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agrishop-brand i { font-size: 1.1rem; }

/* ============================================================
   AGRI-NAV-LINK — Liens principaux de la navbar
   ============================================================ */
.agri-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px !important;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #444 !important;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 1;
}
.agri-nav-link:hover, .agri-nav-link.show {
    background: rgba(39,174,96,0.08);
    color: #27ae60 !important;
}
.agri-nav-link.active {
    background: rgba(39,174,96,0.12);
    color: #27ae60 !important;
}
.agri-nav-link i { font-size: 0.9rem; flex-shrink: 0; }
.agri-nav-link.dropdown-toggle::after { margin-left: 4px; }

/* ============================================================
   AGRI-DROPDOWN — Menus déroulants premium
   ============================================================ */
.agri-dropdown {
    padding: 12px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    animation: dropFade .15s ease;
}
@keyframes dropFade {
    from { opacity:0; transform: translateY(-6px); }
    to   { opacity:1; transform: translateY(0); }
}
.agri-dd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: background .15s;
    cursor: pointer;
}
.agri-dd-item:hover { background: #f8f9fa; color: #333; }
.agri-dd-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; flex-shrink: 0;
}

/* ============================================================
   ICON BUTTONS (panier)
   ============================================================ */
.agri-icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid rgba(39,174,96,0.3);
    background: rgba(39,174,96,0.06);
    color: #27ae60;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s;
    font-size: 0.95rem;
}
.agri-icon-btn:hover { background: rgba(39,174,96,0.15); transform: scale(1.05); }
.agri-badge {
    position: absolute; top: -4px; right: -4px;
    background: #c0392b; color: #fff;
    font-size: 0.6rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* Responsive navbar */
@media (max-width: 1199px) {
    #agriNavMain { padding: 12px 0; }
    .agri-nav-link { padding: 10px 12px !important; border-radius: 8px; }
    .agri-dropdown {
        position: static !important; box-shadow: none !important;
        border: 1px solid #eee !important; margin: 4px 8px !important;
        border-radius: 12px !important;
    }
}
@media (max-width: 767px) {
    .agrishop-topbar { display: none; }
    .agrishop-navbar { top: 0 !important; }
}

/* ============================================================
   VARIABLES ADDITIONNELLES
   ============================================================ */
:root {
    --hub-card-radius: 18px;
    --hub-transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    --module-produits:    #27ae60;
    --module-engins:      #e67e22;
    --module-centrales:   #2980b9;
    --module-vendeurs:    #d4a017;
    --module-bourse:      #0b6e4f;
    --module-encheres:    #c0392b;
    --module-rfq:         #8e44ad;
    --module-intl:        #1a3a6b;
    --module-agripay:     #27ae60;
}

/* ============================================================
   NAVBAR 2.0 — EXTENSIONS
   ============================================================ */
.navbar-glass .nav-link {
    font-size: 0.88rem;
    padding: 6px 10px !important;
    border-radius: 8px;
    transition: var(--hub-transition);
}
.navbar-glass .nav-link:hover {
    background: rgba(39, 174, 96, 0.08);
    color: var(--module-produits) !important;
}
.navbar-glass .nav-link.active {
    background: rgba(39, 174, 96, 0.12);
    color: var(--module-produits) !important;
    font-weight: 700;
}
.navbar-glass .dropdown-menu {
    border-radius: 14px;
    padding: 8px;
    min-width: 200px;
}
.navbar-glass .dropdown-item {
    border-radius: 8px;
    font-size: 0.87rem;
    transition: var(--hub-transition);
}
.navbar-glass .dropdown-item:hover {
    background: rgba(39, 174, 96, 0.08);
    color: var(--module-produits);
}

/* ============================================================
   WIDGETS BAR — Bande de données live sous navbar
   ============================================================ */
.hub-widgets-bar {
    background: linear-gradient(90deg, #071f0e 0%, #0b3d1a 50%, #071f0e 100%);
    border-bottom: 1px solid rgba(0, 255, 135, 0.2);
    padding: 8px 0;
    overflow: hidden;
    position: relative;
    z-index: 1000;
}
.hub-widgets-bar .widget-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}
.hub-widgets-bar .widget-item:last-child { border-right: none; }
.hub-widgets-bar .widget-label { opacity: 0.6; font-size: 0.75rem; }
.hub-widgets-bar .widget-value { font-weight: 700; }
.hub-widgets-bar .up   { color: #2ecc71; }
.hub-widgets-bar .down { color: #e74c3c; }
.hub-widgets-bar .flat { color: #f1c40f; }
.hub-ticker-scroll {
    display: flex;
    animation: tickerScroll 40s linear infinite;
    width: max-content;
}
.hub-ticker-scroll:hover { animation-play-state: paused; }
@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================
   SECTION HUB MODULES — Grille 9 modules
   ============================================================ */
.hub-modules-section {
    background: linear-gradient(180deg, #f0faf4 0%, #ffffff 100%);
    padding: 60px 0;
}
.hub-modules-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #27ae60, #0b6e4f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Carte module */
.module-card {
    background: #fff;
    border-radius: var(--hub-card-radius);
    border: 2px solid transparent;
    padding: 28px 20px;
    text-align: center;
    transition: var(--hub-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--module-color, #27ae60);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--hub-card-radius);
}
.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    border-color: var(--module-color, #27ae60);
    color: inherit;
}
.module-card:hover::before { opacity: 0.04; }

.module-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    transition: var(--hub-transition);
    position: relative;
    z-index: 1;
}
.module-card:hover .module-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.module-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.module-desc {
    font-size: 0.78rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}
.module-stat {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    position: relative;
    z-index: 1;
}
.module-badge-new {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--module-color, #27ae60);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* ============================================================
   SECTION BOURSE PREVIEW (dans Hub)
   ============================================================ */
.bourse-preview-section {
    background: linear-gradient(135deg, #071f0e 0%, #0b3d1a 100%);
    padding: 50px 0;
    color: #fff;
}
.bourse-price-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 20px;
    transition: var(--hub-transition);
}
.bourse-price-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-4px);
}

/* ============================================================
   FOOTER HUB
   ============================================================ */
.hub-footer {
    background: #071f0e;
    color: rgba(255,255,255,0.7);
    padding: 40px 0 20px;
}
.hub-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.hub-footer a:hover { color: #2ecc71; }
.hub-footer-title {
    color: #2ecc71;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   PAGES MODULES — Layout commun
   ============================================================ */
.page-module-header {
    background: linear-gradient(135deg, var(--module-color, #27ae60) 0%, rgba(0,0,0,0.8) 100%);
    color: #fff;
    padding: 60px 0 40px;
    margin-top: -70px;
    padding-top: 130px;
}
.page-module-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
}
.breadcrumb-hub a { color: rgba(255,255,255,0.7); text-decoration: none; }
.breadcrumb-hub a:hover { color: #fff; }
.breadcrumb-hub .separator { color: rgba(255,255,255,0.4); margin: 0 8px; }

/* ============================================================
   ENCHÈRES — Countdown Timer
   ============================================================ */
.auction-countdown {
    font-family: 'Outfit', monospace;
    font-size: 1.4rem;
    font-weight: 800;
    color: #c0392b;
    letter-spacing: 2px;
}
.auction-card-live {
    border: 2px solid rgba(192, 57, 43, 0.3);
    animation: liveAuction 2s infinite;
}
@keyframes liveAuction {
    0%, 100% { border-color: rgba(192,57,43,0.3); }
    50%       { border-color: rgba(192,57,43,0.8); box-shadow: 0 0 20px rgba(192,57,43,0.2); }
}

/* ============================================================
   RFQ — Cartes demandes
   ============================================================ */
.rfq-card {
    border-left: 4px solid var(--module-rfq);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: var(--hub-transition);
}
.rfq-card:hover { transform: translateX(4px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* ============================================================
   BOURSE — Ticker
   ============================================================ */
.price-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    margin: 4px;
    cursor: pointer;
    transition: var(--hub-transition);
    white-space: nowrap;
}
.price-ticker-item:hover { background: rgba(255,255,255,0.12); transform: scale(1.02); }
.price-ticker-item.selected { background: rgba(46,204,113,0.15); border-color: #2ecc71; }

/* ============================================================
   AGRIPAY WIDGET — Dans AgriShop
   ============================================================ */
.agripay-widget {
    background: linear-gradient(135deg, #0b3d1a 0%, #134d24 100%);
    border-radius: 20px;
    padding: 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.agripay-widget::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 120px;
    height: 120px;
    background: rgba(46,204,113,0.1);
    border-radius: 50%;
}
.agripay-balance {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hub-modules-title { font-size: 1.5rem; }
    .module-icon-wrapper { width: 56px; height: 56px; font-size: 1.4rem; }
    .module-card { padding: 20px 14px; }
    .hub-widgets-bar { display: none; } /* Caché sur mobile, risque overflow */
    .page-module-header h1 { font-size: 1.6rem; }
}
