/* Complete Updated CSS with Fixed Date Column Colors */

/* Recent Invoices Button in Nav */
.nav-links a#recentInvoicesBtn {
    display: flex;
    align-items: center;
}

.nav-links a#recentInvoicesBtn:before {
    content: '\f1da';  /* Font Awesome history icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 5px;
    font-size: 0.9em;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s;
    opacity: 0;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #f1f1f1;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 24px;
    background-color: #000;
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
}

.dark-mode .close-modal {
    color: #f1f1f1;
}

.close-modal:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
}

.dark-mode .modal-footer {
    background-color: #333;
}

/* Invoice History Table */
.invoice-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.history-table-header {
    display: flex;
    background-color: #000000;
    color: white;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
}

.history-table-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.history-table-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.history-table-row:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.history-column {
    padding: 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-table-header .history-column {
    padding-top: 8px;
    padding-bottom: 8px;
    color: white; /* Make sure ALL header columns are white */
}

.history-table-body {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Column sizing */
.history-column:nth-child(1) {
    width: 15%;
    font-weight: 600;
}

.history-column:nth-child(2) {
    width: 30%;
}

.history-column:nth-child(3) {
    width: 25%;
    font-size: 0.9em;
}

/* Make the Date column header white in the header row */
.history-table-header .history-column:nth-child(3) {
    color: white !important; /* Override any other styles */
    font-weight: 600 !important; /* Make it bold like other headers */
}

/* Make the date text in data rows darker and more visible */
.history-table-row .history-column:nth-child(3) {
    color: #333333 !important; /* Darker color for better visibility */
}

.history-column:nth-child(4) {
    width: 15%;
    font-weight: 600;
    padding-right: 8px;
}

.actions-column {
    width: 15%;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Empty history state */
.empty-history {
    padding: 32px;
    text-align: center;
    color: #666666;
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-subtext {
    font-size: 0.9em;
    max-width: 400px;
    margin: 16px auto 0;
}

/* Action buttons */
.history-download {
    color: #000000;
}

.history-delete {
    color: #f44336;
}

.history-download, .history-delete {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.history-download:hover, .history-delete:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Notification styles */
.invoice-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #000000;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.invoice-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.dark-mode .invoice-notification {
    background-color: #444;
}

/* Dark mode adjustments */
.dark-mode .history-table-row .history-column:nth-child(3) {
    color: #e0e0e0 !important; /* Lighter color for dates in dark mode */
}

.dark-mode .history-table-row {
    border-bottom-color: #333333;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .history-column:nth-child(1) {
        width: 20%;
    }
    
    .history-column:nth-child(2) {
        width: 35%;
    }
    
    .history-column:nth-child(3) {
        display: none; /* Hide date on mobile */
    }
    
    .history-column:nth-child(4) {
        width: 20%;
    }
    
    .actions-column {
        width: 25%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .history-download, .history-delete {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }
}