/**
 * Bottle Storage System - Main Stylesheet
 * Mobile-first responsive design
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    z-index: 1050;
    display: none;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    margin-top: 0.25rem;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.autocomplete-item:hover {
    background-color: var(--light-color);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.mobile-nav .nav-link i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.mobile-nav .nav-link.active {
    color: var(--primary-color);
}

.mobile-nav .nav-link:hover {
    color: var(--primary-color);
}

/* Content padding for fixed bottom nav */
.content-wrapper {
    padding-bottom: 80px;
}

/* Card Styles */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Bottle Card */
.bottle-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.bottle-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottle-card .percentage-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.bottle-card .percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--info-color));
    transition: width 0.3s;
}

/* Customer Card */
.customer-card .stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.customer-card .stat-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.customer-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.customer-card .stat-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

/* Dashboard Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

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

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--border-radius);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius);
}

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

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

/* Offcanvas (Mobile Menu) */
.offcanvas {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Search Bar */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 2.5rem;
}

.search-bar i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Pagination */
.pagination {
    margin-top: 1rem;
}

/* Responsive Utilities */
@media (max-width: 767.98px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .card {
        border-radius: var(--border-radius);
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
    
    .mobile-nav {
        display: none;
    }
    
    .content-wrapper {
        padding-bottom: 0;
    }
}

/* PWA Install Button */
.pwa-install-prompt {
    position: fixed;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 999;
    animation: slideUp 0.3s;
}

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

/* QR Code Container */
.qr-code-container {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
}

.qr-code-container canvas {
    max-width: 100%;
    height: auto;
}

/* Print Styles */
@media print {
    .mobile-nav,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}
