/**
 * BillingCheck - Billing Explainer Styles
 * Zusätzliche Styles für das Abrechnungserläuterungs-Tool
 */

/* ============================================== */
/* LAYOUT */
/* ============================================== */

.explainer-main {
    min-height: calc(100vh - 60px);
}

/* ============================================== */
/* DEPLOYMENT STEPS */
/* ============================================== */

.deployment-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.deployment-steps .step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.deployment-steps .step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color, #003366);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.deployment-steps .step-content {
    flex: 1;
}

.deployment-steps .step-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.deployment-steps .step-content code {
    display: block;
    background: #1e293b;
    color: #10b981;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* ============================================== */
/* DROPZONE */
/* ============================================== */

.dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-color, #003366);
    background: #f0f7ff;
}

.dropzone-small {
    padding: 1.5rem;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.dropzone p {
    margin: 0;
    color: #666;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: #999 !important;
    margin-top: 0.5rem !important;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #e8f5e9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-info .file-icon {
    font-size: 1.5rem;
}

.file-info .file-details {
    flex: 1;
}

.file-info .file-name {
    font-weight: 600;
    color: #333;
}

.file-info .file-size {
    font-size: 0.85rem;
    color: #666;
}

.file-info .remove-file {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
}

.file-info .remove-file:hover {
    color: #e53935;
}

/* ============================================== */
/* FORM ELEMENTS */
/* ============================================== */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #003366);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================== */
/* BUTTONS */
/* ============================================== */

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color, #003366);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #002244;
}

.btn-secondary {
    background: #e5e7eb;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================== */
/* UPLOAD OPTIONS */
/* ============================================== */

.upload-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
}

.upload-option {
    text-align: center;
}

.upload-option h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #666;
}

.upload-divider {
    color: #999;
    font-style: italic;
}

@media (max-width: 768px) {
    .upload-options {
        grid-template-columns: 1fr;
    }

    .upload-divider {
        padding: 1rem 0;
    }
}

/* ============================================== */
/* BILLING SUMMARY */
/* ============================================== */

.billing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #003366);
}

.summary-item .value.positive {
    color: #10b981;
}

.summary-item .value.negative {
    color: #ef4444;
}

/* ============================================== */
/* DATA TABLE */
/* ============================================== */

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .text-right {
    text-align: right;
}

.data-table .positive {
    color: #10b981;
}

.data-table .negative {
    color: #ef4444;
}

.data-table .empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* ============================================== */
/* DOCUMENTS LIST */
/* ============================================== */

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.document-item:hover {
    background: #f0f4f8;
}

.document-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
}

.document-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.document-meta {
    font-size: 0.85rem;
    color: #666;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================== */
/* EXPLANATION STYLES */
/* ============================================== */

.explanation-summary {
    padding: 1.5rem;
    background: linear-gradient(135deg, #003366 0%, #00557f 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.explanation-summary h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.explanation-positions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.position-explanation {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease;
}

.position-header:hover {
    background: #f0f4f8;
}

.position-header .position-number {
    font-weight: 700;
    color: var(--primary-color, #003366);
    margin-right: 1rem;
}

.position-header .position-type {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 1rem;
}

.position-header .position-type.ap {
    background: #dcfce7;
    color: #166534;
}

.position-header .position-type.bp {
    background: #dbeafe;
    color: #1e40af;
}

.position-header .position-type.dp {
    background: #fef3c7;
    color: #92400e;
}

.position-header .position-type.sp {
    background: #f3e8ff;
    color: #7c3aed;
}

.position-header .position-type.storno {
    background: #fee2e2;
    color: #991b1b;
}

.position-header .position-info {
    flex: 1;
}

.position-header .position-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.position-header .expand-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.position-explanation.expanded .position-header .expand-icon {
    transform: rotate(180deg);
}

.position-details {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.position-explanation.expanded .position-details {
    display: block;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
}

.detail-item .label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-weight: 600;
    color: #333;
}

.calculation-steps {
    background: #f8fafc;
    border-radius: 6px;
    padding: 1rem;
}

.calculation-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.calculation-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--primary-color, #003366);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-description {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.step-formula {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #666;
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
}

.ki-explanation {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem;
}

.ki-explanation h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--primary-color, #003366);
}

.ki-explanation p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.besonderheiten-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.besonderheit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
}

.besonderheit-item.hinweis {
    background: #fef3c7;
}

.besonderheit-item.positiv {
    background: #dcfce7;
}

.besonderheit-item.negativ {
    background: #fee2e2;
}

.besonderheit-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.besonderheit-content h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: #333;
}

.besonderheit-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* ============================================== */
/* BADGES & TAGS */
/* ============================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================== */
/* ALERTS */
/* ============================================== */

.alert {
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================== */
/* MODAL */
/* ============================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ============================================== */
/* TOAST */
/* ============================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================== */
/* RESPONSIVE */
/* ============================================== */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .billing-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-actions {
        flex-wrap: wrap;
    }
}
