/* Custom CSS for Imago Shopping Mall CRM */

/* Global Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Avatar and Icon Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.store-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Modern Color Palette - Imago Theme */
:root {
    --imago-primary: #61360b;
    --imago-primary-light: #8b4f16;
    --imago-primary-dark: #4a2908;
    --imago-secondary: #d4a574;
    --imago-accent: #f4e4d1;
    --primary-gradient: linear-gradient(135deg, #61360b 0%, #8b4f16 100%);
    --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --warning-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --info-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-gradient: linear-gradient(135deg, #61360b 0%, #4a2908 100%);
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.bg-gradient-success {
    background: var(--success-gradient) !important;
}

.bg-gradient-warning {
    background: var(--warning-gradient) !important;
}

.bg-gradient-info {
    background: var(--info-gradient) !important;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.sidebar .nav-link {
    color: #495057;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 4px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    font-size: 1.1rem;
}

/* Main Content Area */
main {
    padding-top: 20px;
    margin-left: 0;
}

@media (min-width: 768px) {
    main {
        margin-left: 16.66667%;
    }
}

/* Content Sections */
.content-section {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Modern Metric Cards */
.metric-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.metric-card .card-body {
    padding: 2rem;
}

.metric-card h2 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.metric-card h6 {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    opacity: 0.3;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Activity Feed Styles */
.activity-feed {
    max-height: 350px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Ranking Items */
.ranking-item {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef !important;
}

.ranking-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.stat-info p {
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.stat-change.positive {
    background-color: #dcfce7;
    color: #166534;
}

.stat-change.negative {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Journey Map */
.journey-map {
    padding: 2rem 0;
}

.journey-step {
    margin: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.journey-step:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Vendor Management */
.vendor-metric-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.vendor-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.metric-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-header h6 {
    color: #718096;
    font-weight: 600;
    margin: 0;
    flex-grow: 1;
}

.metric-header i {
    color: #cbd5e0;
    font-size: 1.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.875rem;
    color: #22c55e;
    font-weight: 500;
}

.vendor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.performance-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-badge.excellent {
    background-color: #dcfce7;
    color: #166534;
}

.performance-badge.good {
    background-color: #dbeafe;
    color: #1e40af;
}

.performance-badge.average {
    background-color: #fef3c7;
    color: #92400e;
}

/* Insights */
.insight-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid #22c55e;
}

.insight-card.warning {
    border-left-color: #f59e0b;
}

.insight-card.positive {
    border-left-color: #22c55e;
}

.insight-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.insight-card.warning .insight-icon {
    background: #fef3c7;
    color: #92400e;
}

.insight-content h5 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.insight-content p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Recommendations */
.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
}

.rec-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.rec-priority.high {
    background-color: #ef4444;
}

.rec-priority.medium {
    background-color: #f59e0b;
}

.rec-priority.low {
    background-color: #22c55e;
}

.rec-content h6 {
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.rec-content p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* Zone Items */
.zone-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.zone-item:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #f1f5f9;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Enhanced Tables */
.table {
    margin: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 1rem 0.75rem;
    background: #f9fafb;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #1f2937;
}

.modal-body {
    padding: 1.5rem;
}

/* Navbar Enhancements */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: var(--primary-gradient) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--imago-accent) !important;
}

/* Imago Theme Customizations */
.btn-primary {
    background: var(--imago-primary);
    border-color: var(--imago-primary);
}

.btn-primary:hover {
    background: var(--imago-primary-dark);
    border-color: var(--imago-primary-dark);
}

.btn-outline-primary {
    color: var(--imago-primary);
    border-color: var(--imago-primary);
}

.btn-outline-primary:hover {
    background: var(--imago-primary);
    border-color: var(--imago-primary);
}

.text-primary {
    color: var(--imago-primary) !important;
}

.bg-primary {
    background-color: var(--imago-primary) !important;
}

.border-primary {
    border-color: var(--imago-primary) !important;
}

/* Navigation link active states */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(244, 228, 209, 0.2);
    border-radius: 6px;
}

/* Badge customizations */
.badge.bg-primary {
    background-color: var(--imago-primary) !important;
}

.progress-bar.bg-primary {
    background-color: var(--imago-primary) !important;
}

/* Card header with Imago theme */
.card-header.bg-primary {
    background: var(--primary-gradient) !important;
    color: white;
}

/* Imago brand accent styling */
.imago-accent {
    color: var(--imago-accent) !important;
}

.bg-imago-accent {
    background-color: var(--imago-accent) !important;
}

/* Dashboard welcome message */
.welcome-section {
    background: linear-gradient(135deg, var(--imago-accent) 0%, #ffffff 100%);
    border-left: 4px solid var(--imago-primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Chart container enhancements */
.chart-container {
    border: 1px solid var(--imago-secondary);
    border-radius: 8px;
}

/* Table header with Imago theme */
.table-light {
    background-color: var(--imago-accent) !important;
}

/* Avatar circles with Imago theme */
.avatar-circle.bg-primary {
    background: var(--primary-gradient) !important;
}

/* Modal header with Imago theme */
.modal-header {
    background: linear-gradient(135deg, var(--imago-accent) 0%, #ffffff 100%);
    border-bottom: 2px solid var(--imago-primary);
}

/* Sidebar active state */
.sidebar .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    border-radius: 6px;
}

/* Pulse animation for live status */
.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--imago-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(97, 54, 11, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(97, 54, 11, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(97, 54, 11, 0);
    }
}

/* Custom badge styles for Imago theme */
.badge.vip-badge {
    background: linear-gradient(45deg, var(--imago-primary), var(--imago-primary-light));
    color: var(--imago-accent);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.badge.premium-badge {
    background: var(--imago-secondary);
    color: var(--imago-primary);
    font-weight: 600;
}

.badge.regular-badge {
    background: #6c757d;
    color: white;
}

/* Enhanced table styling */
.table th {
    color: var(--imago-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--imago-secondary);
}

/* Progress bar with Imago theme */
.progress-bar.loyalty-points {
    background: linear-gradient(90deg, var(--imago-primary), var(--imago-secondary));
}

/* Store icons with Imago theme */
.store-icon.imago-theme {
    background: var(--imago-primary);
    color: var(--imago-accent);
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        height: auto;
        padding: 0;
        box-shadow: none;
    }
    
    main {
        margin-left: 0;
        padding-top: 10px;
    }
    
    .metric-card .card-body {
        padding: 1.5rem;
    }
    
    .metric-card h2 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .journey-step {
        margin: 0.25rem;
        padding: 1rem !important;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .btn-toolbar {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
