/* ============================================================
   CHUBBYTRADER — AI Image Search
   Enhanced Production CSS
   Brand: #F15B2B (orange) | #EB9323 (yellow) | #343E61 (navy) | #586284 (mid)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: #F7F8FC;
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #343E61;
    -webkit-font-smoothing: antialiased;
}

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* ── ANIMATIONS ── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.animate-spin { animation: spin 1s linear infinite; }

/* ── HEADER ── */
header.bg-white {
    background: #fff !important;
    border-bottom: 1px solid #E8ECF8 !important;
    box-shadow: 0 1px 6px rgba(52,62,97,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── ACCORDION ── */
.horizontal-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-column { width: 100%; }

.accordion-section {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(52,62,97,0.07);
    transition: box-shadow 0.25s ease;
}
.accordion-section:hover {
    box-shadow: 0 4px 16px rgba(52,62,97,0.11);
}

.accordion-header {
    background: linear-gradient(135deg, #F15B2B 0%, #e04e20 100%);
    color: white;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border: none;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    transition: background 0.2s, opacity 0.2s;
    width: 100%;
    letter-spacing: 0.01em;
}
.accordion-header:hover:not([disabled]) {
    background: linear-gradient(135deg, #d94e24 0%, #c94418 100%);
}
.accordion-header.active {
    border-radius: 12px 12px 0 0;
}
.accordion-header[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1);
    background-color: #fff;
    border: 1px solid #E8ECF8;
    border-top: none;
    border-radius: 0 0 12px 12px;
}
.accordion-content.active {
    max-height: 2400px;
    padding: 1.75rem;
}

.chevron { transition: transform 0.3s ease; }
.chevron.rotated { transform: rotate(90deg); }

/* ── UPLOAD ZONE ── */
#uploadArea {
    border: 2px dashed #C8D3F0 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #F8F9FF, #F0F4FF) !important;
    padding: 48px 24px !important;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
#uploadArea:hover {
    border-color: #F15B2B !important;
    background: linear-gradient(135deg, #FFF8F5, #FFF2EC) !important;
    transform: translateY(-1px);
}
#uploadArea label { cursor: pointer; }

/* ── DETECTION RESULT BOX ── */
#detectionResults {
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(235,147,35,0.25) !important;
    animation: fadeInUp 0.35s ease;
}

/* ── TRADER LIST GRID ── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}

.col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 900px) {
    .col-lg-6 { flex: 0 0 100%; max-width: 100%; }
}

/* ── TRADER CARD ── */
.product-card-bl {
    border-radius: 14px;
    border: 1.5px solid #E4E9F5;
    box-shadow: 0 2px 12px rgba(52,62,97,0.07);
    background-color: #fff;
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s;
    animation: fadeInUp 0.35s ease;
}
.product-card-bl:hover {
    box-shadow: 0 8px 28px rgba(52,62,97,0.13);
    transform: translateY(-3px);
    border-color: #C8D3F0;
}

/* Card Header */
.product-head {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #EEF2FF, #E8EEFF);
    border-bottom: 1px solid #E4E9F5;
    position: relative;
}

/* Avatar */
.product-img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #F15B2B, #FF7A52);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 12px;
    box-shadow: 0 3px 8px rgba(241,91,43,0.25);
    color: white;
    font-weight: 700;
}
.product-img img {
    max-width: 52px;
    max-height: 52px;
    object-fit: cover;
    border-radius: 12px;
}

.pro-title-bl { flex: 1; min-width: 0; }

.product-head .product-name {
    color: #343E61;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    display: block;
}
.product-head .product-name a {
    color: #343E61;
    text-decoration: none;
    transition: color 0.2s;
}
.product-head .product-name a:hover { color: #F15B2B; }

.pro-cat {
    color: #586284;
    font-size: 12px;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pro-cat::before {
    content: '📦';
    font-size: 11px;
}

.country {
    color: #586284;
    font-size: 12px;
    margin: 0 !important;
}

/* Favourite icon */
.icon-fav {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #E4E9F5;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 1px 4px rgba(52,62,97,0.08);
}
.icon-fav:hover {
    transform: scale(1.18);
    background: #FFF0EB;
    border-color: #F15B2B;
    box-shadow: 0 2px 8px rgba(241,91,43,0.18);
}

/* Card Body */
.pro-detail-bl {
    padding: 14px 16px 10px;
    position: relative;
}

.pro-detail-bl .profile-img {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
}
.pro-detail-bl .profile-img img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pro-detail-bl .contend {
    padding-left: 50px;
    color: #586284;
    margin-bottom: 10px;
}

.contend p {
    margin: 0 0 3px 0;
    font-size: 13px;
    line-height: 1.5;
}

.contend .properity-name {
    margin: 0 0 3px 0;
    color: #343E61;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: block;
}
.contend .properity-name a {
    color: #343E61;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}
.contend .properity-name a:hover { color: #F15B2B; }

.rating {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    color: #586284;
    display: flex;
    align-items: center;
    gap: 3px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 6px;
    padding: 3px 8px;
}
.rating strong { color: #343E61; font-weight: 700; margin-left: 2px; }

/* Card Footer — Buttons */
.search-result-btn {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F0F2F8;
}

.btn-send-bl .btn-send {
    background-color: #FFF0EB;
    border: 1px solid #FDDACC;
    border-radius: 8px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    color: #F15B2B;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn-send-bl .btn-send::before { content: '✉️'; font-size: 11px; }
.btn-send-bl .btn-send:hover {
    background-color: #FFE4DA;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(241,91,43,0.2);
}

.detail-bl .btn-detail {
    text-decoration: none;
    color: #343E61;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1.5px solid #DFE6FD;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
    white-space: nowrap;
}
.detail-bl .btn-detail::after { content: '→'; }
.detail-bl .btn-detail:hover {
    background-color: #F0F4FF;
    border-color: #C8D3F0;
    transform: translateY(-1px);
}

/* ── PAGINATION ── */
.pagination-btn {
    background: linear-gradient(135deg, #F15B2B, #e04e20);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(241,91,43,0.25);
}
.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d94e24, #c94418);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(241,91,43,0.35);
}
.pagination-btn:disabled {
    background: #D1D5DB;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 13px;
    color: #586284;
    font-weight: 500;
    min-width: 140px;
    text-align: center;
    background: #F0F2F8;
    border-radius: 8px;
    padding: 8px 16px;
}

/* ── FALLBACK BANNER ── */
.fallback-banner {
    width: 100%;
    margin-bottom: 18px;
    background: #FFF8F0;
    border: 1px solid #FDDACC;
    border-left: 4px solid #F15B2B;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
}
.fallback-banner p:first-child {
    margin: 0 0 4px 0;
    color: #343E61;
    font-weight: 600;
    font-size: 14px;
}
.fallback-banner p:last-child {
    margin: 0;
    color: #586284;
    font-size: 13px;
}
.fallback-banner a {
    color: #F15B2B;
    font-weight: 600;
    text-decoration: underline;
}

/* ── SPINNERS ── */
.inline-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.section-spinner {
    margin: 0 auto;
    width: 44px;
    height: 44px;
    border: 4px solid #E5E7EB;
    border-top-color: #F15B2B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── SKELETON LOADER ── */
.skeleton-card {
    background: #fff;
    border: 1.5px solid #E4E9F5;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}
.skeleton {
    background: linear-gradient(90deg, #F0F2F8 25%, #E4E8F4 50%, #F0F2F8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}
.skeleton-line { height: 11px; margin-bottom: 8px; }
.skeleton-avatar { width: 52px; height: 52px; border-radius: 12px; }

/* ── HOVER-SHADOW UTILITY ── */
.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(52,62,97,0.1);
}

/* ── TRADER LIST ── */
.trader-list {
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #DFE6FD transparent;
}
.trader-list::-webkit-scrollbar { width: 4px; }
.trader-list::-webkit-scrollbar-thumb { background: #DFE6FD; border-radius: 4px; }

/* ── NO TRADERS CARD ── */
.no-traders-card {
    text-align: center;
    padding: 56px 24px;
    background: linear-gradient(135deg, #F8F9FF, #F0F4FF);
    border: 1.5px dashed #C8D3F0;
    border-radius: 14px;
    width: 100%;
}
.no-traders-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #343E61;
    margin: 0 0 8px;
}
.no-traders-card p {
    font-size: 14px;
    color: #586284;
    margin: 0 0 24px;
    line-height: 1.6;
}
.no-traders-card a {
    display: inline-block;
    background: linear-gradient(135deg, #F15B2B, #e04e20);
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(241,91,43,0.3);
}
.no-traders-card a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(241,91,43,0.4);
}

/* ── INQUIRY MODAL ── */
.ct-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(52,62,97,0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInUp 0.2s ease;
}
.ct-modal {
    background: white;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(52,62,97,0.2);
    position: relative;
}
.ct-modal h3 {
    font-size: 18px;
    font-weight: 700;
    color: #343E61;
    margin: 0 0 6px;
}
.ct-modal p {
    font-size: 13px;
    color: #586284;
    margin: 0 0 20px;
}
.ct-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #F3F4F8;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ct-modal-close:hover { background: #E4E9F5; }
.ct-modal textarea {
    width: 100%;
    border: 1.5px solid #E4E9F5;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    color: #343E61;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
    outline: none;
}
.ct-modal textarea:focus { border-color: #F15B2B; }
.ct-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.ct-modal-cancel {
    padding: 9px 18px;
    border: 1.5px solid #E4E9F5;
    border-radius: 8px;
    background: white;
    color: #586284;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.ct-modal-cancel:hover { background: #F3F4F8; }
.ct-modal-send {
    padding: 9px 20px;
    background: linear-gradient(135deg, #F15B2B, #e04e20);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(241,91,43,0.25);
}
.ct-modal-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(241,91,43,0.35);
}
/* ── MOBILE ADAPTIVE HEADER BUTTON ── */
@media (max-width: 640px) {
    /* Target the link more specifically to override Tailwind */
    header .header-adv-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        min-width: 40px !important;
        gap: 0 !important; /* Remove the gap since text is gone */
    }

    /* Target the span inside specifically */
    header .header-adv-btn span {
        display: none !important;
    }

    /* Adjust the icon */
    header .header-adv-btn svg {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        display: block !important;
    }

    /* Fix header container padding */
    header .max-w-7xl {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Scale logo */
    header img {
        width: 42px !important;
        height: 42px !important;
    }
    
    /* Optional: Hide the "AI Product Search" subtitle on very small phones to save space */
    header p {
        display: none;
    }
}

/* ── FINAL COMPACT & FIXED BRANDED FOOTER ── */
.footer-bl {
    padding: 25px 0 15px !important; 
    background-color: rgba(252, 238, 236, 1) !important;
    color: rgba(52, 62, 97, 1);
    border-top: 1px solid rgba(255, 104, 84, 0.1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.footer-top-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px; 
}

/* Branding Side */
.footer-left { flex: 1; min-width: 280px; }
.f-logo { width: 130px; margin-bottom: 10px; display: block; }
.f-tagline { font-size: 13px; font-weight: 500; margin-bottom: 15px; color: #586284; }

/* Social Icons - Visibility Fix */
.social-icons { 
    display: flex; 
    gap: 8px; 
    margin-top: 8px;
}

.soc-link {
    width: 32px !important; 
    height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px; 
    text-decoration: none !important;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #ffffff !important; /* Forces the icon inside to be white */
}

/* Branded Backgrounds for Icons */
.fb { background-color: #3b5998 !important; }
.tw { background-color: #000000 !important; } 
.ln { background-color: #0077b5 !important; }
.yt { background-color: #ff0000 !important; }

.soc-link:hover { 
    transform: translateY(-3px); 
    filter: brightness(1.1);
}

/* Link Columns Compactness */
.footer-right-columns { display: flex; gap: 40px; }
.col-header { 
    font-size: 10px; 
    font-weight: 800; 
    color: #343E61; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    margin-bottom: 8px !important; 
}
.f-link-list li { margin-bottom: 4px !important; }
.f-link-list a { 
    text-decoration: none; 
    color: #586284; 
    font-weight: 600; 
    font-size: 12px;
    transition: color 0.2s;
}
.f-link-list a:hover { color: #F15B2B; }

/* Copyright Bar - Reduced Height */
.footer-bottom {
    margin-top: 15px !important; 
    padding-top: 10px;
    border-top: 1px solid rgba(52, 62, 97, 0.08);
    text-align: center;
}
.footer-bottom p { font-size: 11px; color: rgba(52, 62, 97, 0.5); margin: 0; }

/* ── MOBILE ADAPTIVE ── */
@media (max-width: 640px) {
    .footer-bl { padding: 20px 0 10px !important; }
    .footer-top-wrap { flex-direction: column; gap: 20px; }
    
    .footer-right-columns { 
        width: 100%; 
        gap: 0; 
        justify-content: space-between; 
    }
    .footer-col { width: 50%; }
    .footer-left { min-width: 100%; }
    .footer-bottom { text-align: left; margin-top: 10px !important; }
}