/* Custom CSS for Hardware Shop Management System */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
}

/* Custom navbar styling */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Main content area */
main {
    padding-top: 2rem;
}

/* Card styling */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Dashboard stats cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    overflow: hidden;
}

.stat-card.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.stat-card .card-body {
    position: relative;
}

.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Table styling */
.table {
    background-color: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

/* Button styling */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
}

/* Form styling */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #ddd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Product cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.product-image {
    height: 200px;
    object-fit: cover;
    background-color: var(--light-color);
}

/* Cart styling */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

/* Order status badges */
.status-pending {
    background-color: var(--warning-color);
    color: #000;
}

.status-processing {
    background-color: var(--info-color);
}

.status-completed {
    background-color: var(--success-color);
}

.status-cancelled {
    background-color: var(--danger-color);
}

/* Loading spinner */
.loading {
    display: none;
}

.loading.show {
    display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    main {
        margin-left: 0;
    }
    
    .stat-card .stat-icon {
        display: none;
    }
    
    .table-responsive {
        border: none;
    }
}

/* Sidebar base styles - mobile/desktop handled in header.php */
.sidebar .nav-link {
    color: #333;
    border-radius: 0.5rem;
    margin: 0.2rem 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print styles */
@media print {
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* Footer styling */
footer {
    margin-top: auto;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}
