/* Invoice page styling */

.invoice-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.invoice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #00C0F9, #293241) !important;
    z-index: 1;
}

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.invoice-info {
    flex: 1;
}

.invoice-info h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1rem;
}

.client-name {
    color: #555;
    margin-bottom: 12px;
    font-weight: 500;
}

.invoice-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.invoice-detail {
    margin-bottom: 10px;
}

.detail-label {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

.invoice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 160px;
    align-items: flex-end;
}

.invoice-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: none;
}

.draft-badge {
    background-color: #f0f0f0;
    color: #777;
}

.sent-badge {
    background-color: #e3f2fd;
    color: #1976d2;
}

.paid-badge {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.overdue-badge {
    background-color: #ffebee;
    color: #c62828;
}

.cancelled-badge {
    background-color: #f5f5f5;
    color: #9e9e9e;
    text-decoration: line-through;
}

/* Invoice modal */
.invoice-form {
    max-width: 100%;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Time entries table */
#time-entries-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#time-entries-table th, 
#time-entries-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#time-entries-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    position: relative;
}


#time-entries-table tbody tr:hover {
    background-color: #f5f5f5;
}

#time-entries-table tfoot td {
    font-weight: 600;
    border-top: 2px solid #ddd;
}

#time-entries-table tfoot tr:last-child td {
    font-size: 1.1em;
    color: #333;
}

.text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .invoice-card {
        flex-direction: column;
    }
    
    .invoice-actions {
        flex-direction: row;
        margin-top: 15px;
        align-items: center;
        justify-content: flex-start;
    }
    
    .invoice-amount {
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    #time-entries-table {
        display: block;
        overflow-x: auto;
    }
}

/* Loading indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loading i {
    font-size: 2rem;
    color: #2196f3;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and error messages - Standardized format */
.success-message {
    background-color: white;
    color: var(--success);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    margin-bottom: 20px;
    display: none;
    border: 2px solid var(--success);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 9999;
    max-width: 400px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.success-message i, .error-message i {
    margin-right: 10px;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.no-results p {
    margin-bottom: 20px;
    color: #666;
    font-size: 1.1rem;
}

/* Danger button style for delete actions */
.danger {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.danger:hover {
    background-color: #ef5350;
    color: white;
    border-color: #e53935;
}

/* Highlight animation for newly created invoice */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.highlight {
    animation: highlight-pulse 1.5s ease-in-out;
    border: 1px solid #2196f3;
}

/* Loading overlay for PDF generation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
    font-weight: 600;
    color: #2196f3;
}

.loading-overlay i {
    margin-right: 10px;
}