/* ============================================
   JIC MARKETPLACE - MAIN STYLESHEET
   Domain: jic.my.id
   ============================================ */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --light: #F9FAFB;
    --border: #E5E7EB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.main-header { z-index: 1030; }
.navbar-brand { font-weight: 700; }
.category-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav .nav-link { white-space: nowrap; padding: 0.5rem 1rem; font-size: 0.85rem; }

/* Search */
.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.1);
}
.rounded-pill-start { border-radius: 25px 0 0 25px !important; }
.rounded-pill-end { border-radius: 0 25px 25px 0 !important; }

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}
.product-card .card-img-top {
    transition: transform 0.3s ease;
}
.product-card:hover .card-img-top {
    transform: scale(1.05);
}
.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Product Actions (Quick View, Wishlist, Cart) */
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.product-card:hover .product-actions {
    opacity: 1;
}
.product-actions .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Stock Badge */
.stock-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%); 
}

/* ============================================
   FEATURES
   ============================================ */
.feature-card {
    transition: all 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* ============================================
   CATEGORY CARD
   ============================================ */
.category-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* ============================================
   STAR RATING
   ============================================ */
.star-rating { color: var(--warning); }

/* Star Rating Input */
.star-rating-input { direction: rtl; display: inline-flex; }
.star-rating-input input { display: none; }
.star-rating-input label { cursor: pointer; font-size: 1.5rem; padding: 0 2px; }
.star-rating-input label i { color: #d1d5db; transition: color 0.2s; }
.star-rating-input input:checked ~ label i,
.star-rating-input label:hover i,
.star-rating-input label:hover ~ label i {
    color: var(--warning);
}

/* ============================================
   FOOTER
   ============================================ */
.footer a { transition: color 0.3s; }
.footer a:hover { color: white !important; }

/* ============================================
   BANK ACCOUNT CARD
   ============================================ */
.bank-account {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.bank-account:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* ============================================
   CHAT BUBBLES
   ============================================ */
.chat-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 5px;
    word-wrap: break-word;
}
.chat-bubble.sent {
    background: var(--primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}
.chat-bubble.received {
    background: white;
    border: 1px solid var(--border);
    border-bottom-left-radius: 5px;
}

.chat-room-item {
    cursor: pointer;
    transition: background 0.2s;
}
.chat-room-item:hover {
    background: #f0f0f0;
}
.chat-room-item.active {
    background: #e3f2fd !important;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 12px;
}

/* ============================================
   TABLES
   ============================================ */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border-radius: 12px;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-menu {
    border-radius: 12px;
    margin-top: 10px;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    line-height: 1;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    border: none;
    color: var(--dark);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ============================================
   HOVER SHADOW
   ============================================ */
.hover-shadow {
    transition: all 0.3s ease;
}
.hover-shadow:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* ============================================
   LOADING
   ============================================ */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

#loading-overlay {
    transition: opacity 0.3s ease;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ============================================
   OFFCANVAS
   ============================================ */
.offcanvas {
    width: 280px !important;
}

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.mobile-bottom-nav {
    display: none;
}
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border);
        z-index: 1000;
        padding: 8px 0 5px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    body { padding-bottom: 70px; }
    footer { margin-bottom: 70px; }
}

.mobile-nav-item {
    text-decoration: none;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    padding: 5px 0;
    transition: color 0.3s;
}
.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary);
}

/* ============================================
   LAZY LOAD IMAGES
   ============================================ */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    min-height: 70vh;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.1);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}
.empty-state i {
    font-size: 4rem;
    color: #ccc;
}
.empty-state h5 {
    margin-top: 15px;
    color: #666;
}

/* ============================================
   SOLD OUT OVERLAY
   ============================================ */
.sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sold-out-overlay span {
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.2rem;
}

/* ============================================
   RIBBON (VERIFIED SELLER)
   ============================================ */
.ribbon {
    position: absolute;
    top: 10px;
    right: -5px;
    padding: 5px 15px;
    background: var(--success);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}
.ribbon::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    border: 5px solid transparent;
    border-top-color: #059669;
    border-right-color: #059669;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .main-header,
    .category-nav,
    footer,
    .mobile-bottom-nav,
    .no-print,
    .btn,
    .chatbot-widget {
        display: none !important;
    }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { padding: 0 !important; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease;
}
.animate-slide-up {
    animation: slideInUp 0.5s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
@media (prefers-contrast: high) {
    :root {
        --primary: #0000FF;
        --border: #000000;
    }
}