/**
 * Mood Finance - Custom Styles
 * Sprint 3: UX & Frontend
 * 
 * Complemento ao Tailwind CSS
 */

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ============================================
   CARDS & SHADOWS
   ============================================ */

.card-hover {
    transition: all 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.shadow-brand {
    box-shadow: 0 4px 14px 0 rgba(236, 112, 20, 0.15);
}

/* ============================================
   BRAND COLORS UTILITIES
   ============================================ */

.bg-brand-gradient {
    background: linear-gradient(135deg, #EC7014 0%, #d46312 100%);
}

.text-gradient-brand {
    background: linear-gradient(135deg, #EC7014 0%, #d46312 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #EC7014;
    box-shadow: 0 0 0 3px rgba(236, 112, 20, 0.15);
}

.form-checkbox:checked {
    background-color: #EC7014;
    border-color: #EC7014;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-brand {
    background-color: #EC7014;
    color: white;
    transition: all 0.2s ease-in-out;
}

.btn-brand:hover {
    background-color: #d46312;
    transform: translateY(-1px);
}

.btn-brand:active {
    transform: translateY(0);
}

.btn-brand:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   TABLES
   ============================================ */

.table-striped tbody tr:nth-child(even) {
    background-color: rgba(248, 243, 235, 0.5);
}

.table-hover tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.table-hover tbody tr:hover {
    background-color: rgba(236, 112, 20, 0.05);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ============================================
   CHARTS
   ============================================ */

.chart-container {
    position: relative;
    min-height: 300px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-card {
    transition: all 0.2s ease-in-out;
}

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

.kpi-card .kpi-icon {
    transition: transform 0.2s ease-in-out;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1);
}

.kpi-value {
    font-variant-numeric: tabular-nums;
}

.kpi-trend-up {
    color: #10B981;
}

.kpi-trend-down {
    color: #EF4444;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-brand {
    background-color: rgba(236, 112, 20, 0.1);
    color: #EC7014;
}

/* ============================================
   TOOLTIPS
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .chart-container {
        min-height: 250px;
    }
    
    .kpi-card .text-2xl {
        font-size: 1.25rem;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        background: white;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}
