/* E-Invoice Module Styles */

/* E-Invoice Configuration */
.einvoice-config {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #17a2b8;
}

.einvoice-config h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.config-status {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.config-status.configured {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.config-status.not-configured {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* E-Invoice Statistics */
.einvoice-stats {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.einvoice-stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.einvoice-stat-card:hover {
    transform: translateY(-2px);
}

.einvoice-stat-card h4 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.einvoice-stat-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.einvoice-stat-card.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.einvoice-stat-card.sent {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.einvoice-stat-card.failed {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.einvoice-stat-card.amount {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* E-Invoice Actions */
.einvoice-actions {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.einvoice-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* E-Invoice Table */
.einvoice-table-wrapper {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#eInvoicesTable {
    margin: 0;
}

#eInvoicesTable thead {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

#eInvoicesTable thead th {
    border: none;
    padding: 1rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

#eInvoicesTable tbody td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

#eInvoicesTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* E-Invoice Configuration Modal */
.einvoice-config-modal .modal-dialog {
    max-width: 600px;
}

.einvoice-config-modal .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.einvoice-config-modal .form-control,
.einvoice-config-modal .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.einvoice-config-modal .form-control:focus,
.einvoice-config-modal .form-select:focus {
    border-color: #17a2b8;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.test-mode-warning {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: none;
    color: #2d3436;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* E-Invoice Conversion Modal */
.conversion-modal .modal-dialog {
    max-width: 800px;
}

.conversion-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.conversion-section h6 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #17a2b8;
    padding-bottom: 0.5rem;
}

/* Processing Loader */
.processing-loader {
    text-align: center;
    padding: 2rem;
    display: none;
}

.processing-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #17a2b8;
}

.processing-loader h5 {
    margin-top: 1rem;
    color: #2c3e50;
}

.processing-loader p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Document Type Badges */
.document-type-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
}

.document-type-SATIS {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.document-type-IADE {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.document-type-ISTISNA {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* E-Archive Status */
.earchive-status {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.earchive-status i {
    margin-right: 0.3rem;
}

.earchive-status.delivered {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.earchive-status.sent {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
}

.earchive-status.failed {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.earchive-status.preparing {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

/* Digital Signature Info */
.digital-signature-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.digital-signature-info h6 {
    color: #155724;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.digital-signature-info .signature-hash {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    word-break: break-all;
}

/* XML Preview */
.xml-preview {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #4a5568;
}

.xml-preview .xml-tag {
    color: #9f7aea;
}

.xml-preview .xml-attr {
    color: #68d391;
}

.xml-preview .xml-value {
    color: #fbd38d;
}

/* E-Invoice Detail Modal */
.einvoice-detail-modal .modal-dialog {
    max-width: 90%;
}

.einvoice-detail-tabs .nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.einvoice-detail-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
}

.einvoice-detail-tabs .nav-link.active {
    background: none;
    border-bottom-color: #17a2b8;
    color: #17a2b8;
}

.einvoice-detail-tabs .tab-content {
    padding: 1.5rem 0;
    min-height: 400px;
}

/* Status Timeline */
.status-timeline {
    position: relative;
    padding-left: 2rem;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #17a2b8, #e9ecef);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 0.3rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #17a2b8;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #17a2b8;
}

.timeline-item.completed::before {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.timeline-item.failed::before {
    background: #dc3545;
    box-shadow: 0 0 0 2px #dc3545;
}

.timeline-content h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #2c3e50;
}

.timeline-content small {
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .einvoice-config {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .einvoice-stats {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .einvoice-table-wrapper {
        padding: 1rem;
        overflow-x: auto;
    }
    
    #eInvoicesTable {
        font-size: 0.85rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 6px !important;
    }
    
    .conversion-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Animation Effects */
@keyframes statusUpdate {
    0% {
        transform: scale(1);
        background-color: var(--bs-primary);
    }
    50% {
        transform: scale(1.1);
        background-color: var(--bs-warning);
    }
    100% {
        transform: scale(1);
        background-color: var(--bs-success);
    }
}

.status-updating {
    animation: statusUpdate 2s ease-in-out;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.loading-overlay .spinner-border {
    color: #17a2b8;
}

/* E-Invoice Conversion Progress */
.conversion-progress {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.progress-step.completed:not(:last-child)::after {
    background: #28a745;
}

.step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
}

.progress-step.completed .step-circle {
    background: #28a745;
    color: white;
}

.progress-step.active .step-circle {
    background: #17a2b8;
    color: white;
}

.step-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.progress-step.completed .step-label {
    color: #28a745;
}

.progress-step.active .step-label {
    color: #17a2b8;
}