/**
 * ============================================================================
 * DASHBOARD ENHANCED - Modern UI/UX Improvements
 * ============================================================================
 * - Gradient header banner with impressive title
 * - Enhanced activity feed with colorful icons
 * - Responsive design for mobile/tablet/desktop
 * - Modern animations and transitions
 * 
 * @version 1.0.0
 * @date 2025-11-08
 * ============================================================================
 */

/* ============================================================================
   1. DASHBOARD HEADER - GRADIENT BANNER
   ============================================================================ */

.dashboard-hero-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.dashboard-hero-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.dashboard-hero-text h1 {
    font-size: 42px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.dashboard-hero-text p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

.dashboard-hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dashboard-hero-actions .btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-hero-actions .btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.dashboard-hero-actions .btn-refresh i {
    font-size: 18px;
}

/* Stats Mini Cards in Hero */
.dashboard-hero-stats {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.dashboard-hero-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px 24px;
    min-width: 140px;
}

.dashboard-hero-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dashboard-hero-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

/* ============================================================================
   2. ACTIVITIES FEED - ENHANCED DESIGN
   ============================================================================ */

.dashboard-activities-card .card-header-v2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
    border: none;
}

.dashboard-activities-card .card-header-v2 h4 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-activities-card .card-header-v2 i {
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.activity-item:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.activity-item:hover::before {
    width: 100%;
    opacity: 0.05;
}

.activity-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.activity-icon i {
    animation: iconFloat 3s ease-in-out infinite;
}

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

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Activity Type Colors - More Vibrant */
.activity-icon[data-type="call"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.activity-icon[data-type="meeting"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.activity-icon[data-type="email"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.activity-icon[data-type="note"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.activity-icon[data-type="training"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.activity-icon[data-type="support"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.activity-icon[data-type="order"] {
    background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%);
}

.activity-icon[data-type="demo"] {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

/* Empty State */
.activities-list .text-muted {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
    font-size: 15px;
    font-style: italic;
}

/* ============================================================================
   3. RESPONSIVE DESIGN - MOBILE / TABLET / DESKTOP
   ============================================================================ */

/* Mobile First (320px - 767px) */
@media (max-width: 767px) {
    .dashboard-hero-header {
        padding: 24px 20px;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .dashboard-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-hero-text h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .dashboard-hero-text p {
        font-size: 14px;
    }

    .dashboard-hero-actions {
        width: 100%;
        justify-content: stretch;
    }

    .dashboard-hero-actions .btn-refresh {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }

    .dashboard-hero-stats {
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 16px;
    }

    .dashboard-hero-stat {
        flex: 1;
        min-width: calc(50% - 6px);
        padding: 12px 16px;
    }

    .dashboard-hero-stat-label {
        font-size: 11px;
    }

    .dashboard-hero-stat-value {
        font-size: 24px;
    }

    /* KPI Grid - Stack on Mobile */
    .dashboard-kpi-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Charts Grid - Stack on Mobile */
    .dashboard-charts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Bottom Grid - Stack on Mobile */
    .dashboard-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Activity Items - Smaller on Mobile */
    .activity-item {
        padding: 12px;
        gap: 12px;
    }

    .activity-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-radius: 10px;
    }

    .activity-title {
        font-size: 14px;
    }

    .activity-meta {
        font-size: 12px;
    }

    /* Quick Actions - Wrap on Mobile */
    .quick-actions-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .quick-actions-bar .quick-action {
        min-width: 140px;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .dashboard-hero-header {
        padding: 32px;
    }

    .dashboard-hero-text h1 {
        font-size: 36px;
    }

    .dashboard-hero-text p {
        font-size: 16px;
    }

    .dashboard-hero-stats {
        flex-wrap: wrap;
    }

    /* KPI Grid - 2 Columns on Tablet */
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* Charts Grid - 2 Columns on Tablet */
    .dashboard-charts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    /* Bottom Grid - Keep 2 Columns on Tablet */
    .dashboard-bottom-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    .activity-item {
        padding: 14px;
    }

    .activity-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .dashboard-hero-header {
        padding: 40px;
    }

    /* KPI Grid - 3 Columns on Desktop */
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }

    /* Charts Grid - 4 Columns on Desktop */
    .dashboard-charts-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 24px !important;
    }

    /* Bottom Grid - 60/40 Split on Desktop */
    .dashboard-bottom-grid {
        grid-template-columns: 1.5fr 1fr !important;
        gap: 24px !important;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .dashboard-hero-header {
        padding: 48px 56px;
    }

    .dashboard-hero-text h1 {
        font-size: 48px;
    }

    .dashboard-hero-text p {
        font-size: 20px;
    }

    .dashboard-hero-stats {
        gap: 20px;
    }

    .dashboard-hero-stat {
        min-width: 160px;
        padding: 20px 28px;
    }

    .dashboard-hero-stat-value {
        font-size: 36px;
    }

    /* KPI Grid - 6 Columns on Large Desktop */
    .dashboard-kpi-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* ============================================================================
   4. ALERTS CARD ENHANCEMENT
   ============================================================================ */

.dashboard-alerts-card .card-header-v2 {
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
    border: none;
}

.dashboard-alerts-card .card-header-v2 h4 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-alerts-card .card-header-v2 i {
    font-size: 24px;
    animation: ring 1s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(0deg); }
}

/* Alert Items */
.alerts-list .alert-item {
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.alerts-list .alert-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.alerts-list .alert-item.danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fee 100%);
    border-left-color: #dc3545;
}

.alerts-list .alert-item.warning {
    background: linear-gradient(135deg, #fffbf0 0%, #fef3cd 100%);
    border-left-color: #ffc107;
}

.alerts-list .alert-item.info {
    background: linear-gradient(135deg, #f0f8ff 0%, #e7f3ff 100%);
    border-left-color: #17a2b8;
}

.alerts-list .alert-item.success {
    background: linear-gradient(135deg, #f0fff4 0%, #d4edda 100%);
    border-left-color: #28a745;
}

/* ============================================================================
   5. SMOOTH ANIMATIONS
   ============================================================================ */

.dashboard-hero-header,
.dashboard-activities-card,
.dashboard-alerts-card,
.activity-item {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation for activity items */
.activity-item:nth-child(1) { animation-delay: 0.1s; }
.activity-item:nth-child(2) { animation-delay: 0.2s; }
.activity-item:nth-child(3) { animation-delay: 0.3s; }
.activity-item:nth-child(4) { animation-delay: 0.4s; }
.activity-item:nth-child(5) { animation-delay: 0.5s; }

/* Loading State */
.dashboard-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.dashboard-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .dashboard-hero-header {
        background: #667eea;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .dashboard-hero-actions,
    .quick-actions-bar {
        display: none !important;
    }

    .activity-item,
    .alerts-list .alert-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
