/* ===================================
   Invoice Management - Styles
   =================================== */

/* Invoice Section Container */
#invoices-section {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===================================
   Invoice Summary Cards
   =================================== */

.invoice-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.15) 0%, rgba(45, 91, 255, 0.15) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
}

.summary-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 15px;
}

.summary-content {
    flex: 1;
}

.summary-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #fff;
}

.summary-content p {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.7);
}

.summary-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

/* Specific card variants */
.unpaid-card .summary-icon {
    background: rgba(59, 130, 246, 0.2);
}

.paid-card .summary-icon {
    background: rgba(34, 197, 94, 0.2);
}

.overdue-card .summary-icon {
    background: rgba(239, 68, 68, 0.2);
}

/* ===================================
   Actions Bar
   =================================== */

.invoice-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.invoice-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select,
.search-input {
    padding: 12px 20px;
    background: rgba(30, 64, 175, 0.15);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.search-input {
    min-width: 250px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ===================================
   Invoice Table
   =================================== */

.invoice-table-container {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.15) 0%, rgba(45, 91, 255, 0.15) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    overflow: hidden;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table thead {
    background: rgba(30, 64, 175, 0.3);
}

.invoice-table th {
    padding: 20px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
}

.invoice-table tbody tr {
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    transition: background 0.2s ease;
}

.invoice-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.invoice-table tbody tr:last-child {
    border-bottom: none;
}

.invoice-table td {
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.empty-state p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===================================
   Status Badges
   =================================== */

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.status-sent {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-paid {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-cancelled {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* ===================================
   Action Buttons
   =================================== */

.action-btn {
    padding: 8px 16px;
    margin: 0 5px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.remind-btn {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
}

.remind-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

/* ===================================
   Invoice Form Modal
   =================================== */

.invoice-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.invoice-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #60a5fa;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background: rgba(30, 64, 175, 0.15);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid rgba(59, 130, 246, 0.3);
}

/* ===================================
   Invoice Details Modal
   =================================== */

.invoice-details-modal {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.invoice-details-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.invoice-details-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.invoice-details-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #60a5fa;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    padding-bottom: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.detail-value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
}

/* ===================================
   Toast Notifications
   =================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    background: rgba(30, 64, 175, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: rgba(34, 197, 94, 0.95);
    border-color: rgba(34, 197, 94, 0.7);
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    border-color: rgba(239, 68, 68, 0.7);
}

.toast-info {
    background: rgba(59, 130, 246, 0.95);
    border-color: rgba(59, 130, 246, 0.7);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    #invoices-section {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .invoice-summary-cards {
        grid-template-columns: 1fr;
    }

    .invoice-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-filters {
        flex-direction: column;
    }

    .filter-select,
    .search-input {
        width: 100%;
    }

    .invoice-table-container {
        overflow-x: auto;
    }

    .invoice-table {
        min-width: 800px;
    }

    .invoice-modal,
    .invoice-details-modal {
        max-width: 95%;
        max-height: 90vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }
}
