/* Minimal Retail Management System Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: var(--white) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

header h1 {
    font-weight: 600;
    color: var(--text-primary);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Navigation Pills */
.nav-pills {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    border-radius: 50px;
    padding: 0.25rem;
}

.nav-pills .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.nav-pills .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

.nav-pills .nav-link.active {
    color: var(--white);
    background-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.rounded-pill {
    border-radius: 50px !important;
}

/* Table Styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.04);
}

/* Metric Cards */
.metric-card {
    text-align: center;
    padding: 1.5rem;
}

.metric-card i {
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}

.badge-success {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-md);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem;
}

.alert-info {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.alert-success {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.alert-warning {
    background-color: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.alert-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

/* Action Buttons */
.table-actions {
    white-space: nowrap;
    min-width: 200px;
}

.table-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
}

.table-actions .btn:last-child {
    margin-right: 0;
}

.table-actions .btn i {
    flex-shrink: 0;
}

.table-actions .btn span {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-pills {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .nav-pills .nav-link {
        border-radius: 8px;
        margin-bottom: 0.25rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
    }
    
    /* Show only icons on small screens for action buttons */
    .table-actions .btn span {
        display: none;
    }
    
    .table-actions .btn {
        min-width: 32px;
        padding: 0.375rem;
        margin-right: 0.125rem;
    }
}

@media (max-width: 576px) {
    /* Stack action buttons vertically on very small screens */
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        min-width: auto;
    }
    
    .table-actions .btn {
        margin-right: 0;
        justify-content: flex-start;
    }
    
    .table-actions .btn span {
        display: inline;
        margin-left: 0.5rem;
    }
}

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

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

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

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

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

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

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

.border-0 {
    border: none !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

/* ===== TABLE STYLING ===== */

/* Enhanced table appearance */
.table {
    background-color: white;  /* White background for clean look */
    border-radius: 10px;  /* Rounded corners to match card design */
    overflow: hidden;  /* Hide content that extends beyond border radius */
}

/* Table header styling */
.table thead th {
    background-color: #f8f9fa;  /* Light gray background for headers */
    border: none;  /* Remove default borders */
    font-weight: 600;  /* Semi-bold text for headers */
    color: #495057;  /* Dark gray text color */
}

/* ===== BUTTON STYLING ===== */

/* Enhanced button appearance */
.btn {
    border-radius: 20px;  /* Rounded buttons for modern look */
    font-weight: 500;  /* Medium font weight */
}

/* Small button variant */
.btn-sm {
    border-radius: 15px;  /* Smaller radius for small buttons */
}

/* ===== MODAL STYLING ===== */

/* Modal content container */
.modal-content {
    border: none;  /* Remove default border */
    border-radius: 15px;  /* Rounded corners for modern appearance */
}

/* Modal header styling */
.modal-header {
    background-color: #007bff;  /* Primary blue background */
    color: white;  /* White text for contrast */
    border-radius: 15px 15px 0 0;  /* Rounded top corners only */
}

/* ===== FORM STYLING ===== */

/* Form control input styling */
.form-control {
    border-radius: 10px;  /* Rounded input fields */
    border: 1px solid #ced4da;  /* Light gray border */
}

/* Form control focus state */
.form-control:focus {
    border-color: #007bff;  /* Blue border on focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);  /* Blue glow effect */
}

/* ===== ALERT AND NOTIFICATION STYLING ===== */

/* Enhanced alert styling */
.alert {
    border-radius: 10px;  /* Rounded corners for alerts */
    border: none;  /* Remove default border */
}

/* Badge component styling */
.badge {
    font-size: 0.75em;  /* Smaller font size for badges */
    padding: 0.375rem 0.75rem;  /* Comfortable padding */
}

/* ===== STATUS-SPECIFIC STYLING ===== */

/* Order status color coding */
.status-pending {
    background-color: #ffc107;  /* Yellow background for pending status */
    color: #212529;  /* Dark text for readability */
}

.status-completed {
    background-color: #28a745;  /* Green background for completed status */
    color: white;  /* White text for contrast */
}

.status-shipped {
    background-color: #17a2b8;  /* Blue background for shipped status */
    color: white;  /* White text for contrast */
}

.status-cancelled {
    background-color: #dc3545;  /* Red background for cancelled status */
    color: white;  /* White text for contrast */
}

/* ===== INVENTORY STATUS ALERTS ===== */

/* Low stock alert styling */
.low-stock {
    background-color: #fff3cd;  /* Light yellow background */
    border-left: 4px solid #ffc107;  /* Yellow left border for emphasis */
    padding: 10px;  /* Internal spacing */
    margin-bottom: 10px;  /* Space below alert */
    border-radius: 5px;  /* Rounded corners */
}

/* Out of stock alert styling */
.out-of-stock {
    background-color: #f8d7da;  /* Light red background */
    border-left: 4px solid #dc3545;  /* Red left border for emphasis */
    padding: 10px;  /* Internal spacing */
    margin-bottom: 10px;  /* Space below alert */
    border-radius: 5px;  /* Rounded corners */
}

/* ===== PROMOTION STATUS STYLING ===== */

/* Active promotion styling */
.promotion-active {
    background-color: #d4edda;  /* Light green background */
    border-left: 4px solid #28a745;  /* Green left border */
    padding: 10px;  /* Internal spacing */
    margin-bottom: 10px;  /* Space below alert */
    border-radius: 5px;  /* Rounded corners */
}

/* Expired promotion styling */
.promotion-expired {
    background-color: #f8d7da;  /* Light red background */
    border-left: 4px solid #dc3545;  /* Red left border */
    padding: 10px;  /* Internal spacing */
    margin-bottom: 10px;  /* Space below alert */
    border-radius: 5px;  /* Rounded corners */
}

/* ===== DASHBOARD COMPONENTS ===== */

/* Dashboard metric card styling */
.dashboard-metric {
    text-align: center;  /* Center align content */
    padding: 20px;  /* Generous padding */
}

/* Large metric numbers on dashboard */
.dashboard-metric h3 {
    font-size: 2.5rem;  /* Large font size for emphasis */
    font-weight: bold;  /* Bold text for importance */
    margin-bottom: 5px;  /* Small bottom margin */
}

/* ===== TABLE INTERACTION ELEMENTS ===== */

/* Table action buttons container */
.table-actions {
    white-space: nowrap;  /* Prevent button wrapping */
}

/* Individual action buttons in tables */
.table-actions .btn {
    margin-right: 5px;  /* Space between action buttons */
    padding: 0.25rem 0.5rem;  /* Compact padding for table buttons */
}

/* ===== CUSTOMER DISPLAY COMPONENTS ===== */

/* Customer information display container */
.customer-info {
    display: flex;  /* Flexbox layout */
    align-items: center;  /* Vertical center alignment */
}

/* Customer avatar/initial display */
.customer-avatar {
    width: 40px;  /* Fixed width */
    height: 40px;  /* Fixed height (square) */
    border-radius: 50%;  /* Circular avatar */
    background-color: #007bff;  /* Primary blue background */
    color: white;  /* White text */
    display: flex;  /* Flexbox for centering */
    align-items: center;  /* Vertical center */
    justify-content: center;  /* Horizontal center */
    margin-right: 10px;  /* Space to the right */
    font-weight: bold;  /* Bold text for initial */
}

/* ===== ORDER DISPLAY ELEMENTS ===== */

/* Order items display (for table cells) */
.order-items {
    max-width: 200px;  /* Limit width */
    overflow: hidden;  /* Hide overflow content */
    text-overflow: ellipsis;  /* Show ellipsis for long text */
    white-space: nowrap;  /* Prevent text wrapping */
}

/* ===== STOCK LEVEL INDICATORS ===== */

/* Low stock text styling (critical level) */
.stock-low {
    color: #dc3545;  /* Red color for danger */
    font-weight: bold;  /* Bold text for emphasis */
}

/* Medium stock text styling (warning level) */
.stock-medium {
    color: #ffc107;  /* Yellow color for warning */
    font-weight: bold;  /* Bold text for emphasis */
}

/* High stock text styling (good level) */
.stock-high {
    color: #28a745;  /* Green color for success */
    font-weight: bold;  /* Bold text for emphasis */
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile and tablet responsive adjustments */
@media (max-width: 768px) {
    /* Smaller font size for tables on mobile */
    .table-responsive {
        font-size: 0.875rem;  /* Reduced font size for mobile readability */
    }
    
    /* Reduced padding for cards on mobile */
    .card-body {
        padding: 1rem;  /* Smaller padding to maximize screen space */
    }
    
    /* Smaller buttons on mobile devices */
    .btn {
        font-size: 0.875rem;  /* Slightly smaller button text */
    }
}
