/* Custom styles for Gym KPI */
/* Professional KPI dashboard with modern branding */

:root {
    --gym-primary: #2563eb;
    --gym-secondary: #6366f1;
    --gym-accent: #f59e0b;
    --gym-success: #10b981;
    --gym-warning: #f59e0b;
    --gym-danger: #ef4444;
    --gym-info: #06b6d4;
    --gym-dark: var(--bs-dark);
    --gym-light: var(--bs-light);
    --gym-gradient: linear-gradient(135deg, #2563eb, #6366f1);
    --gym-gradient-accent: linear-gradient(135deg, #f59e0b, #ef4444);
    --kpi-brand: #1e40af;
    --kpi-highlight: #fbbf24;
}

/* Body and general styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Custom card styling */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

/* Product cards in POS */
.product-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

/* Custom button styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-gym-primary {
    background: var(--gym-gradient);
    border: none;
    color: white;
}

.btn-gym-primary:hover {
    background: linear-gradient(135deg, var(--bs-primary-dark), var(--bs-info-dark));
    color: white;
}

/* Navigation styling */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    background: var(--gym-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand .fas {
    color: var(--kpi-highlight);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Dashboard stats cards */
.stats-card {
    background: var(--gym-gradient);
    border: none;
    color: white;
}

.stats-card .card-body {
    text-align: center;
    padding: 2rem;
}

.stats-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Table styling */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* Low stock alerts */
.low-stock-alert {
    border-left: 4px solid var(--bs-warning);
    background-color: rgba(var(--bs-warning-rgb), 0.1);
}

.out-of-stock-alert {
    border-left: 4px solid var(--bs-danger);
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

/* Cart styling */
.cart-sticky {
    position: sticky;
    top: 2rem;
}

.cart-item {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.75rem 0;
}

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

/* POS specific styling */
.pos-container {
    min-height: calc(100vh - 200px);
}

.product-grid {
    max-height: 70vh;
    overflow-y: auto;
}

.cart-sidebar {
    max-height: 70vh;
    overflow-y: auto;
}

/* Form styling */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

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

/* Badge customizations */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
}

.badge-status {
    font-size: 0.8em;
    padding: 0.4em 0.8em;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

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

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Modal customizations */
.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-light);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-light);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    .no-print,
    .modal,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 1rem;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .table {
        font-size: 12px;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .pos-container {
        min-height: auto;
    }
    
    .product-grid,
    .cart-sidebar {
        max-height: none;
        overflow-y: visible;
    }
    
    .cart-sticky {
        position: relative;
        top: auto;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Custom animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Success/Error states */
.success-state {
    border-left: 4px solid var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

.error-state {
    border-left: 4px solid var(--bs-danger);
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

/* Stock level indicators */
.stock-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.stock-indicator.in-stock {
    background-color: var(--bs-success);
}

.stock-indicator.low-stock {
    background-color: var(--bs-warning);
}

.stock-indicator.out-of-stock {
    background-color: var(--bs-danger);
}

/* Quick action buttons */
.quick-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.quick-actions .btn {
    margin-bottom: 0.5rem;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Data visualization enhancements */
.metric-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-info-rgb), 0.1));
    border-radius: 1rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--bs-primary);
}

.metric-label {
    font-size: 0.9rem;
    color: var(--bs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login page styling */
.login-container {
    min-height: 100vh;
    background: var(--gym-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    backdrop-filter: blur(10px);
    background: rgba(var(--bs-dark-rgb), 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Utility classes */
.text-gym-accent {
    color: var(--gym-accent) !important;
}

.bg-gym-accent {
    background-color: var(--gym-accent) !important;
}

.border-gym-accent {
    border-color: var(--gym-accent) !important;
}

.shadow-gym {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.rounded-gym {
    border-radius: 1rem !important;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bs-dark);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary-dark);
}

/* Category cards styling */
.category-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 200px;
}

.category-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.05), rgba(var(--bs-info-rgb), 0.05));
}

.category-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 180px;
}

.category-card i {
    transition: all 0.3s ease;
}

.category-card:hover i {
    transform: scale(1.1);
}

.category-card .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* POS layout improvements */
.pos-products-section {
    max-height: 75vh;
    overflow-y: auto;
}

.pos-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* Loading animation for POS */
.pos-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.pos-loading i {
    margin-bottom: 1rem;
    color: var(--bs-primary);
}

/* KPI Branding Elements */
.kpi-brand {
    background: var(--gym-gradient);
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.kpi-highlight {
    color: var(--kpi-highlight);
    font-weight: 600;
}

.brand-card {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gym-gradient) border-box;
}

[data-bs-theme="dark"] .brand-card {
    background: linear-gradient(var(--bs-dark), var(--bs-dark)) padding-box,
                var(--gym-gradient) border-box;
}

/* Enhanced login page */
.login-container {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #6366f1 100%);
    min-height: 100vh;
}

.login-card .card-header h3 {
    background: var(--gym-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* KPI Dashboard enhancements */
.kpi-metric {
    background: var(--gym-gradient);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kpi-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.kpi-value {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.kpi-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}
