/* ============================================================
   Vyaapar.com - Main Stylesheet
   ============================================================ */

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #64748B;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --dark: #1E293B;
    --light: #F8FAFC;
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease;
}

/* ─── BASE ────────────────────────────────────────────────── */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    background-color: var(--light);
    line-height: 1.6;
}

a { color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ─── TOP BAR ─────────────────────────────────────────────── */

.top-bar {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.location-badge {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: var(--transition);
}

.location-badge:hover {
    background: rgba(255,255,255,0.2);
}

/* ─── NAVBAR ──────────────────────────────────────────────── */

.navbar {
    padding: 0.6rem 0;
    z-index: 1040;
}

.navbar-brand img {
    transition: var(--transition);
}

.nav-link {
    font-weight: 500;
    font-size: 1.05rem;
    padding: 0.5rem 0.8rem !important;
    color: var(--dark) !important;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.8rem;
    right: 0.8rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* ─── SEARCH ──────────────────────────────────────────────── */

#headerSearch {
    width: 200px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

#headerSearch:focus {
    width: 280px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
}

.search-suggestions .suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.search-suggestions .suggestion-item:hover {
    background: var(--primary-light);
}

/* ─── BUTTONS ─────────────────────────────────────────────── */

.btn { font-weight: 500; font-size: 0.9rem; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.75rem; }

/* ─── CARDS ───────────────────────────────────────────────── */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body { padding: 1.25rem; }

/* ─── HERO SECTION ────────────────────────────────────────── */

.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: #fff;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section .container { position: relative; z-index: 1; }

.hero-search {
    max-width: 700px;
    margin: 0 auto;
}

.hero-search .input-group {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-radius: 50px;
    overflow: hidden;
}

.hero-search .form-control {
    border: none;
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
}

.hero-search .btn {
    padding: 0.9rem 1.5rem;
    font-weight: 600;
}

/* ─── SECTION HEADINGS ────────────────────────────────────── */

.section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-heading h2 {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-heading p {
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ─── CATEGORY CARDS ──────────────────────────────────────── */

.category-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #fff;
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark);
    display: block;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    color: var(--primary);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--primary);
}

.category-card span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ─── SELLER CARDS ────────────────────────────────────────── */

.seller-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #fff;
    overflow: hidden;
    transition: var(--transition);
}

.seller-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.seller-card .card-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-light), #EDE9FE);
    position: relative;
}

.seller-card .card-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    position: absolute;
    bottom: -30px;
    left: 1rem;
    background: #fff;
    object-fit: cover;
}

.seller-card .card-body {
    padding-top: 2rem;
}

.seller-card .seller-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.seller-card .seller-category {
    font-size: 0.8rem;
    color: var(--secondary);
}

.seller-card .seller-rating {
    color: var(--warning);
    font-size: 0.85rem;
}

.seller-card .badge-verified {
    background: var(--success);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.seller-card .badge-featured {
    background: var(--warning);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

/* ─── TRUST SCORE ─────────────────────────────────────────── */

.trust-meter {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 3px;
    overflow: hidden;
}

.trust-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.trust-score-low .trust-meter-fill { background: var(--danger); }
.trust-score-mid .trust-meter-fill { background: var(--warning); }
.trust-score-high .trust-meter-fill { background: var(--success); }

/* ─── BADGE DISPLAY ───────────────────────────────────────── */

.badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 2px solid;
}

.badge-list .badge-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f1f5f9;
}

/* ─── STATS CARDS ─────────────────────────────────────────── */

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--secondary);
}

/* ─── FOOTER ──────────────────────────────────────────────── */

footer { font-size: 0.95rem; }
footer h6 { font-size: 1.05rem; }
footer .small, footer ul.small { font-size: 0.9rem !important; }
footer a:hover { color: #fff !important; }

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────── */

.toast-custom {
    min-width: 280px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── FORMS ───────────────────────────────────────────────── */

.form-control, .form-select {
    border-color: var(--border);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

/* ─── PRICING CARDS ───────────────────────────────────────── */

.pricing-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: #fff;
    text-align: center;
    padding: 2rem 1.5rem;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card .btn {
    margin-top: auto;
}

.pricing-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.pricing-card .price small {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--secondary);
}

/* ─── TABLES ──────────────────────────────────────────────── */

.table { font-size: 0.85rem; }
.table th { font-weight: 600; color: var(--secondary); border-color: var(--border); }
.table td { border-color: #f1f5f9; vertical-align: middle; }

/* ─── MODAL ───────────────────────────────────────────────── */

.modal-content { border: none; border-radius: var(--radius-lg); }
.modal-header { border-bottom-color: var(--border); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero-section { padding: 2.5rem 0; }
    .hero-section h1 { font-size: 1.75rem; }
    #headerSearch { width: 150px; }
    #headerSearch:focus { width: 200px; }
    .section-heading h2 { font-size: 1.4rem; }
}

/* ─── LOADING SPINNER ─────────────────────────────────────── */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── SCROLLBAR ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
