/* Invoice Dashboard Styles */

.invoices-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

/* Charts Section */
.charts-section {
    margin-bottom: 2rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out;
}

.chart-card:nth-child(1) { animation-delay: 0.1s; }
.chart-card:nth-child(2) { animation-delay: 0.2s; }

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1rem;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-color.paid { 
    background-color: #10B981; 
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.legend-color.unpaid { 
    background-color: #F59E0B; 
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.legend-color.overdue { 
    background-color: #EF4444; 
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.legend-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Latest Invoices Section */
.latest-invoices-section {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: slideInUp 0.6s ease-out;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.view-all-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    color: var(--accent-hover);
    transform: translateX(2px);
}

/* Invoices Grid */
.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.invoice-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
    transform: translateX(20px);
}

.invoice-card:nth-child(1) { animation-delay: 0.3s; }
.invoice-card:nth-child(2) { animation-delay: 0.4s; }
.invoice-card:nth-child(3) { animation-delay: 0.5s; }
.invoice-card:nth-child(4) { animation-delay: 0.6s; }
.invoice-card:nth-child(5) { animation-delay: 0.7s; }

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

/* Overdue Invoice Highlighting */
.invoice-overdue {
    border-color: #EF4444 !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
    animation: pulseOverdue 2s infinite !important;
}

.invoice-overdue .invoice-status {
    animation: pulseOverdue 2s infinite;
}

.invoice-overdue:hover {
    border-color: #EF4444 !important;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2) !important;
}

/* Soon Due Invoice Highlighting */
.invoice-soon-due {
    border-color: #F59E0B !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
    animation: pulseSoonDue 3s infinite !important;
}

.invoice-soon-due .invoice-status {
    animation: pulseSoonDue 3s infinite;
}

.invoice-soon-due:hover {
    border-color: #F59E0B !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2) !important;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.invoice-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-prefix {
    color: var(--accent-color);
}

.invoice-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-1 { background-color: #FEF3C7; color: #92400E; } /* Unpaid */
.status-2 { background-color: #D1FAE5; color: #065F46; } /* Paid */
.status-3 { background-color: #DBEAFE; color: #1E40AF; } /* Partially */
.status-4 { background-color: #FEE2E2; color: #991B1B; } /* Overdue */
.status-5 { background-color: #F3F4F6; color: #374151; } /* Cancelled */
.status-6 { background-color: #E5E7EB; color: #6B7280; } /* Draft */

.invoice-content {
    margin-bottom: 1rem;
}

.invoice-amount {
    margin-bottom: 0.75rem;
}

.amount-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.amount-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-item i {
    width: 14px;
    color: var(--accent-color);
}

.invoice-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-view {
    background-color: var(--accent-color);
    color: var(--btn-principal-text);
}

.btn-view:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-pay {
    background-color: #10B981;
    color: white;
}

.btn-pay:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeIn 0.8s ease-out;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.empty-state h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.empty-state p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulseOverdue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

@keyframes pulseSoonDue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

/* Loading state for charts */
.chart-container.loading {
    position: relative;
}

.chart-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .invoices-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .invoice-actions {
        flex-direction: column;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .chart-card,
    .latest-invoices-section {
        padding: 1rem;
    }
    
    .invoice-card {
        padding: 1rem;
    }
} 