/* ==========================================================================
   DASHBOARD STYLES
   ========================================================================== */

.wpiko-chatbot-dashboard {
    margin: 0;
    padding: 0;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in {
    animation: slideInLeft 0.5s ease-out forwards;
}

/* Welcome Section */
.dashboard-welcome {
    background: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(58, 79, 102, 0.08);
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    pointer-events: none;
}

.welcome-content h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-content h1 .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.welcome-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

.welcome-status {
    text-align: right;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.status-indicator.status-active {
    background: #ccf0ee;
    color: #1f2937;
    border: 1px solid #81DAD4;
}

.status-indicator.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-indicator .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(58, 79, 102, 0.08);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(58, 79, 102, 0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: white;
}

.stat-conversations .stat-icon {
    background: linear-gradient(135deg, #84b3fe, #0968fe);
}

.stat-messages .stat-icon {
    background: linear-gradient(135deg, #67d2cc, #03B5AA);
}

.stat-users .stat-icon {
    background: linear-gradient(135deg, #bd9cf6, #7c3aed);
}

.stat-today .stat-icon {
    background: linear-gradient(135deg, #ffb7ac, #FF6F59);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Main Dashboard Content */
.dashboard-main-content {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-left-column,
.dashboard-right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Dashboard Widgets */
.dashboard-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
    border: 1px solid rgba(58, 79, 102, 0.08);
    overflow: hidden;
}

.widget-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-header h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0968fe;
}

.widget-action {
    color: #0968fe;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.widget-action:hover {
    background: rgba(9, 104, 254, 0.1);
    color: #0755d6;
}

.widget-content {
    padding: 24px;
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background: #f1f5f9;
}

.activity-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.activity-details {
    flex: 1;
}

.activity-user {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.activity-message {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.activity-time {
    font-weight: 500;
}

.no-activity {
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
}

.no-activity .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.no-activity p {
    margin: 0;
    font-size: 14px;
}

/* Period Statistics */
.period-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.period-stat {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.period-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.period-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Configuration Status */
.config-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f8fafc;
}

.config-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.config-complete .config-indicator {
    background: #03B5AA;
}

.config-incomplete .config-indicator {
    background: #ef4444;
}

.config-optional .config-indicator {
    background: #dc3545;
}

.config-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.config-action {
    color: #0968fe;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.config-action:hover {
    background: rgba(9, 104, 254, 0.1);
    color: #0755d6;
}

/* Quick Actions */
.dashboard-quick-actions {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
    border: 1px solid rgba(58, 79, 102, 0.08);
}

.dashboard-quick-actions h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-quick-actions h3 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #0968fe;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-action-card:hover {
    background: #f1f5f9;
    color: #0968fe;
    border-color: #0968fe;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(9, 104, 254, 0.12);
}

.quick-action-card .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.quick-action-card span:last-child {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .dashboard-main-content {
        grid-template-columns: 1fr;
    }
    
    .dashboard-right-column {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        display: grid;
    }
}

@media screen and (max-width: 782px) {
    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .welcome-content {
        text-align: center;
        width: 100%;
    }
    
    .welcome-content h1 {
        justify-content: center;
        text-align: center;
        font-size: 24px;
    }
    
    .welcome-status {
        text-align: center;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .period-stats {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .welcome-content h1 {
        font-size: 24px;
    }
    
    .dashboard-quick-actions h3 {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .dashboard-welcome {
        padding: 24px;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .widget-content {
        padding: 16px;
    }
    
    .dashboard-quick-actions {
        padding: 16px;
    }
}

/* Loading States */
.dashboard-loading {
    opacity: 0.7;
    pointer-events: none;
}

.dashboard-loading .stat-number,
.dashboard-loading .period-number {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* Focus styles for accessibility */
.quick-action-card:focus,
.widget-action:focus,
.config-action:focus {
    outline: 2px solid #0968fe;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stat-card,
    .dashboard-widget {
        border: 2px solid #000;
    }
    
    .dashboard-welcome {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .quick-action-card,
    .activity-item {
        transition: none;
    }
    
    .animate-fade-in,
    .animate-slide-in {
        animation: none;
    }
}
