/* Modern Dashboard Styles */

/* Welcome Header */
.welcome-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.welcome-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.welcome-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
}

/* Modern Stats Cards */
.modern-stats-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-gradient-start), var(--card-gradient-end));
}

.modern-stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modern-stats-card.primary {
    --card-gradient-start: #3b82f6;
    --card-gradient-end: #1d4ed8;
}

.modern-stats-card.success {
    --card-gradient-start: #10b981;
    --card-gradient-end: #059669;
}

.modern-stats-card.info {
    --card-gradient-start: #06b6d4;
    --card-gradient-end: #0891b2;
}

.modern-stats-card.warning {
    --card-gradient-start: #f59e0b;
    --card-gradient-end: #d97706;
}

.modern-stats-card.secondary {
    --card-gradient-start: #8b5cf6;
    --card-gradient-end: #7c3aed;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stats-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--card-gradient-start), var(--card-gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    font-size: 1.8rem;
    color: white;
}

.stats-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
}

.stats-trend.positive {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.stats-trend.negative {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.stats-badge {
    background: linear-gradient(135deg, var(--card-gradient-start), var(--card-gradient-end));
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stats-content {
    margin-top: 10px;
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 8px;
}

.stats-label {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.stats-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Modern Chart Cards */
.modern-chart-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.chart-header {
    padding: 25px 25px 0;
}

.chart-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.chart-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.chart-actions .btn-group .btn {
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 6px 12px;
}

.chart-body {
    padding: 20px 25px 25px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.chart-container {
    position: relative;
    height: 300px;
}

.pie-chart-container {
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.legend-label {
    font-weight: 500;
    color: #4b5563;
}

/* Modern Table Cards */
.modern-table-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-table-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.table-header {
    padding: 25px 25px 0;
}

.table-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.table-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.table-body {
    padding: 20px 0 0;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.modern-table thead th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 25px;
    text-align: left;
    border: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tbody td {
    padding: 15px 25px;
    border-bottom: 1px solid #f1f5f9;
    color: #4b5563;
}

.modern-table tbody tr:hover {
    background: #f8fafc;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Modern Alert Card */
.modern-alert-card {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-alert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.3);
}

.alert-header {
    padding: 20px 25px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.alert-badge {
    background: #f59e0b;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.alert-body {
    padding: 0 25px 25px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(146, 64, 14, 0.1);
}

.stock-item:last-child {
    border-bottom: none;
}

.stock-info {
    flex: 1;
}

.stock-name {
    font-weight: 600;
    color: #92400e;
    font-size: 0.95rem;
}

.stock-sku {
    font-size: 0.8rem;
    color: #a16207;
    opacity: 0.8;
}

.stock-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-badge {
    background: #dc2626;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.view-all-link {
    text-align: center;
    margin-top: 15px;
}

.view-all-link a {
    color: #92400e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.view-all-link a:hover {
    color: #a16207;
    text-decoration: underline;
}

/* Modern Activity Card */
.modern-activity-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-activity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.activity-header {
    padding: 25px 25px 0;
}

.activity-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.activity-body {
    padding: 20px 25px 25px;
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content .activity-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.activity-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}

.activity-user {
    color: #3b82f6;
    font-weight: 500;
}

.activity-time {
    color: #9ca3af;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-actions {
        align-items: center;
    }
    
    .stats-value {
        font-size: 2rem;
    }
    
    .chart-legend {
        justify-content: center;
    }
    
    .modern-table-card .table-responsive {
        border-radius: 0;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 10px 15px;
    }
}

/* Modern Loading Modal Styles */
.modern-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modern-loading-container {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: modalSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modern-loading-content {
    position: relative;
    z-index: 2;
}

/* Logo Section */
.loading-logo {
    margin-bottom: 30px;
    position: relative;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.loading-icon {
    font-size: 4rem;
    color: #3b82f6;
    animation: iconFloat 3s ease-in-out infinite;
}

.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    animation: logoPulse 2s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes logoPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
}

/* Loading Text */
.loading-text {
    margin-bottom: 40px;
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.8;
}

/* Progress Section */
.progress-section {
    margin-bottom: 30px;
}

.progress-container {
    position: relative;
    margin-bottom: 25px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06d6a0);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShimmer 2s infinite;
}

.progress-glow {
    position: absolute;
    top: -2px;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 20px #3b82f6;
    transform: translateX(-50%);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-percentage {
    position: absolute;
    top: -35px;
    right: 0;
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.1rem;
}

@keyframes progressShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.progress-step.current {
    opacity: 1;
    transform: scale(1.05);
}

.progress-step.completed {
    opacity: 1;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.progress-step:not(.completed):not(.current) .step-icon {
    background: #e5e7eb;
    color: #9ca3af;
}

.progress-step.current .step-icon {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.progress-step.completed .step-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.step-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: stepSpin 1s linear infinite;
}

.step-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    line-height: 1.2;
}

.progress-step.current .step-text {
    color: #3b82f6;
    font-weight: 600;
}

.progress-step.completed .step-text {
    color: #10b981;
    font-weight: 600;
}

@keyframes stepSpin {
    to { transform: rotate(360deg); }
}

/* Loading Animation */
.loading-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-particles {
    position: relative;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle-1 { top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { top: 60%; left: 20%; animation-delay: 0.5s; }
.particle-3 { top: 30%; right: 15%; animation-delay: 1s; }
.particle-4 { bottom: 40%; left: 15%; animation-delay: 1.5s; }
.particle-5 { bottom: 20%; right: 20%; animation-delay: 2s; }
.particle-6 { top: 70%; right: 10%; animation-delay: 2.5s; }

@keyframes particleFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart.js Custom Styles */
.chart-container canvas {
    max-height: 300px !important;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
