/**
 * DarkStore Management System Styles
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 250px;
    --navbar-height: 56px;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.main-content {
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

/* Stats Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card.orders { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.revenue { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.products { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.alerts { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

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

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

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

/* Scanner Input */
.scanner-input {
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

/* Mobile Optimized Styles */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-lg-mobile {
        padding: 1rem;
        font-size: 1.125rem;
    }
    
    .scanner-input {
        font-size: 1.5rem;
    }
}

/* Picker/Packer Mobile Interface */
.picking-interface {
    /* max-width and margin removed for sidebar layout compatibility */
}

.picking-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.picking-item.picked {
    border-left-color: var(--success-color);
    opacity: 0.7;
}

.picking-item.unavailable {
    border-left-color: var(--danger-color);
}

.item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.location-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.scan-button {
    position: relative;
    overflow: hidden;
}

.scan-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.scan-button:active::after {
    width: 200px;
    height: 200px;
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
}

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

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 4rem;
    color: var(--primary-color);
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Order Status Colors */
.status-pending { color: #ffc107; }
.status-picking { color: #0dcaf0; }
.status-picked { color: #0d6efd; }
.status-packing { color: #0dcaf0; }
.status-packed { color: #0d6efd; }
.status-ready { color: #198754; }
.status-dispatched { color: #6c757d; }
.status-delivered { color: #198754; }
.status-cancelled { color: #dc3545; }

/* Priority Indicators */
.priority-high { 
    background: #fee2e2; 
    color: #dc2626; 
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-express { 
    background: #fef3c7; 
    color: #d97706; 
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-item.completed::before {
    background: var(--success-color);
}

/* Print Styles */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Auto-complete Dropdown Styles */
.dropdown-menu {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 2px;
}

.dropdown-menu .dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease;
}

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

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: #e9ecef;
}

.dropdown-menu .dropdown-item:active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-menu .dropdown-item .fw-bold {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dropdown-menu .dropdown-item small {
    font-size: 0.8rem;
}

.dropdown-menu .dropdown-item .badge {
    font-size: 0.75rem;
}

/* Position relative for dropdown containers */
.position-relative .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

/* Loading state for search inputs */
.search-loading {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236c757d" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 16px;
}
