/* B2BRouter Invoice Module Styles */

.b2brouter-invoice-container {
    margin: 15px 0;
}

.b2brouter-invoice-status {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.b2brouter-invoice-status.draft {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.b2brouter-invoice-status.sent {
    background-color: #007bff;
    color: white;
}

.b2brouter-invoice-status.received {
    background-color: #ffc107;
    color: #212529;
}

.b2brouter-invoice-status.accepted {
    background-color: #28a745;
    color: white;
}

.b2brouter-invoice-status.rejected {
    background-color: #dc3545;
    color: white;
}

.b2brouter-invoice-status.cancelled {
    background-color: #6c757d;
    color: white;
}

.b2brouter-invoice-status.error {
    background-color: #dc3545;
    color: white;
    animation: pulse 2s infinite;
}

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

.b2brouter-invoice-actions {
    margin: 15px 0;
    text-align: center;
}

.b2brouter-invoice-actions .button {
    margin: 0 5px;
}

.b2brouter-send-invoice {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.b2brouter-send-invoice:hover {
    background-color: #0056b3;
    color: white;
}

.b2brouter-send-invoice:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.b2brouter-cancel-invoice {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.b2brouter-cancel-invoice:hover {
    background-color: #c82333;
    color: white;
}

.b2brouter-invoice-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.b2brouter-invoice-info h4 {
    margin-top: 0;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.b2brouter-invoice-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.b2brouter-invoice-meta-item {
    display: flex;
    flex-direction: column;
}

.b2brouter-invoice-meta-label {
    font-weight: bold;
    color: #495057;
    margin-bottom: 4px;
}

.b2brouter-invoice-meta-value {
    color: #6c757d;
}

.b2brouter-invoice-logs {
    margin-top: 20px;
}

.b2brouter-invoice-logs table {
    width: 100%;
    border-collapse: collapse;
}

.b2brouter-invoice-logs th,
.b2brouter-invoice-logs td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.b2brouter-invoice-logs th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.b2brouter-invoice-logs tr:hover {
    background-color: #f8f9fa;
}

.b2brouter-progress {
    background-color: #e9ecef;
    border-radius: 4px;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.b2brouter-progress-bar {
    background-color: #007bff;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.b2brouter-progress-bar.success {
    background-color: #28a745;
}

.b2brouter-progress-bar.error {
    background-color: #dc3545;
}

.b2brouter-notification {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    position: relative;
}

.b2brouter-notification.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.b2brouter-notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.b2brouter-notification.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.b2brouter-notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.b2brouter-notification-close {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: inherit;
    opacity: 0.7;
}

.b2brouter-notification-close:hover {
    opacity: 1;
}

.b2brouter-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #007bff;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.b2brouter-format-selector {
    margin: 10px 0;
}

.b2brouter-format-selector label {
    margin-right: 15px;
    cursor: pointer;
}

.b2brouter-format-selector input[type="radio"] {
    margin-right: 5px;
}

/* Peppol Status Styles */
#peppol-status-container {
    margin-top: 5px;
}

.peppol-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    float: right;
    clear: both;
}

.peppol-status.status-not-sent {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.peppol-status.status-draft {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.peppol-status.status-sending {
    background-color: #b3d4fc;
    color: #004085;
    border: 1px solid #7abaff;
}

.peppol-status.status-sent {
    background-color: #007bff;
    color: white;
}

.peppol-status.status-delivered {
    background-color: #17a2b8;
    color: white;
}

.peppol-status.status-received {
    background-color: #ffc107;
    color: #212529;
}

.peppol-status.status-accepted {
    background-color: #28a745;
    color: white;
}

.peppol-status.status-rejected {
    background-color: #dc3545;
    color: white;
}

.peppol-status.status-allegedly-paid {
    background-color: #28a745;
    color: white;
    opacity: 0.8;
}

.peppol-status.status-paid {
    background-color: #155724;
    color: white;
}

.peppol-status.status-error {
    background-color: #dc3545;
    color: white;
    animation: pulse 2s infinite;
}

.peppol-dates {
    color: #6c757d;
    font-style: italic;
    float: right;
    clear: both;
}

.peppol-xml-link {
    color: #007bff;
    text-decoration: none;
    float: right;
    clear: both;
}

.peppol-xml-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.peppol-xml-link i {
    margin-right: 3px;
}

/* Animation for loading status */
.peppol-status .fa-spinner {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .b2brouter-invoice-meta {
        grid-template-columns: 1fr;
    }

    .b2brouter-invoice-actions {
        text-align: left;
    }

    .b2brouter-invoice-actions .button {
        display: block;
        margin: 5px 0;
        width: 100%;
    }

    .peppol-status,
    .peppol-dates,
    .peppol-xml-link {
        float: none;
        display: block;
        margin: 5px 0;
    }
}