/* Custom Styles for Agent Referral System */

:root {
    --primary-color: #4e73df;
    --secondary-color: #6c757d;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
}

/* Background Gradients */
.bg-gradient-primary {
    background: linear-gradient(87deg, #4e73df 0, #224abe 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(87deg, #1cc88a 0, #13855c 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(87deg, #f6c23e 0, #dda20a 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(87deg, #36b9cc 0, #258391 100%) !important;
}

/* Card Styling */
.card {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid #e3e6f0;
    background-color: #f8f9fc;
}

/* Table Styling */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Button Styling */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
}

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

/* Form Styling */
.form-control {
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    padding: 0.75rem;
}

.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Badge Styling */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Sidebar Styling (for admin) */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link.active {
    color: #4e73df;
    background-color: #eaecf4;
    border-left-color: #4e73df;
}

.sidebar .nav-link:hover {
    color: #4e73df;
    background-color: #f8f9fc;
}

/* Avatar */
.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.avatar-md {
    width: 3.5rem;
    height: 3.5rem;
}

.avatar-lg {
    width: 4.5rem;
    height: 4.5rem;
}

/* Product Card */
.product-card {
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img {
    height: 200px;
    object-fit: cover;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background-color: #fff3cd; color: #856404; }
.status-confirmed { background-color: #d1ecf1; color: #0c5460; }
.status-processing { background-color: #cce5ff; color: #004085; }
.status-shipped { background-color: #d4edda; color: #155724; }
.status-delivered { background-color: #d1e7dd; color: #0f5132; }
.status-cancelled { background-color: #f8d7da; color: #721c24; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
    }
    
    .sidebar-sticky {
        height: auto;
    }
    
    .product-img {
        height: 150px;
    }
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Admin Layout Specific Styles */
body.sb-nav-fixed {
    padding-top: 56px;
}

/* Sidebar animation */
#layoutSidenav_nav {
    transition: all 0.15s ease-in-out;
}

/* Mobile sidebar toggle */
@media (max-width: 767.98px) {
    body.sb-sidenav-toggled #layoutSidenav_nav {
        transform: translateX(0) !important;
    }
    
    body.sb-sidenav-toggled #layoutSidenav_content::before {
        content: '';
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1037;
    }
}

/* Active link styling */
.nav-link.active {
    font-weight: 600;
}

/* Card enhancements */
.card {
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Table row hover */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Form validation styling */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: #1cc88a;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%231cc88a' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #e74a3b;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e74a3b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e74a3b' stroke='none'/%3e%3c/svg%3e");
}

/* Button animations */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Loading spinner */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}