/**
 * ========================================
 * BUTTONS.CSS - Sistema Completo de Botões
 * ========================================
 * 
 * Componentes de botões modulares e reutilizáveis.
 * Segue padrão BEM e usa variáveis CSS para consistência.
 * 
 * @author BluePartner Dashboard Premium
 * @created 2025-10-01
 * @version 2.0 - Modular & Reusable
 */

/* ========================================
   BOTÃO PRIMARY - Principal (Export, Actions)
   ======================================== */

.btn,
.btn-primary {
    /* Layout & Spacing */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    
    /* Visual */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    
    /* Typography */
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    
    /* Interaction */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Performance */
    transform: translate3d(0, 0, 0);
    will-change: transform, box-shadow;
}

/* Efeito de Brilho Animado */
.btn::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

/* Hover States */
.btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn:hover::before,
.btn-primary:hover::before {
    left: 100%;
}

/* Active/Click State */
.btn:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Focus State (Accessibility) */
.btn:focus,
.btn-primary:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Disabled State */
.btn:disabled,
.btn-primary:disabled {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* ========================================
   BOTÃO SECONDARY - Alternativo
   ======================================== */

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* ========================================
   SERVICE TABS - Botões de Navegação
   ======================================== */

.service-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.service-tab {
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    
    /* Visual - Glass Morphism */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    
    /* Typography */
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    
    /* Interaction */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    
    /* Performance */
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* ✨ EFEITO DE GRADIENTE ANIMADO - Overlay que aparece no hover */
.service-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color, #3b82f6) 0%, var(--accent-color, #60a5fa) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 🚀 HOVER - Elevação com overlay gradiente */
.service-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: white;
    border-color: rgba(59, 130, 246, 0.5);
}

.service-tab:hover::before {
    opacity: 0.1;
}

/* 💎 ESTADO ATIVO - Tab selecionada */
.service-tab.active {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6) 0%, var(--accent-color, #60a5fa) 100%);
    color: white;
    border-color: var(--accent-color, #60a5fa);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.service-tab.active::before {
    opacity: 0.2;
}

.service-tab.active:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* 🎯 FOCUS - Acessibilidade */
.service-tab:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 🖼️ ÍCONES SVG DENTRO DOS TABS */
/**
 * Classe para ícones SVG dentro dos service tabs
 * Remove necessidade de inline styles: style="margin-right: 8px; vertical-align: middle;"
 */
.service-tab__icon {
    margin-right: 8px;
    vertical-align: middle;
}

.tab-icon {
    font-size: 1.1rem;
}

/* Cores específicas por serviço */
.service-tab.active.tab-licenses,
.service-tab[data-service="licencas"].active {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.service-tab[data-service="licencas"].active:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.service-tab.active.tab-exchange,
.service-tab[data-service="exchange"].active {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.service-tab[data-service="exchange"].active:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.service-tab.active.tab-sharepoint,
.service-tab[data-service="sharepoint"].active {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.service-tab[data-service="sharepoint"].active:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.service-tab.active.tab-onedrive,
.service-tab[data-service="onedrive"].active {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.service-tab[data-service="onedrive"].active:hover {
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.service-tab.active.tab-alerts,
.service-tab[data-service="alerts"].active {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.service-tab[data-service="alerts"].active:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

/* ========================================
   FILTER BUTTON - Botões de Filtro
   ======================================== */

.filter-btn,
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-btn:hover,
.btn-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    color: white;
}

.filter-btn.active,
.btn-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   ICON BUTTONS - Botões Apenas com Ícone
   ======================================== */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(15deg) scale(1.1);
}

/* ========================================
   LOADING STATE - Estado de Carregamento
   ======================================== */

.btn-loading,
.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-loading::after,
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* ========================================
   BUTTON GROUP - Grupo de Botões
   ======================================== */

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}

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

@media (max-width: 768px) {
    .btn,
    .btn-primary {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        justify-content: center;
    }
    
    .service-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

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

/* Modo de Alto Contraste */
@media (prefers-contrast: high) {
    .btn,
    .btn-primary {
        border: 2px solid white;
    }
}

/* Preferência por Movimento Reduzido */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn-primary,
    .tab-button,
    .filter-btn {
        transition: none;
        animation: none;
    }
    
    .btn::before,
    .btn-primary::before {
        display: none;
    }
}
