/**
 * Inventory Management System Styles
 * Custom CSS for the application
 */

/* Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
}

/* Navigation */
.navbar {
    background-color: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--text-primary);
}

.navbar-nav .nav-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    background-color: var(--dropdown-bg);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Cards */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: var(--box-shadow);
    background-color: var(--card-bg);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}

.card-body {
    color: var(--text-primary);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    border-top: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

/* Forms */
.form-control {
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 0;
}

.form-select {
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Theme Toggle Button */
#themeToggle {
    position: relative;
    transition: var(--transition);
}

#themeToggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

#themeIcon {
    transition: var(--transition);
}

/* Theme text visibility */
@media (max-width: 767px) {
    .d-md-inline {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .d-none.d-md-inline {
        display: inline !important;
    }
}
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    font-size: 0.875rem;
}

.btn-lg {
    font-size: 1.125rem;
    padding: 0.75rem 1.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: var(--border-radius);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 500;
}

.page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* POS Specific Styles */
.pos-container {
    height: calc(100vh - 200px);
}

.pos-products {
    overflow-y: auto;
}

.pos-cart {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
}

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

.product-card {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.product-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.product-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.product-price {
    color: var(--success-color);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.product-stock {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.low-stock-badge {
    background-color: var(--warning-color);
    color: #212529;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--box-shadow);
}

.cart-item-info {
    flex: 1;
    margin-right: 1rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.quantity-display {
    min-width: 35px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.pos-summary {
    border-top: 2px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.summary-row.total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.payment-methods {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.payment-methods label {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    margin-bottom: 0;
}

.payment-methods input[type="radio"] {
    display: none;
}

.payment-methods input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pos-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pos-actions button {
    flex: 1;
}

/* Dashboard Styles */
.dashboard-card {
    border-left: 4px solid var(--primary-color);
}

.dashboard-card.success {
    border-left-color: var(--success-color);
}

.dashboard-card.warning {
    border-left-color: var(--warning-color);
}

.dashboard-card.danger {
    border-left-color: var(--danger-color);
}

.dashboard-card.info {
    border-left-color: var(--info-color);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.online {
    background-color: var(--success-color);
}

.status-indicator.offline {
    background-color: var(--danger-color);
}

.status-indicator.warning {
    background-color: var(--warning-color);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* General Layout */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Container and Spacing */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        padding: 0.25rem 0;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* POS System */
    .pos-container {
        flex-direction: column;
        height: auto;
        padding: 0.5rem;
    }
    
    .pos-products {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .pos-cart {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .product-card {
        padding: 0.75rem;
        min-height: 120px;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
    }
    
    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .product-name {
        font-size: 0.75rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
        height: 2.4em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .product-price {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .product-stock {
        font-size: 0.7rem;
        color: #6c757d;
    }
    
    /* Cart Items */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .cart-item-info {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .cart-item-price {
        font-weight: 600;
        font-size: 1rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.875rem;
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .table {
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        vertical-align: middle;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        touch-action: manipulation; /* Improves touch responsiveness */
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.375rem;
    }
    
    .form-select {
        font-size: 16px;
        padding: 0.75rem;
    }
    
    .form-label {
        font-weight: 500;
        margin-bottom: 0.5rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Dashboard Cards */
    .dashboard-card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .dashboard-card .card-body {
        padding: 1.25rem;
    }
    
    .dashboard-card h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-card p {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0;
        text-align: center;
    }
    
    /* Print button for reports */
    .print-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

@media (max-width: 576px) {
    /* Extra Small Devices */
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
    }
    
    /* Cards */
    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.25rem;
        padding: 0.25rem;
    }
    
    .product-card {
        padding: 0.5rem;
        min-height: 100px;
        border-radius: 0.375rem;
    }
    
    .product-name {
        font-size: 0.7rem;
        line-height: 1.1;
        margin-bottom: 0.25rem;
        height: 2.2em;
    }
    
    .product-price {
        font-size: 0.875rem;
        margin-bottom: 0.125rem;
    }
    
    .product-stock {
        font-size: 0.65rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        border: 1px solid #dee2e6;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Keep 16px to prevent zoom */
        padding: 0.6rem;
    }
    
    .form-select {
        padding: 0.6rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
    
    /* Dashboard */
    .dashboard-card .card-body {
        padding: 1rem;
    }
    
    .dashboard-card h3 {
        font-size: 1.25rem;
    }
    
    .dashboard-card p {
        font-size: 0.8rem;
    }
    
    /* Cart */
    .cart-item {
        padding: 0.5rem;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
    }
    
    /* Print button */
    .print-button {
        bottom: 15px;
        right: 15px;
    }
    
    .print-button .btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Large Tablets and Small Desktops */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .product-card {
        min-height: 140px;
        padding: 1rem;
    }
    
    .pos-container {
        padding: 1rem;
    }
    
    .dashboard-card {
        margin-bottom: 1.5rem;
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .product-card,
    .nav-link {
        min-height: 44px; /* iOS touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-card {
        min-height: auto;
        padding: 1rem;
    }
    
    .btn-sm {
        min-height: 32px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    
    .product-card {
        min-height: 90px;
        padding: 0.5rem;
    }
    
    .product-name {
        font-size: 0.65rem;
        height: 1.9em;
    }
    
    .modal-dialog {
        margin: 0.5rem auto;
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card {
        border-width: 0.5px;
    }
    
    .table th,
    .table td {
        border-width: 0.5px;
    }
}

/* Dark Mode Support for Mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .product-card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .table-responsive {
        background-color: #2d3748;
        color: #e2e8f0;
    }
}

/* Mobile Touch Improvements */
@media (max-width: 768px) {
    /* Fast tap response */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for inputs and text areas */
    input, textarea, select, [contenteditable] {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent horizontal scrolling */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Better button touch feedback */
    .btn, .product-card, .nav-link {
        -webkit-transition: all 0.1s ease;
        transition: all 0.1s ease;
    }
    
    .btn:active, .product-card:active, .nav-link:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    /* Mobile input focus */
    .form-control:focus, .form-select:focus {
        -webkit-appearance: none;
        outline: 0;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    }
    
    /* Mobile table improvements */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-y: hidden;
        overflow-x: auto;
    }
    
    /* Mobile modal improvements */
    .modal {
        padding-right: 0 !important;
    }
    
    .modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Mobile dropdown improvements */
    .dropdown-menu {
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile pagination improvements */
    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile search improvements */
    .form-control[type="search"] {
        -webkit-appearance: none;
        border-radius: 2rem;
    }
    
    /* Mobile loading states */
    .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    /* Mobile tooltip improvements */
    .tooltip {
        font-size: 0.75rem;
    }
    
    /* Mobile badge improvements */
    .badge {
        font-size: 0.7rem;
        padding: 0.35em 0.6em;
    }
    
    /* Mobile alert improvements */
    .alert {
        border-radius: 0.5rem;
        margin: 0.5rem 0;
    }
    
    /* Mobile progress improvements */
    .progress {
        height: 0.5rem;
        border-radius: 0.25rem;
    }
    
    /* Mobile list group improvements */
    .list-group-item {
        padding: 0.75rem 1rem;
        border-width: 1px;
    }
    
    /* Mobile breadcrumb improvements */
    .breadcrumb {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Mobile card group improvements */
    .card-group .card {
        margin-bottom: 1rem;
    }
    
    /* Mobile accordion improvements */
    .accordion-button {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
    
    /* Mobile carousel improvements */
    .carousel-control-prev,
    .carousel-control-next {
        width: 15%;
    }
    
    .carousel-indicators li {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin: 0 2px;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        /* iOS Safari viewport fix */
        body {
            min-height: -webkit-fill-available;
        }
        
        /* iOS input zoom fix */
        .form-control {
            font-size: 16px !important;
        }
        
        /* iOS modal fix */
        .modal {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
        
        /* iOS dropdown fix */
        .dropdown-menu {
            position: fixed !important;
        }
        
        /* iOS navbar fix */
        .navbar {
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
    }
}

/* Android Specific Fixes */
@media (max-width: 768px) {
    /* Android Chrome address bar fix */
    body {
        min-height: 100vh;
    }
    
    /* Android button fix */
    .btn {
        border-radius: 4px;
        border: 1px solid transparent;
    }
    
    /* Android input fix */
    .form-control {
        border-radius: 4px;
    }
}

/* Small Screen Optimizations */
@media (max-width: 320px) {
    /* iPhone SE and similar small screens */
    .container {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.2rem;
    }
    
    .product-card {
        min-height: 80px;
        padding: 0.4rem;
    }
    
    .product-name {
        font-size: 0.65rem;
        height: 2em;
    }
    
    .product-price {
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .table {
        font-size: 0.7rem;
    }
    
    .table th,
    .table td {
        padding: 0.2rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .pagination,
    .modal,
    .alert-dismissible {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .table {
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12px;
        line-height: 1.2;
    }
}

/* Utility Classes */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-break {
    word-wrap: break-word;
    word-break: break-word;
}

.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
