/* Clean Light-Theme Stylesheet for SmartKirana B2B Marketplace (DistMan) */
/* Inspired by Flipkart, Amazon, and Udaan B2B layouts */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    /* Light Theme Color System */
    --bg-light-body: #f1f3f6;
    --bg-white-card: #ffffff;
    --text-dark-primary: #212121;
    --text-dark-secondary: #666666;
    --text-light-muted: #878787;
    --border-light: #e0e0e0;
    
    /* Marketplace B2B Colors */
    --b2b-blue: #2874f0;      /* Flipkart primary blue */
    --b2b-orange: #fb641b;    /* Flipkart action orange */
    --b2b-yellow: #ff9f00;    /* Flipkart secondary gold */
    --b2b-green: #388e3c;     /* Wholesale savings green */
    
    /* Admin/Distributor Colors */
    --admin-purple: #6200ea;
    --distributor-teal: #00796b;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-light-body);
    color: var(--text-dark-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-dark-primary);
}

/* Simple Clean Cards (Replaces glassmorphism) */
.glass-card {
    background-color: var(--bg-white-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: var(--text-dark-primary) !important;
}

/* Force dark text for readability inside white cards */
.glass-card .text-light,
.glass-card .text-white,
.glass-card .form-label.text-light,
.glass-card .form-label {
    color: var(--text-dark-primary) !important;
}

.glass-card .text-muted,
.glass-card .text-secondary {
    color: var(--text-dark-secondary) !important;
}

.glass-card .list-group-item.text-light {
    color: var(--text-dark-primary) !important;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Auth Pages Styling */
.auth-container {
    max-width: 480px;
    margin: 3rem auto;
}

/* Form inputs for Layman Retailers */
.form-control, .form-select {
    background-color: #ffffff;
    border: 1px solid #c2c2c2;
    color: var(--text-dark-primary);
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: var(--b2b-blue);
    color: var(--text-dark-primary);
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark-primary);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control::placeholder {
    color: var(--text-light-muted);
}

/* B2B Flipkart-Style Top Navbar */
.navbar-custom {
    background-color: var(--b2b-blue);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.6rem;
    color: #ffffff !important;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff !important;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* Large layperson button styling */
.btn-retailer {
    background-color: var(--b2b-orange);
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-retailer:hover {
    background-color: #e2560e;
    color: #ffffff;
}

.btn-retailer:active {
    transform: scale(0.98);
}

.btn-distributor {
    background-color: var(--b2b-green);
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
    transition: background-color 0.2s ease;
}

.btn-distributor:hover {
    background-color: #2e7d32;
    color: #ffffff;
}

.btn-admin {
    background-color: var(--b2b-blue);
    color: #ffffff;
    border: none;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
}

.btn-admin:hover {
    background-color: #1254cb;
    color: #ffffff;
}

/* Brand storefront banner (Simple and bright) */
.storefront-banner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.storefront-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.storefront-banner-overlay h2 {
    color: #ffffff !important;
}

/* Product Card Styling (Flipkart inspired grid card) */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--border-light);
}

.product-img-container {
    height: 150px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    position: relative;
}

.product-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Aapki Bachat (Savings) badge */
.product-savings-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--b2b-green);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0 4px 4px 0;
}

/* Pricing presentation */
.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark-primary);
}

.product-mrp {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: var(--text-light-muted);
    margin-left: 0.35rem;
}

.bachat-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--b2b-green);
    background-color: #e8f5e9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Status badging (layman colors) */
.status-pill {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.status-pending { background-color: #fff9c4; color: #f57f17; border: 1px solid #fbc02d; }
.status-approved, .status-verified, .status-delivered { background-color: #c8e6c9; color: #1b5e20; border: 1px solid #81c784; }
.status-rejected, .status-cancelled { background-color: #ffcdd2; color: #b71c1c; border: 1px solid #e57373; }
.status-accepted { background-color: #bbdefb; color: #0d47a1; border: 1px solid #64b5f6; }
.status-out_for_delivery { background-color: #e1bee7; color: #4a148c; border: 1px solid #ba68c8; }

/* Flat styled summary box */
.stat-card {
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 5px solid var(--border-light) !important;
}

.stat-card.border-success { border-left-color: var(--b2b-green) !important; }
.stat-card.border-warning { border-left-color: var(--b2b-orange) !important; }
.stat-card.border-primary { border-left-color: var(--b2b-blue) !important; }
.stat-card.border-info { border-left-color: #0288d1 !important; }

/* Tables in Light theme */
.table-custom {
    color: var(--text-dark-primary) !important;
    background-color: #ffffff;
}

.table-custom th {
    background-color: #f9f9f9 !important;
    color: var(--text-dark-secondary) !important;
    border-bottom: 2px solid var(--border-light) !important;
    font-family: var(--font-display);
    font-weight: 600;
    padding: 12px;
}

.table-custom td {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 12px;
    color: var(--text-dark-primary) !important;
}

.table-custom tr:hover td {
    background-color: #f5f5f5 !important;
}

/* Layout spacing */
footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-light);
    color: var(--text-dark-secondary);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .glass-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border: 0;
    }
    
    .form-control, .form-select {
        padding: 0.65rem 0.8rem;
    }
    
    .btn-retailer, .btn-distributor, .btn-admin {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }
}

/* Print Invoice Stylesheet */
@media print {
    /* Hide headers, footers, buttons, and navigation */
    nav, .navbar, footer, .btn, button, .btn-outline-light, .no-print, hr, .alert {
        display: none !important;
    }
    
    /* Document Layout */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 10px !important;
        font-family: Arial, sans-serif !important;
    }
    
    .container, .row, [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }
    
    /* Reset glassmorphism styles for clean printing */
    .glass-card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Invoice Structure */
    .print-invoice-wrapper {
        display: block !important;
        width: 100%;
        border: 1px solid #000000;
        padding: 20px;
    }
    
    .print-header {
        text-align: center;
        border-bottom: 1px solid #000000;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }
    
    .print-header h1 {
        font-size: 18pt;
        font-weight: bold;
        margin: 0;
        text-transform: uppercase;
    }
    
    .print-header p {
        font-size: 9.5pt;
        margin: 2px 0;
    }
    
    .print-billing-grid {
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;
        font-size: 9.5pt;
    }
    
    .print-billing-col {
        width: 48%;
    }
    
    .print-billing-col h6 {
        font-size: 10pt;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 1px dashed #000000;
        padding-bottom: 3px;
        margin-bottom: 5px;
        color: #000000 !important;
    }
    
    /* Table Styling */
    .table-custom {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 15px !important;
    }
    
    .table-custom th, .table-custom td {
        border: 1px solid #000000 !important;
        padding: 6px 8px !important;
        font-size: 9.5pt !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        text-align: left;
    }
    
    .table-custom th {
        font-weight: bold !important;
        text-transform: uppercase !important;
        background-color: #f2f2f2 !important;
    }
    
    .table-custom td.text-end, .table-custom th.text-end {
        text-align: right !important;
    }
    
    .table-custom td.text-center, .table-custom th.text-center {
        text-align: center !important;
    }

    .print-summary-box {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
    }
    
    .print-summary-table {
        width: 45%;
        border-collapse: collapse;
    }
    
    .print-summary-table td {
        border: 1px solid #000000;
        padding: 6px 8px;
        font-size: 9.5pt;
        color: #000000;
    }
    
    .print-summary-table td.label {
        font-weight: bold;
    }
    
    .print-signature-row {
        display: flex;
        justify-content: space-between;
        margin-top: 40px;
        font-size: 9.5pt;
    }
    
    .print-signature-box {
        width: 45%;
        text-align: center;
    }
    
    .print-signature-line {
        border-top: 1px solid #000000;
        margin-top: 45px;
        padding-top: 5px;
        font-weight: bold;
    }
}

