/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

/* Arabic Font and RTL Support */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  text-align: right;
}

/* RTL Support for Bootstrap */
.text-right {
  text-align: left !important;
}

.text-left {
  text-align: right !important;
}

.float-left {
  float: right !important;
}

.float-right {
  float: left !important;
}

.ml-auto, .mx-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

.mr-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}

.pl-3, .px-3 {
  padding-right: 1rem !important;
  padding-left: 0 !important;
}

.pr-3, .px-3 {
  padding-left: 1rem !important;
  padding-right: 0 !important;
}

/* Currency Display */
.currency {
  font-weight: 500;
  color: #28a745;
}

a.navbar-brand {
  white-space: normal;
  text-align: center;
  word-break: break-all;
}

/* Provide sufficient contrast against white background */
a {
  color: #0366d6;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  font-size: 14px;
}
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.border-top {
  border-top: 1px solid #e5e5e5;
}
.border-bottom {
  border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
  font-size: 1rem;
}

/* POS System Styles */
.pos-container {
  background-color: #f8f9fa;
  min-height: 100vh;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.product-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
}

.product-price {
  font-size: 16px;
  font-weight: bold;
  color: #28a745;
  margin-bottom: 5px;
}

.product-stock {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 10px;
}

.product-actions {
  margin-top: 10px;
}

.add-to-cart-btn {
  width: 100%;
  font-size: 12px;
  padding: 6px 12px;
}

.cart-item {
  border-bottom: 1px solid #dee2e6;
  padding: 10px;
}

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

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quantity-btn {
  width: 25px;
  height: 25px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #e9ecef;
}

.search-highlight {
  background-color: #fff3cd;
  padding: 1px 2px;
  border-radius: 2px;
  line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}

body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px; /* Vertically center the text there */
}

/* Custom styles for POS and RTL */
.pos-container {
  max-width: 1400px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.product-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.product-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.product-card.selected {
  border-color: #28a745;
  background-color: #d4edda;
}

.product-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.product-price {
  color: #28a745;
  font-size: 1.1em;
  font-weight: bold;
}

.product-stock {
  font-size: 0.9em;
  color: #6c757d;
}

.cart-item {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}

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

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #f8f9fa;
}

.barcode-input {
  font-size: 1.2em;
  text-align: center;
  border: 2px solid #007bff;
  border-radius: 8px;
  padding: 15px;
}

.search-highlight {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
}

.low-stock-alert {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.receipt-print {
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: center;
    max-width: 300px;
    margin: 0 auto;
}

.receipt-header {
    border-bottom: 2px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-footer {
    border-top: 2px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
}

/* RTL specific fixes */
.dropdown-menu:not(.dropdown-menu-end) {
    right: 0 !important;
    left: auto !important;
}

.dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
}

.dropdown-menu-start {
    right: 0 !important;
    left: auto !important;
}

.text-rtl {
    text-align: right !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .product-card {
        padding: 10px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-nav {
        width: 100%;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        width: 100% !important;
        right: 0 !important;
        left: 0 !important;
        border: none;
        box-shadow: none;
        background: rgba(0,0,0,0.1);
    }

    .navbar-nav .dropdown-menu .dropdown-item {
        color: rgba(255,255,255,0.85) !important;
        padding-right: 2rem;
    }

    .navbar-nav .dropdown-menu .dropdown-item:hover {
        background: rgba(255,255,255,0.1) !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .receipt-print {
        font-size: 12px;
    }
}

/* ===== CLINIC SIDEBAR & LAYOUT ===== */
.clinic-sidebar {
    width: 250px;
    background: #1a2332;
    min-height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.clinic-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.clinic-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
}

.clinic-sidebar-logo i {
    color: #4a9eff;
    font-size: 1.3rem;
}

.clinic-sidebar-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clinic-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.clinic-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.clinic-nav-link.active {
    color: #fff;
    background: rgba(74,158,255,0.15);
}

.clinic-nav-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.clinic-nav-section {
    color: rgba(255,255,255,0.35);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 14px 6px;
    letter-spacing: .5px;
}

.clinic-topbar {
    background: #1a2332;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.clinic-topbar-title {
    color: rgba(255,255,255,0.85);
    font-size: .95rem;
    font-weight: 600;
}

.clinic-user-btn {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: .9rem;
    transition: background .15s;
    cursor: pointer;
}

.clinic-user-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.clinic-content {
    padding: 20px;
    min-height: calc(100vh - 56px);
    background: #f6f7f9;
}

.clinic-mobile-nav {
    background: #1a2332;
    color: #fff;
    max-width: 280px;
}

.clinic-mobile-nav .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.clinic-mobile-nav .offcanvas-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.clinic-mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clinic-mobile-nav .clinic-nav-link {
    padding: 14px 16px;
    font-size: 1rem;
}

@media (max-width: 991.98px) {
    .clinic-content {
        padding: 12px;
    }
}

@media (max-width: 575.98px) {
    .clinic-content {
        padding: 8px;
    }
}
