/**
 * ========================================
 * CARDS.CSS - Sistema Completo de Cards
 * ========================================
 * 
 * Componentes de cards modulares e reutilizáveis.
 * Inclui: Summary Cards, Metric Cards, Alert Cards, Client Cards
 * 
 * @author BluePartner Dashboard Premium
 * @created 2025-10-02
 * @version 2.0 - Modular & Animated
 */

/* ========================================
   SUMMARY CARDS - Cards de Métricas do Topo
   (Total de Registros, Empresas, Data Atual, Status)
   ======================================== */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    /* Layout */
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    
    /* Visual - Gradiente Escuro com Borda Azul */
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(51, 65, 85, 0.7) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    
    /* Animation */
    transition: all 0.3s ease;
    
    /* Performance */
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ✨ EFEITO RADIAL ANIMADO - Brilho que aparece no hover */
.summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

/* 🚀 HOVER - Elevação com sombra azul brilhante */
.summary-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

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

/* Conteúdo do Card */
.summary-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Layout para ícone + texto */
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 10px 0;
    line-height: 1;
}

/* Variante: Value com cor de sucesso (status conectado) */
.summary-card .value--success {
    color: var(--success-color);
}

.summary-card p {
    font-size: 0.85rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
}

/* 🎈 ANIMAÇÃO FLOAT para Ícones dos Cards */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.summary-card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

/* Cores específicas para ícones */
.summary-card-icon--blue {
    color: #3b82f6;
}

.summary-card-icon--green {
    color: #10b981;
}

.summary-card-icon--orange {
    color: #f59e0b;
}

.summary-card:hover .summary-card-icon {
    animation-duration: 1.5s;
    transform: scale(1.1);
}

/* ========================================
   STAT CARDS - Cards de Estatísticas
   ======================================== */

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-card.stat-alert {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-icon {
    font-size: 24px;
    min-width: 24px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ========================================
   CLIENT CARDS - Cards de Clientes
   ======================================== */

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.client-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(51, 65, 85, 0.7) 100%);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.client-card-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.client-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.client-card-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   ALERT CARDS - Cards de Alertas
   ======================================== */

.alert-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.alert-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.alert-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

/* Cores de alerta por tipo */
.alert-stat-card.critical::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.alert-stat-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.alert-stat-card.info::before {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.alert-stat-card.success::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.alert-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 10px 0;
    line-height: 1;
}

.alert-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-stat-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

/* ========================================
   ALERT CARDS - Cards de Lista de Alertas
   ======================================== */

.alert-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.alert-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-card.critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.alert-card.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.alert-card.info {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.alert-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.alert-card-icon {
    font-size: 1.2rem;
}

.alert-card-title {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.alert-card-body {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert-card-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   DASHBOARD CARDS - Cards de Dashboards Específicos
   ======================================== */

.sharepoint-dashboard,
.onedrive-dashboard,
.exchange-dashboard {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

/* ========================================
   RESPONSIVO - Mobile First
   ======================================== */

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .summary-card {
        padding: 18px;
    }
    
    .summary-card .value {
        font-size: 1.8rem;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
    }
    
    .alert-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 480px) and (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .alert-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .alert-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .summary-cards {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .summary-cards {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .summary-card {
        padding: 12px;
    }
    
    .summary-card .value {
        font-size: 1.5rem;
        margin: 5px 0;
    }
    
    .summary-card-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
}

/* ========================================
   PERFORMANCE - Otimizações
   ======================================== */

/* GPU Acceleration */
.summary-card,
.stat-card,
.client-card,
.alert-stat-card,
.alert-card {
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Contain Layout */
.summary-cards,
.clients-grid,
.alert-stats-grid,
.stats-grid {
    contain: layout style paint;
}

/* Optimize Repaints */
.summary-card::before,
.alert-stat-card::before {
    content: '';
    position: absolute;
    pointer-events: none;
    will-change: opacity, transform;
}

/* ========================================
   ACESSIBILIDADE - A11y
   ======================================== */

/* Modo de Alto Contraste */
@media (prefers-contrast: high) {
    .summary-card,
    .client-card,
    .alert-stat-card {
        border: 2px solid white;
    }
}

/* Preferência por Movimento Reduzido */
@media (prefers-reduced-motion: reduce) {
    .summary-card,
    .stat-card,
    .client-card,
    .alert-stat-card,
    .alert-card {
        transition: none;
        animation: none;
    }
    
    .summary-card::before,
    .alert-stat-card::before {
        display: none;
    }
    
    .summary-card-icon {
        animation: none;
    }
    
    .summary-card:hover .summary-card-icon {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .summary-cards,
    .clients-grid {
        break-inside: avoid;
    }
}
