/**
 * Web2Print Styles - Modern Clean Design
 */

/* ==================== GENERAL ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 0;
    border-bottom: 3px solid #f0f0f0;
}

.navbar-brand {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo-img {
    height: 50px;
    width: auto;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.5px;
}

.navbar-logo {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(45, 55, 72, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav {
    gap: 0.5rem;
}

.nav-link {
    color: #4a5568 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
    position: relative;
    background: transparent !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #2d3748 !important;
}

.nav-link:hover::after {
    background: #dc2626;
}

.nav-link.active {
    color: #2d3748 !important;
}

.nav-link.active::after {
    background: #dc2626;
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 250px;
}

.dropdown-item {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f7fafc;
    color: #dc2626;
    padding-left: 2rem;
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
    color: #9ca3af;
}

.dropdown-item:hover i {
    color: #dc2626;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.5rem 0.25rem 1.5rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e5e7eb;
}

.nav-link.dropdown-toggle::after {
    display: none;
}

/* ==================== STEP NAVIGATION ==================== */
.step-navigation {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.step-navigation::-webkit-scrollbar {
    height: 6px;
}

.step-navigation::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.step-navigation::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3.5rem;
    max-width: 1200px;
    margin: 0 auto;
    min-width: max-content;
    padding: 0 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    min-width: 180px;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step.active .step-number {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.step-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    min-width: 120px;
}

.step.active .step-label {
    color: #2d3748;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #dc2626;
    text-underline-offset: 4px;
}

/* Connector Line between steps - Verdoppelte Länge und +2px Dicke */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1.34rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.34rem;
    height: 4px;
    background: #e5e7eb;
}

@media (max-width: 1200px) {
    .steps {
        gap: 2.5rem;
        padding: 0 1.5rem;
    }
    
    .step {
        min-width: 160px;
    }
    
    .step:not(:last-child)::after {
        width: 1.10rem;
        right: -1.10rem;
    }
}

@media (max-width: 992px) {
    .steps {
        gap: 2rem;
        justify-content: flex-start;
        padding: 0 1rem;
    }
    
    .step {
        min-width: 140px;
    }
    
    .step-label {
        font-size: 0.875rem;
        min-width: 100px;
    }
    
    .step:not(:last-child)::after {
        width: 0.90rem;
        right: -0.90rem;
    }
}

@media (max-width: 768px) {
    .step-navigation {
        padding: 1rem 0;
    }
    
    .steps {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .step {
        min-width: 120px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .step-label {
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .step {
        min-width: auto;
    }
    
    .step-label {
        display: none;
        min-width: auto;
    }
    
    .step.active .step-label {
        display: block;
    }
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    background: #ffffff;
}

.card-header {
    background: #dc2626;
    border-bottom: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.card-header i {
    display: none;
}

.card-body {
    padding: 1.5rem;
    background: #fafafa;
}

/* ==================== FORMS ==================== */

/* Static Label (für Rich Text Editor, QR-Code etc.) */
.form-label-static {
    display: block;
    margin-bottom: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-label-static .text-danger {
    color: #dc2626;
    margin-left: 0.25rem;
}

/* Floating Label Container */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label {
    position: absolute;
    left: 0.5rem;
    top: 0.625rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transform-origin: left top;
}

.form-label i {
    font-size: 0.875rem;
    color: #9ca3af;
}

.form-control,
.form-select {
    border: none;
    border-bottom: 2px solid #e2e8f0;
    border-radius: 0;
    padding: 0.625rem 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: transparent;
    width: 100%;
}

/* Floating Label Animation */
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    transform: translateY(-1.5rem) scale(0.85);
    color: #dc2626;
}

.form-control:focus ~ .form-label i,
.form-control:not(:placeholder-shown) ~ .form-label i {
    color: #dc2626;
}

.form-control:focus,
.form-select:focus {
    border-bottom-color: #dc2626;
    box-shadow: none;
    outline: none;
    background: white;
}

.form-control:hover {
    border-bottom-color: #dc2626;
}

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

/* Select Box - erkennbar machen */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23718096' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background-color: white;
}

.form-select:hover {
    border-color: #cbd5e0;
}

.form-select:focus {
    border-color: #dc2626;
    background-color: white;
}

/* Two-column layout for forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* Summernote Editor - Minimal Overrides */
.summernote-wrapper {
    margin-bottom: 1rem;
    max-width: 40vw;
    overflow: hidden;
}

.note-editor {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 40vw;
    width: 100%;
}

.note-editor:focus-within {
    border-color: #dc2626;
}

.note-toolbar {
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.note-editable {
    min-height: 250px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
}

.note-editable p {
    margin-bottom: 0.75rem;
}

.note-editable:focus {
    background: white;
}

/* Preview Field - Paragraph Spacing */
.preview-field-text p {
    margin: 0;  /* Kein extra Margin */
    line-height: 1.2;  /* Zeilenabstand innerhalb des Absatzes */
}

.preview-field-text p + p {
    margin-top: 1.2em;  /* Abstand zwischen Absätzen = 1 Zeilenhöhe */
}

.preview-field-text p:last-child {
    margin-bottom: 0;  /* Kein Abstand beim letzten Absatz */
}

.note-editable:focus {
    background: white;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-success {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-success:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.btn-success:disabled {
    background: #cbd5e0;
    box-shadow: none;
    transform: none;
}

.btn-outline-secondary {
    border: 2px solid #e2e8f0;
    color: #4a5568;
}

.btn-outline-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.btn-outline-secondary.active,
.btn-outline-secondary:active {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
    border-radius: 0;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    background-color: transparent;
}

.alert i {
    display: none; /* Icons ausblenden */
}

.alert-info i {
    display: inline-block; /* Icon für Info-Alerts anzeigen */
    margin-right: 0.5rem;
}

.alert-info {
    color: #4a5568;
    font-weight: 700;
}

.alert-warning {
    color: #dd6b20;
}

.alert-danger {
    color: #e53e3e;
}

.alert-success {
    color: #38a169;
}

/* ==================== TABS ==================== */
.nav-tabs {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #718096;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.nav-tabs .nav-link:hover {
    color: #4a5568;
    border-color: transparent;
    background: #f7fafc;
}

.nav-tabs .nav-link.active {
    color: #dc2626;
    border-bottom-color: transparent;
    background: transparent;
    font-weight: 700;
}

/* ==================== PREVIEW ==================== */
.preview-wrapper {
    position: relative;
}

.preview-scroll-container {
    overflow: auto;
    /* max-height entfernt - Container passt sich Vorschau-Höhe an */
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f7fafc;
    padding: 24px;
}

.pdf-preview-placeholder {
    position: relative;
    width: 100%;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.preview-fields {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

/* ==================== ZOOM CONTROLS ==================== */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

/* ==================== BADGES ==================== */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-secondary {
    background-color: #718096 !important;
}

.badge.bg-info {
    background-color: #4299e1 !important;
}

/* ==================== DEBUG MODE ==================== */
.field-marker {
    width: 12px;
    height: 12px;
    background: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 8px;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.field-marker:hover {
    background: #b91c1c;
    transform: scale(1.2);
}

.field-label {
    font-size: 10px;
    color: #718096;
    margin-top: 2px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

.field-value-debug {
    position: absolute;
    top: 20px;
    left: 0;
    font-size: 11px;
    color: #2d3748;
    background: rgba(220, 38, 38, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #dc2626;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== SPINNER ==================== */
.spinner-border {
    color: #dc2626;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .container-fluid {
        padding: 15px;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .card-header,
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert,
.card {
    animation: fadeIn 0.4s ease-out;
}

/* ==================== UTILITIES ==================== */
.text-required {
    color: #e53e3e;
}

/* ==================== SCROLLBAR STYLING ==================== */
.preview-scroll-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.preview-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.preview-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.preview-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
