/* POS IMPREX - Modern Purple Gradient Theme */

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf1;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-glass-hover: rgba(245, 247, 250, 0.95);
    
    --primary: #667eea;
    --primary-light: #7c94f0;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --accent: #f093fb;
    
    /* Gradient definitions */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-primary-hover: linear-gradient(135deg, #7c94f0 0%, #8b5fbf 100%);
    --gradient-navbar: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-button: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    --border-color: #dee2e6;
    --border-glow: rgba(102, 126, 234, 0.2);
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(102, 126, 234, 0.12);
    --shadow-lg: 0 8px 32px rgba(102, 126, 234, 0.16);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);
    
    --blur: blur(10px);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
    min-height: 100vh;
}

/* ===== Navigation ===== */
.navbar {
    background: var(--gradient-navbar) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
}

/* Tab Navigation - Black text for inventory tabs */
.nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.25rem !important;
    border-radius: 8px 8px 0 0;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(102, 126, 234, 0.05);
    border-bottom-color: var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: transparent;
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ===== Glass Card Effect ===== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-weight: 600;
    color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-button);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--primary);
    border: 2px solid var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--gradient-button);
    color: white;
    border-color: transparent;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e05565 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb73e 100%);
    border: none;
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    color: #212529;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    color: white;
}

/* ===== Forms ===== */
.form-control, .form-select {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary) !important;
    padding: 0.625rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-glow);
    color: var(--text-primary) !important;
}

.form-control::placeholder {
    color: #aaa;
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group-text {
    background: var(--gradient-button);
    border: none;
    color: white;
}

/* ===== Tables ===== */
.table {
    color: var(--text-primary);
}

.table thead th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
}

.table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
}

.table td {
    vertical-align: middle;
    position: relative;
}

.table td .btn {
    position: relative;
    z-index: 10;
}

/* ===== Categories ===== */
#categories .btn, #categories-container .btn {
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    text-transform: capitalize;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

#categories .btn:hover, #categories .btn.active,
#categories-container .btn:hover, #categories-container .btn.active {
    background: var(--gradient-button);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

#categories-container .btn:active {
    transform: scale(0.95);
}

/* ===== POS Product Grid ===== */
.product-card {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.product-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.product-card .product-image-container {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
    padding: 10px;
}

.product-card .product-image {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 6px;
}

.product-card .stock-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Horizontal Product Card */
.product-grid-item {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    height: 110px;
    width: 100%;
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.product-grid-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-grid-item:active {
    transform: scale(0.98);
}

.product-grid-image {
    width: 110px !important;
    height: 110px !important;
    min-width: 110px;
    max-width: 110px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-right: 2px solid var(--border-color);
    flex-shrink: 0;
}

.product-grid-info {
    padding: 0.75rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.product-grid-info .product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-grid-info .product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Cart Styling ===== */
.cart-item {
    transition: var(--transition);
    border-radius: 8px;
    margin-bottom: 5px;
    padding: 10px;
}

.cart-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
}

.cart-item .fw-bold {
    font-size: 0.9rem;
}

/* ===== Badges ===== */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}

.bg-primary {
    background: var(--gradient-button) !important;
}

.stock-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    width: fit-content;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.alert-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(224, 85, 101, 0.1) 100%);
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 183, 62, 0.1) 100%);
    color: #856404;
    border-left: 4px solid var(--warning);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blink-btn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-fadeIn { animation: fadeIn 0.3s ease forwards; }

/* ===== Dashboard Stats Cards ===== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== Modal Overrides ===== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    color: var(--primary-dark);
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* ===== Pagination ===== */
.page-link {
    color: var(--primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 0 2px;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gradient-button);
    color: white;
    border-color: transparent;
}

.page-item.active .page-link {
    background: var(--gradient-button);
    border-color: transparent;
}

/* ===== Progress Bars ===== */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.progress-bar {
    background: var(--gradient-button);
    border-radius: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-content { padding: 0.75rem; }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}