/* Blinkit Dashboard - Main Styles */

:root {
    --primary-color: #F8CB46;
    --secondary-color: #0C831F;
    --accent-color: #E23744;
    --bg-color: #F8F9FA;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --info-color: #17A2B8;
    --sidebar-width: 260px;
    --header-height: 70px;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(248,203,70,0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.header {
    background: white;
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-dark);
    display: none;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(248,203,70,0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.filter-group select {
    border-color: #dee2e6;
    font-size: 0.875rem;
}

.btn-icon {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-dark);
    transition: color var(--transition);
}

.btn-icon:hover {
    color: var(--primary-color);
}

.btn-icon .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.dashboard-container {
    padding: 2rem;
}

.kpi-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.5s ease-out;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.kpi-icon.revenue {
    background: linear-gradient(135deg, #F8CB46 0%, #FFA500 100%);
    color: white;
}

.kpi-icon.orders {
    background: linear-gradient(135deg, #0C831F 0%, #28A745 100%);
    color: white;
}

.kpi-icon.growth {
    background: linear-gradient(135deg, #17A2B8 0%, #007BFF 100%);
    color: white;
}

.kpi-icon.users {
    background: linear-gradient(135deg, #E23744 0%, #DC3545 100%);
    color: white;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-family: 'Roboto Mono', monospace;
}

.kpi-change {
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-change.positive {
    color: var(--success-color);
}

.kpi-change.negative {
    color: var(--danger-color);
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: none;
    animation: fadeInUp 0.6s ease-out;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.order-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    transition: transform var(--transition);
}

.status-item:hover {
    transform: scale(1.05);
}

.status-item.pending {
    background: rgba(255,193,7,0.1);
}

.status-item.processing {
    background: rgba(23,162,184,0.1);
}

.status-item.delivery {
    background: rgba(0,123,255,0.1);
}

.status-item.delivered {
    background: rgba(40,167,69,0.1);
}

.status-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.status-item.pending .status-icon {
    color: var(--warning-color);
}

.status-item.processing .status-icon {
    color: var(--info-color);
}

.status-item.delivery .status-icon {
    color: #007BFF;
}

.status-item.delivered .status-icon {
    color: var(--success-color);
}

.status-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-list {
    max-height: 300px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background var(--transition);
}

.order-item:hover {
    background: #f8f9fa;
}

.order-info {
    flex: 1;
}

.order-id {
    font-weight: 600;
    font-size: 0.875rem;
}

.order-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.inventory-summary {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.summary-item {
    flex: 1;
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.inventory-list {
    max-height: 300px;
    overflow-y: auto;
}

.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}

.inventory-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.item-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stock-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stock-badge.in-stock {
    background: rgba(40,167,69,0.1);
    color: var(--success-color);
}

.stock-badge.low-stock {
    background: rgba(255,193,7,0.1);
    color: var(--warning-color);
}

.stock-badge.out-of-stock {
    background: rgba(220,53,69,0.1);
    color: var(--danger-color);
}

.top-products-list {
    max-height: 400px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background var(--transition);
}

.product-item:hover {
    background: #f8f9fa;
}

.product-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 30px;
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.product-stats {
    text-align: right;
}

.product-sales {
    font-weight: 700;
    font-size: 0.875rem;
}

.product-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
}

.product-trend.up {
    color: var(--success-color);
}

.product-trend.down {
    color: var(--danger-color);
}

.delivery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: white;
    color: var(--primary-color);
}

.stat-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.region-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.region-filters .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-dark);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Interactive Elements */
.clickable {
    cursor: pointer;
    transition: all var(--transition);
}

.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-card.clickable:active {
    transform: translateY(0);
}

.order-item.clickable:hover {
    background: #e3f2fd;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.625rem;
}

.product-item.clickable:hover {
    background: #fff3cd;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.875rem;
}

.inventory-item.clickable:hover {
    background: #d4edda;
    border-left: 3px solid var(--success-color);
    padding-left: 0.75rem;
}

/* Modal Enhancements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFA500 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
    color: var(--text-dark);
}

/* Status Badge Animations */
.status-item.clickable {
    cursor: pointer;
}

.status-item.clickable:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.status-item.clickable:active {
    transform: scale(1.02);
}

/* Chart Click Effects */
canvas {
    cursor: pointer;
}

/* Notification Toast */
.notification-toast {
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(248,203,70,0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
.custom-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-tooltip.show {
    opacity: 1;
}

/* Action Buttons */
.action-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn-primary {
    background: var(--primary-color);
    color: var(--text-dark);
}

.action-btn-primary:hover {
    background: #FFA500;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(248,203,70,0.3);
}

.action-btn-success {
    background: var(--success-color);
    color: white;
}

.action-btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

/* Highlight Effect */
.highlight {
    animation: highlight 1s ease-out;
}

@keyframes highlight {
    0% {
        background: var(--primary-color);
        transform: scale(1.05);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Page Navigation */
.page-content {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Styles */
.table-hover tbody tr {
    cursor: pointer;
    transition: all var(--transition);
}

.table-hover tbody tr:hover {
    background-color: rgba(248,203,70,0.1);
    transform: scale(1.01);
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

/* Product Grid */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.product-card h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(248,203,70,0.25);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-dark);
    font-weight: 600;
}

.btn-primary:hover {
    background: #FFA500;
    border-color: #FFA500;
    color: var(--text-dark);
}

/* Made with Bob */
