/**
 * Main Stylesheet
 * Custom styles and responsive design for E-Commerce Shop
 */

/* CSS Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f8f9fa;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    color: var(--dark-color);
    font-size: 1.125rem;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

.card {
    border: 1px solid #e0e0e0;
    box-shadow: none;
    background-color: transparent;
    transition: var(--transition);
}

.card:hover {
    box-shadow: none;
    border-color: #ccc;
}

/* Admin Sidebar */
.admin-sidebar {
    min-height: 100vh;
    background-color: #010101;
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
}

/* Admin Content Area */
.admin-content {
    padding: 2rem;
}

/* Statistics Cards */
.stat-card {
    border-left: 4px solid;
}

.stat-card.primary {
    border-color: var(--primary-color);
}

.stat-card.success {
    border-color: var(--success-color);
}

.stat-card.warning {
    border-color: var(--warning-color);
}

.stat-card.danger {
    border-color: var(--danger-color);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Tables */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--dark-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.table img {
    border-radius: 0.25rem;
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    transition: var(--transition);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Image Preview */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border: 2px solid var(--light-color);
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Product Cards */
.product-card {
    height: 100%;
    cursor: pointer;
}

.product-card img {
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-card .btn-add-to-cart {
    margin-top: auto;
}

/* Category Cards */
.category-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
}

.category-card img {
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-card .category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1.5rem;
}

.category-card .category-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Cart */
.cart-item {
    border-bottom: 1px solid var(--light-color);
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-controls input {
    width: 60px;
    text-align: center;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Order Summary */
.order-summary {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: 0.375rem;
}

.order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.order-summary .summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    border-top: 2px solid var(--dark-color);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* Status Badges */
.status-badge.pending {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-badge.processing {
    background-color: var(--info-color);
    color: var(--dark-color);
}

.status-badge.completed {
    background-color: var(--success-color);
}

.status-badge.cancelled {
    background-color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--secondary-color);
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Toast Container */
.toast-container {
    z-index: 9999;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-sidebar {
        min-height: auto;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .product-card img {
        height: 150px;
    }
    
    .category-card img {
        height: 180px;
    }
    
    .table {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .stat-card .stat-icon {
        font-size: 1.5rem;
    }
    
    .product-card .card-title {
        font-size: 0.875rem;
    }
    
    .product-card .product-price {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
