/* Custom CSS for RH NetSulwel */

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

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Login Page Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.6); }
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

/* Backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 50%, #f3e8ff 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Shadows */
.shadow-purple {
    box-shadow: 0 10px 25px -5px rgba(168, 85, 247, 0.2), 0 4px 6px -2px rgba(168, 85, 247, 0.1);
}

.shadow-purple-login {
    box-shadow: 0 20px 40px -12px rgba(168, 85, 247, 0.25);
}

/* Gradients */
.gradient-primary {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6b21a8 100%);
}

/* Navigation */
.nav-item.active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6b21a8 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover:not(.active) {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
}

/* Cards */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6b21a8 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 8px 15px rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    box-shadow: 0 8px 15px rgba(107, 114, 128, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 8px 15px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #7c3aed;
    border: 1px solid #7c3aed;
}

.btn-outline:hover {
    background: rgba(124, 58, 237, 0.1);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.btn-icon:hover {
    background: rgba(124, 58, 237, 0.1);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Forms */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(168, 85, 247, 0.05);
}

/* Table Responsive - Scroll horizontal no mobile */
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* MOBILE: Forçar todas as colunas a aparecerem com scroll horizontal */
@media (max-width: 768px) {
    /* Container da tabela */
    .overflow-x-auto {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
    }
    
    /* Tabela deve ter largura mínima para forçar scroll */
    .overflow-x-auto table {
        min-width: 800px !important; /* Largura mínima para forçar scroll */
        width: max-content !important;
        display: table !important;
    }
    
    /* FORÇAR todas as colunas (th e td) a aparecerem */
    table th,
    table td {
        display: table-cell !important;
        visibility: visible !important;
        opacity: 1 !important;
        white-space: nowrap !important; /* Evitar quebra de linha */
        min-width: 100px !important; /* Largura mínima para cada coluna */
    }
    
    /* Garantir que colunas com classes de ocultação apareçam */
    table th[class*="hidden"],
    table td[class*="hidden"],
    table th[class*="d-none"],
    table td[class*="d-none"],
    table th[class*="md:"],
    table td[class*="md:"],
    table th[class*="lg:"],
    table td[class*="lg:"] {
        display: table-cell !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Remover qualquer display: none aplicado */
    table thead,
    table tbody {
        display: table-row-group !important;
    }
    
    table tr {
        display: table-row !important;
    }
    
    /* Ajustar padding das células no mobile */
    table th {
        padding: 0.75rem 1rem !important;
        font-size: 0.75rem !important;
    }
    
    table td {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Indicador visual de scroll */
    .overflow-x-auto::after {
        position: sticky;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to top, rgba(168, 85, 247, 0.15), transparent);
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        color: #7c3aed;
        font-weight: 700;
        pointer-events: none;
        opacity: 0.9;
        animation: pulse 2s ease-in-out infinite;
    }
    
    @keyframes pulse {
        0%, 100% { opacity: 0.9; }
        50% { opacity: 0.6; }
    }
    
    /* Esconder indicador quando já scrollou */
    .overflow-x-auto.scrolled::after {
        display: none;
    }
    
    /* Garantir que a primeira coluna seja sempre visível (sticky) */
    .overflow-x-auto table thead th:first-child,
    .overflow-x-auto table tbody td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 10 !important;
        background: white !important;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05) !important;
    }
    
    .overflow-x-auto table thead th:first-child {
        background: linear-gradient(to right, #faf5ff, #f3e8ff) !important;
        z-index: 11 !important;
    }
}

/* Alerts */
.alert {
    border-left-width: 4px;
}

.alert-success {
    border-left-color: #10b981;
    background-color: #ecfdf5;
}

.alert-error {
    border-left-color: #ef4444;
    background-color: #fef2f2;
}

.alert-info {
    border-left-color: #3b82f6;
    background-color: #eff6ff;
}

/* Toasts */
#toast-container {
    z-index: 9999;
}

.toast-item {
    min-width: 300px;
    max-width: 400px;
}

@media (max-width: 640px) {
    .toast-item {
        min-width: auto;
        max-width: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pt-36 {
        padding-top: 20rem;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        margin-right: 0;
    }
}