/* Responsive Tables - Mobile Cards */
/* Este arquivo transforma tabelas em cards no mobile */

/* Desktop: manter tabelas normais */
@media (min-width: 769px) {
    .table-responsive {
        display: block;
    }
    
    .mobile-cards {
        display: none !important;
    }
}

/* Mobile: transformar em cards */
@media (max-width: 768px) {
    /* Esconder tabelas no mobile */
    .table-responsive {
        display: none !important;
    }
    
    /* Mostrar cards no mobile */
    .mobile-cards {
        display: block;
    }
    
    /* Container dos cards */
    .mobile-cards-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    /* Card individual */
    .mobile-card {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .mobile-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }
    
    /* Header do card com cor baseada no tipo (para transações) */
    .mobile-card-header {
        padding: 1rem;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-bottom: 1px solid #dee2e6;
        position: relative;
    }
    
    .mobile-card-header.income {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border-left: 4px solid #28a745;
    }
    
    .mobile-card-header.expense {
        background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
        border-left: 4px solid #dc3545;
    }
    
    /* Corpo do card */
    .mobile-card-body {
        padding: 1rem;
    }
    
    /* Linha de informação */
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .mobile-card-row:last-child {
        border-bottom: none;
    }
    
    .mobile-card-row:first-child {
        padding-top: 0;
    }
    
    /* Label da informação */
    .mobile-card-label {
        font-weight: 600;
        color: #495057;
        font-size: 0.875rem;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    /* Valor da informação */
    .mobile-card-value {
        color: #212529;
        font-size: 0.875rem;
        text-align: right;
        flex: 1;
        margin-left: 0.5rem;
    }
    
    /* Badges especiais */
    .mobile-card-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 500;
        white-space: nowrap;
    }
    
    .mobile-card-badge.income {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    .mobile-card-badge.expense {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    .mobile-card-badge.secondary {
        background-color: #e2e3e5;
        color: #383d41;
        border: 1px solid #d6d8db;
    }
    
    .mobile-card-badge.primary {
        background-color: #cce7ff;
        color: #004085;
        border: 1px solid #b3d9ff;
    }
    
    .mobile-card-badge.info {
        background-color: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }
    
    .mobile-card-badge.success {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    .mobile-card-badge.warning {
        background-color: #fff3cd;
        color: #856404;
        border: 1px solid #ffeaa7;
    }
    
    .mobile-card-badge.danger {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    /* Footer do card com botões de ação */
    .mobile-card-footer {
        padding: 1rem;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    
    /* Botões de ação */
    .mobile-card-btn {
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        cursor: pointer;
        min-height: 36px;
    }
    
    .mobile-card-btn:hover {
        transform: translateY(-1px);
        text-decoration: none;
    }
    
    .mobile-card-btn:active {
        transform: translateY(0);
    }
    
    .mobile-card-btn.btn-outline-primary {
        color: #673ab7;
        border-color: #673ab7;
        background: transparent;
    }
    
    .mobile-card-btn.btn-outline-primary:hover {
        background: #673ab7;
        color: white;
    }
    
    .mobile-card-btn.btn-outline-danger {
        color: #dc3545;
        border-color: #dc3545;
        background: transparent;
    }
    
    .mobile-card-btn.btn-outline-danger:hover {
        background: #dc3545;
        color: white;
    }
    
    .mobile-card-btn.btn-outline-info {
        color: #0dcaf0;
        border-color: #0dcaf0;
        background: transparent;
    }
    
    .mobile-card-btn.btn-outline-info:hover {
        background: #0dcaf0;
        color: white;
    }
    
    .mobile-card-btn.btn-outline-warning {
        color: #ffc107;
        border-color: #ffc107;
        background: transparent;
    }
    
    .mobile-card-btn.btn-outline-warning:hover {
        background: #ffc107;
        color: white;
    }
    
    .mobile-card-btn.btn-outline-success {
        color: #198754;
        border-color: #198754;
        background: transparent;
    }
    
    .mobile-card-btn.btn-outline-success:hover {
        background: #198754;
        color: white;
    }
    
    /* Ícones nos botões */
    .mobile-card-btn i {
        font-size: 1rem;
    }
    
    /* Valor monetário destacado */
    .mobile-card-value.money {
        font-weight: 600;
        font-size: 1rem;
    }
    
    .mobile-card-value.money.income {
        color: #28a745;
    }
    
    .mobile-card-value.money.expense {
        color: #dc3545;
    }
    
    /* Descrição longa com truncamento */
    .mobile-card-value.description {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Campos múltiplos (para usuários) */
    .mobile-card-fields {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: flex-end;
    }
    
    /* Estado vazio */
    .mobile-card-empty {
        text-align: center;
        padding: 2rem;
        color: #6c757d;
        font-style: italic;
    }
    
    /* Loading state */
    .mobile-cards-loading {
        text-align: center;
        padding: 2rem;
    }
    
    .mobile-cards-loading .spinner-border {
        width: 2rem;
        height: 2rem;
        color: #673ab7;
    }
    
    /* Animações */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .mobile-card {
        animation: fadeInUp 0.3s ease-out;
    }
    
    /* Scroll suave */
    .mobile-cards-container {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Melhorias para touch */
    .mobile-card-btn {
        min-height: 44px; /* Tamanho mínimo para touch */
        touch-action: manipulation;
    }
    
    /* Espaçamento para botão flutuante */
    .mobile-cards-container {
        padding-bottom: 100px;
    }
}
