/**
 * PharmEZ India - Main Application Stylesheet
 * Modern Medical UI & Fast POS Layout with Bootstrap 5 Integration
 */

:root {
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-info: #0284c7;
    --bs-info-rgb: 2, 132, 199;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-body-font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --primary-color: #0f766e;
    --primary-hover: #0d9488;
    --primary-light: #ccfbf1;
    --secondary-color: #0284c7;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-indigo: #6366f1;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --pos-bg: #f8fafc;
    --shelf-empty: #f1f5f9;
    --shelf-occupied: #ecfdf5;
    --shelf-warning: #fffbeb;
    --shelf-danger: #fef2f2;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--pos-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Teal Utilities & Helpers for Bootstrap */
.bg-teal-50 { background-color: #f0fdfa !important; }
.bg-teal-100 { background-color: #ccfbf1 !important; }
.bg-teal-500 { background-color: #14b8a6 !important; }
.bg-teal-600 { background-color: #0d9488 !important; }
.bg-teal-700 { background-color: #0f766e !important; }
.text-teal-300 { color: #5eead4 !important; }
.text-teal-400 { color: #2dd4bf !important; }
.text-teal-600 { color: #0d9488 !important; }
.text-teal-700 { color: #0f766e !important; }
.text-teal-800 { color: #115e59 !important; }
.border-teal-500 { border-color: #14b8a6 !important; }
.border-teal-600 { border-color: #0d9488 !important; }

.btn-teal {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border: 1px solid #0d9488 !important;
}
.btn-teal:hover {
    background-color: #0f766e !important;
    color: #ffffff !important;
    border-color: #0f766e !important;
}

.btn-outline-teal {
    color: #0d9488 !important;
    border-color: #0d9488 !important;
    background-color: transparent !important;
}
.btn-outline-teal:hover {
    background-color: #0d9488 !important;
    color: #ffffff !important;
}

/* Glassmorphism & Modern Cards */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.card-header-custom {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
}

/* Gradient Buttons & Accents */
.btn-primary-gradient {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.btn-success-gradient {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
}

.btn-success-gradient:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    font-weight: 600;
    border-radius: 10px;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #20ba59;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

/* Navbar & Top Bar */
.navbar-custom {
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand-custom {
    font-weight: 800;
    font-size: 1.3rem;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link-custom {
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link-custom.active {
    background: #0d9488 !important;
    color: #ffffff !important;
}

/* POS Interface Specifics */
.pos-wrapper {
    flex: 1;
}

.search-medicine-input {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.85rem 1.2rem;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.search-medicine-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
    background-color: #ffffff;
}

/* Autocomplete Results Dropdown */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-height: 380px;
    overflow-y: auto;
    margin-top: 6px;
}

.autocomplete-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.autocomplete-item:hover, .autocomplete-item.active-item {
    background-color: #f0fdfa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Instant Stock & Purchase Rate Inspector Card */
.stock-inspector-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.stock-inspector-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-pill .label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-pill .val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

/* POS Table Styles */
.table-pos th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
    padding: 12px 10px;
}

.table-pos td {
    padding: 10px;
    vertical-align: middle;
    font-size: 0.92rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-pos tbody tr:hover {
    background-color: #f8fafc;
}

.table-pos input.form-control-sm {
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

/* POS Summary Panel */
.pos-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.grand-total-banner {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 8px 16px -4px rgba(4, 120, 87, 0.3);
}

.grand-total-banner .amount {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Shelf Matrix Styling (A-Z) */
.shelf-letter-tab {
    font-weight: 700;
    min-width: 44px;
    text-align: center;
    border-radius: 10px;
    margin: 3px;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
    transition: all 0.2s ease;
}

.shelf-letter-tab.active {
    background: #0f766e !important;
    color: #ffffff !important;
    border-color: #0f766e !important;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.3);
}

.shelf-slot-box {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    min-height: 125px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.shelf-slot-box:hover {
    border-color: #0d9488;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.shelf-slot-box.empty-slot {
    background: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
}

.shelf-slot-box.occupied-slot {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.shelf-slot-box.low-stock-slot {
    background: #fffbeb;
    border-color: #fde68a;
}

.shelf-slot-box.expired-slot {
    background: #fef2f2;
    border-color: #fecaca;
}

.slot-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Badges & Tags */
.badge-schedule-h {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-schedule-h1 {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #ef4444;
    font-size: 0.7rem;
    font-weight: 800;
}

.badge-otc {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-near-expiry {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    font-weight: 600;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 700;
}

/* Payment Gateway Mock UI */
.upi-qr-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    border: 2px dashed #0d9488;
}

.qr-code-img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    margin: 0 auto;
}

/* Keyboard Shortcut Tooltips */
.kbd-badge {
    background: #334155;
    color: #f8fafc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    font-family: monospace;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Indian GST Summary Table */
.gst-breakdown-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}

/* Form inputs & selections */
.form-control:focus, .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 0.25rem rgba(13, 148, 136, 0.2);
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.88rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
