/* Dashboard Page Styles - Enhanced Modern Look */

/* Stats Grid - Enhanced Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1A6AFF;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(26, 106, 255, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.stat-card-icon.channels {
    background: rgba(26, 106, 255, 0.12);
    color: #1A6AFF;
}

.stat-card-icon.messages {
    background: rgba(6, 182, 212, 0.12);
    color: #06B6D4;
}

.stat-card-icon.leads {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-card:hover .stat-value {
    color: var(--color-primary);
}

/* Stat Card Mini Chart */
.stat-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
    margin-top: 12px;
}

.stat-mini-bar {
    width: 4px;
    background: var(--color-primary);
    opacity: 0.3;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-mini-bar {
    opacity: 0.6;
}

.stat-mini-bar:last-child {
    opacity: 0.8;
    background: var(--color-primary);
}

/* Grid Layout - Enhanced */
.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px 24px;
}

/* Recent Messages - Enhanced */
#recentMessages {
    max-height: 320px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.message-item:hover {
    background: var(--bg-secondary);
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(26, 106, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.message-channel-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.message-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Top Channels - Enhanced */
#topChannels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.channel-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.channel-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.channel-count strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card:last-child {
        grid-column: span 1;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
}

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

.stat-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

.card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

.sheet-info-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.15s;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}
