/**
 * IzyCart - Main Stylesheet
 * Mobile-first responsive design with Bootstrap 5
 */

/* ============================================
   Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

a {
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: #fff;
}

/* ============================================
   Forms
   ============================================ */

.form-control,
.form-select {
    border-radius: var(--border-radius);
    border-color: var(--border);
    padding: 0.625rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(11, 87, 208, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Password toggle */
.password-toggle {
    position: relative;
}

.password-toggle .toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.25rem;
}

.password-toggle .toggle-btn:hover {
    color: var(--primary);
}

.password-toggle input {
    padding-right: 40px;
}

/* ============================================
   Cards
   ============================================ */

.card {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* Product Card */
.product-card {
    position: relative;
    height: 100%;
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--danger);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.product-card .badge-expiring {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--warning);
    color: var(--dark);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card .product-price .original-price {
    font-size: 0.875rem;
    color: var(--gray);
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 0.5rem;
}

.product-card .product-seller {
    font-size: 0.875rem;
    color: var(--gray);
}

.product-card .min-order {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    background-color: #fff;
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 60px);
    padding-top: 1.5rem;
}

.sidebar .nav-link {
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 0.5rem;
}

/* ============================================
   Tables
   ============================================ */

.table-responsive {
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--gray);
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* Sortable columns */
.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background-color: #eee;
}

.table th.sortable::after {
    content: '\F574';
    font-family: 'bootstrap-icons';
    margin-left: 0.5rem;
    opacity: 0.3;
}

.table th.sortable.asc::after {
    content: '\F575';
    opacity: 1;
}

.table th.sortable.desc::after {
    content: '\F574';
    opacity: 1;
}

/* ============================================
   Badges & Status
   ============================================ */

.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: var(--border-radius);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

.status-pending { background-color: #fef3c7; color: #92400e; }
.status-confirmed { background-color: #dbeafe; color: #1e40af; }
.status-processing { background-color: #e0e7ff; color: #3730a3; }
.status-shipped { background-color: #fce7f3; color: #9d174d; }
.status-delivered { background-color: #d1fae5; color: #065f46; }
.status-cancelled { background-color: #fee2e2; color: #991b1b; }

.verified-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--success);
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.verified-badge i {
    margin-right: 0.25rem;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: var(--border-radius);
    color: var(--dark);
    border-color: var(--border);
}

.page-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   Alerts & Toasts
   ============================================ */

.alert {
    border-radius: var(--border-radius);
    border: none;
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

/* ============================================
   Loading & Spinners
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    color: var(--primary);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
}

/* ============================================
   Category Cards
   ============================================ */

.category-card {
    text-align: center;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card .icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-card h5 {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================
   Rating Stars
   ============================================ */

.rating-stars {
    color: var(--warning);
}

.rating-stars .bi-star-fill {
    color: var(--warning);
}

.rating-stars .bi-star {
    color: var(--border);
}

/* ============================================
   Chat
   ============================================ */

.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 75%;
}

.chat-message.sent {
    margin-left: auto;
}

.chat-message .message-content {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
}

.chat-message.sent .message-content {
    background-color: var(--primary);
    color: #fff;
}

.chat-message.received .message-content {
    background-color: #f1f3f4;
}

.chat-input {
    border-top: 1px solid var(--border);
    padding: 1rem;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-muted-light {
    color: var(--gray-light);
}

.bg-primary-light {
    background-color: var(--primary-light);
}

.border-primary {
    border-color: var(--primary) !important;
}

.rounded-lg {
    border-radius: var(--border-radius);
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .sidebar,
    .no-print {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .container {
        max-width: 100%;
    }
}
