/* site.css dosyasına ekleyin veya mevcut stilleri güncelleyin */

html, body {
    height: 100%;
    margin: 0;
}

/* Genel Stil */
body {
    background-color: #f0f4f8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1
}

/* Navbar Stili */
.navbar {
    background-color: #2c5d86 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

/* Tab Stili */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    color: #2c5d86;
    font-weight: 500;
    border: none;
    padding: 10px 15px;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
}

    .nav-tabs .nav-link.active,
    .nav-tabs .nav-link:hover {
        color: white;
        background-color: #3498db;
        border: none;
    }

/* Tablo Stili - Sadece tab içlerindeki tablolar için */
.tab-pane .table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    table-layout: fixed;
}

    .tab-pane .table th {
        background-color: #3498db;
        color: white;
        padding: 12px 15px;
        text-align: left;
        white-space: nowrap;
    }

.tab-pane .table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;    
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kolon genişlikleri - Class tabanlı yaklaşım */
/* ID kolonu */
.tab-pane .table .col-refNo,
.tab-pane .table th.col-refNo {
    width: 20%;
    min-width: 200px;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timestamp kolonu */
.tab-pane .table .col-timestamp,
.tab-pane .table th.col-timestamp {
    width: 15%;
    min-width: 150px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flag kolonu */
.tab-pane .table .col-flag,
.tab-pane .table th.col-flag {
    width: 8%;
    min-width: 60px;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Serial Number kolonu */
.tab-pane .table .col-serial,
.tab-pane .table th.col-serial {
    width: 15%;
    min-width: 120px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* IP kolonu */
.tab-pane .table .col-ip,
.tab-pane .table th.col-ip {
    width: 12%;
    min-width: 120px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Function kolonu */
.tab-pane .table .col-function,
.tab-pane .table th.col-function {
    width: 10%;
    min-width: 80px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Directive kolonu */
.tab-pane .table .col-directive,
.tab-pane .table th.col-directive {
    width: 15%;
    min-width: 150px;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Yürütme: PaketNo (streaming kapalı + packageNo > 1 = son paket vurgusu) */
.tab-pane .table .col-package-no,
.tab-pane .table th.col-package-no {
    width: 6%;
    min-width: 72px;
    max-width: 96px;
    white-space: nowrap;
    text-align: center;
}

.tab-pane .table td.col-package-no.execute-paket-final {
    background-color: rgba(25, 135, 84, 0.18);
    font-weight: 600;
    border-left: 3px solid #198754;
}

.tab-pane .table td.col-package-no.execute-paket-final .execute-paket-final-mark {
    margin-left: 0.25rem;
    color: #198754;
    font-size: 0.85em;
}

/* Code kolonu */
.tab-pane .table .col-code,
.tab-pane .table th.col-code {
    width: 10%;
    min-width: 80px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Description kolonu */
.tab-pane .table .col-description,
.tab-pane .table th.col-description {
    width: 50%;
    min-width: 400px;
    max-width: 500px;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

/* Device Date kolonu */
.tab-pane .table .col-device-date,
.tab-pane .table th.col-device-date {
    width: 10%;
    min-width: 100px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Signal kolonu */
.tab-pane .table .col-signal,
.tab-pane .table th.col-signal {
    width: 10%;
    min-width: 100px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Network Quality kolonu */
.tab-pane .table .col-network-quality,
.tab-pane .table th.col-network-quality {
    width: 12%;
    min-width: 120px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Boş kolon */
.tab-pane .table .col-empty,
.tab-pane .table th.col-empty {
    width: 5%;
    min-width: 50px;
    white-space: nowrap;
}

/* Actions kolonu */
.tab-pane .table .col-actions,
.tab-pane .table th.col-actions {
    width: 10%;
    min-width: 120px;
    text-align: right;
}

.tab-pane .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(240, 244, 248, 0.5);
}

/* Footer Stili */
footer {
    background-color: #2c5d86;
    color: white;
    margin-top: 30px;
    padding: 15px 0;
    width: 100%;
}

    footer img {
        height: 30px;
    }

/* Kart Stili */
.card, .haberlesme-unitesi, .komutlar {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    padding: 15px;
}

.card-header {
    background-color: #3498db;
    color: white;
    padding: 9px 15px; /* %75 of 12px */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-weight: 500;
}

/* Buton Stili */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-success:hover {
    background-color: #219955;
    border-color: #219955;
}

.editable-select {
    position: relative;
    width: 250px;
    font-family: sans-serif;
    overflow: visible;
}

.editable-select input {
    width: 100%;
    padding: 8px 32px 8px 8px;
    box-sizing: border-box;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.editable-select button {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    pointer-events: auto;
    display: block;
    opacity: 1;
}

.editable-select .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    border: 1px solid #ccc;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    margin-top: 2px;
    visibility: visible;
    opacity: 1;
}

.editable-select .dropdown div {
    padding: 8px;
    cursor: pointer;
}

.editable-select .dropdown div:hover {
    background: #f0f0f0;
}

/* Filter field editable dropdown'ları için özel stil */
.filter-controls .editable-select {
    width: 180px;
}

.filter-controls .editable-select input {
    font-size: 12px;
    padding: 4px 28px 4px 6px;
}

.filter-controls .editable-select button {
    width: 28px;
    font-size: 12px;
}

/* Accordion Animation Styles */
.filter-controls, .search-controls {
    transition: all 0.3s ease-in-out;
    overflow: visible;
}

.filter-controls.expanding, .search-controls.expanding {
    animation: expandWidth 0.3s ease-in-out forwards;
}

.filter-controls.collapsing, .search-controls.collapsing {
    animation: collapseWidth 0.3s ease-in-out forwards;
}

@keyframes expandWidth {
    from {
        opacity: 0;
        max-width: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        max-width: 500px;
        transform: scaleX(1);
    }
}

@keyframes collapseWidth {
    from {
        opacity: 1;
        max-width: 500px;
        transform: scaleX(1);
    }

    to {
        opacity: 0;
        max-width: 0;
        transform: scaleX(0);
    }
}

.toggle-search-btn {
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    transition: all 0.2s;
}

.toggle-search-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.form-check-label {
    font-size: 0.875rem;
    white-space: nowrap;
}

.form-select-sm {
    min-width: 120px;
}

/* Tablo responsive container için overflow düzeltmesi */
.table-responsive {
    overflow: visible !important;
}

/* Valid Function Frame Stili */
.valid-function-frame {
    background-color: #d9dcdf !important;
    border: 1px solid #dee2e6 !important;
}

/* Küçük buton stili */
.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

/* Resizable Modal Styles */
.modal-dialog {
    resize: both;
    overflow: auto;
    min-width: 300px;
    min-height: 400px;
    max-width: 90vw;
    max-height: 90vh;
    margin: 1.75rem auto;
    position: relative;
    transform: none !important;
}

.modal-dialog.modal-sm {
    min-width: 300px;
    min-height: 400px;
}

.modal-dialog.modal-lg {
    min-width: 500px;
    min-height: 600px;
}

.modal-dialog.modal-xl {
    min-width: 600px;
    min-height: 800px;
}

/* Resize handle indicator */
.modal-dialog::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 20px 20px;
    border-color: transparent transparent #007bff transparent;
    cursor: se-resize;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modal-dialog:hover::after {
    opacity: 1;
    border-color: transparent transparent #0056b3 transparent;
}

/* Modal content should fill the resizable dialog */
.modal-content {
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow: auto;
}

/*
 * Mesaj detayı / JSON modal: global kurallar (modal-body flex:1 + modal-lg min-height 600px +
 * modal-content height:100%) kısa içerikte gövde ile footer arasında büyük boşluk bırakıyordu.
 * Bu modallar içerik yüksekliğine göre küçülür; kullanıcı pencereyi resize edip inline height
 * verirse tekrar dolar ve gövde kaydırılır.
 */
#messageDetailsModal .modal-dialog.modal-lg,
#jsonModal .modal-dialog.modal-lg {
    min-height: unset;
    height: auto;
}

#messageDetailsModal .modal-content,
#jsonModal .modal-content {
    height: auto;
    min-height: unset;
    max-height: 90vh;
}

#messageDetailsModal .modal-body,
#jsonModal .modal-body {
    flex: 0 1 auto;
    overflow-x: auto;
    padding-bottom: 0.75rem;
}

#messageDetailsModal .modal-dialog[style*="height"] .modal-content,
#jsonModal .modal-dialog[style*="height"] .modal-content {
    height: 100%;
    min-height: 200px;
}

#messageDetailsModal .modal-dialog[style*="height"] .modal-body,
#jsonModal .modal-dialog[style*="height"] .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Bootstrap pre { margin-bottom: 1rem } — mesaj kutusu ile footer arasında fazla boşluk bırakıyordu */
#messageDetailsModal .modal-body pre,
#jsonModal .modal-body pre {
    margin-bottom: 0;
}

#messageDetailsModal .modal-footer,
#jsonModal .modal-footer {
    padding-top: 0.5rem;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure modal backdrop covers the entire screen */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Modal animasyonlarını iyileştir */
.modal.fade .modal-dialog {
    transition: transform 0.15s ease-out;
    transform: scale(0.8);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Modal backdrop animasyonu */
.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
}

/* Accordion Textarea Styles */
.accordion-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    margin-top: 12px;
}

.accordion-item {
    border-bottom: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-item:hover {
    background-color: #e9ecef;
}

.accordion-header {
    padding: 4px 12px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.accordion-header:hover {
    background-color: #e9ecef;
}

.accordion-header:focus {
    outline: none;
    background-color: #e9ecef;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white;
    /* Debug: Add a border to see the content area */
    border: 1px solid transparent;
}

.accordion-content.expanded {
    max-height: 300px;
    padding: 16px;
    border-top: 1px solid #dee2e6;
    /* Debug: Make expanded content more visible */
    border: 1px solid #28a745;
    background-color: #f8fff8;
}

.textarea-wrapper {
    transition: all 0.3s ease;
}

.textarea-wrapper.has-content {
    border-left: 4px solid #28a745;
}

.accordion-textarea {
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 38px;
    max-height: 200px;
    width: 100%;
}

.accordion-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.textarea-wrapper.has-content .accordion-textarea {
    border-color: #28a745;
}

.accordion-toggle-btn {
    padding: 2px 6px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.accordion-toggle-btn:hover {
    transform: scale(1.1);
}

.accordion-toggle-btn i {
    transition: transform 0.3s ease;
}

/* Empty state styling */
.accordion-item:not(.has-content) .accordion-textarea {
    background-color: #f8f9fa;
    color: #6c757d;
}

.accordion-item:not(.has-content) .accordion-textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Content preview styling */
.textarea-wrapper.has-content:not(.expanded) .accordion-textarea {
    background-color: #e8f5e8;
    border-color: #28a745;
}

/* Animation for expand/collapse */
.textarea-wrapper {
    overflow: hidden;
}

.textarea-wrapper .accordion-textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Label styling */
.accordion-header label {
    font-weight: 500;
    color: #495057;
    font-size: 0.8rem;
    margin: 0;
}

/* Active accordion item styling */
.accordion-item.active {
    background-color: #e3f2fd;
}

.accordion-item.active .accordion-header {
    background-color: #e3f2fd;
    border-bottom: 1px solid #2196f3;
}

/* Content indicator icon styling */
.content-indicator {
    color: #28a745;
    font-size: 0.9rem;
    margin-right: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
    margin-left: auto;
}

.content-indicator.show {
    opacity: 1;
}

.content-indicator i {
    font-size: 0.9rem;
}

/* Reduce padding for all textareas inside accordions to half */
.accordion-content .form-control,
.accordion-content textarea.form-control {
    padding: 0.1875rem 0.375rem !important; /* Half of Bootstrap's default .375rem .75rem */
}

/* Also target accordion-textarea class specifically for consistency */
.accordion-textarea.form-control {
    padding: 0.1875rem 0.375rem !important;
}

/* Fix checkbox display issue */
.form-check-input {
    width: 1em !important;
    height: 1em !important;
    margin-top: 0.25em !important;
    vertical-align: top !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    border-radius: 0.25em !important;
    flex-shrink: 0 !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

.form-check-input:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}


/* Filterable ComboBox Styles */
.filterable-combobox {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.selected {
    background-color: #007bff;
    color: white;
}

.dropdown-item.hidden {
    display: none;
}

/* Toggle button styling */
#toggleDropdown {
    border-left: none;
    border-right: none;
    min-width: 40px;
    border-color: #ced4da;
    background-color: #f8f9fa;
    color: #6c757d;
}

#toggleDropdown:hover {
    border-color: #ced4da;
    background-color: #e9ecef;
    color: #495057;
}

#toggleDropdown i {
    transition: transform 0.2s ease;
}

#toggleDropdown.open i {
    transform: rotate(180deg);
}

/* Reload button styling - match other buttons */
#reloadCommand {
    min-width: 45px;
    padding: 0.375rem 0.5rem;
    border-color: #ced4da;
    background-color: #f8f9fa;
    color: #6c757d;
}

#reloadCommand:hover {
    border-color: #ced4da;
    background-color: #e9ecef;
    color: #495057;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Filter input styling */
#commandFilter:focus {
    border-right: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Input group adjustments */
.filterable-combobox .input-group .form-control {
    border-right: none;
}

.filterable-combobox .input-group .btn:not(:last-child) {
    border-right: none;
}

.filterable-combobox .input-group .btn:last-child {
    border-left: none;
}

/* Ensure all borders match */
.filterable-combobox .input-group .form-control,
.filterable-combobox .input-group .btn {
    border-color: #ced4da;
}

.filterable-combobox .input-group .form-control:focus + .btn,
.filterable-combobox .input-group .form-control:focus ~ .btn {
    border-color: #86b7fe;
}

/* Senaryo ve Senaryo Çalıştırma Select Elementleri için Dropdown Arrow */
#scenarioSelector,
#scenarioExecutionSelector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
    padding-right: 2.5rem;
}

#scenarioSelector:focus,
#scenarioExecutionSelector:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23007bff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Execution step seçimi */
.execution-step-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.execution-step-item:hover {
    background-color: #f8f9fa;
}

.execution-step-item.selected {
    background-color: #e7f3ff;
    border-left: 3px solid #0d6efd;
}

/* Çalışan adım - açık turuncu */
.execution-step-item.executing {
    background-color: #fff4e6;
    border-left: 3px solid #ff9800;
}

.execution-step-item.executing:hover {
    background-color: #ffe8cc;
}

/* Çalışan adım seçildiğinde - koyu turuncu */
.execution-step-item.executing.selected {
    background-color: #ff9800;
    border-left: 3px solid #e68900;
    color: white;
}

.execution-step-item.executing.selected:hover {
    background-color: #e68900;
}

/* Sohbet baloncukları */
.chat-message {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.chat-message.sent {
    align-items: flex-start;
}

.chat-message.received {
    align-items: flex-end;
}

.chat-bubble {
    width: 70%;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

.chat-bubble:hover {
    opacity: 0.9;
}

.chat-message.sent .chat-bubble {
    background: #DCF8C6; /* soft green */
    color: #000;
    border-bottom-left-radius: 4px;
    border: 1px solid #d1d5db;
}

.chat-message.received .chat-bubble {
    background: #E8F0FE;
    color: #000;
    border-bottom-right-radius: 4px;
    border: 1px solid #d1d5db;
}

.chat-function {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    font-family: monospace;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.chat-function.success {
    color: #15803d; /* Koyu yeşil */
}

.chat-function.failure {
    color: #ff1b1b; /* Koyu kırmızı */
}

.chat-function.failure .chat-control-errors-btn {
    color: #b91c1c;
    text-decoration: none;
    line-height: 1;
}

.chat-function.failure .chat-control-errors-btn:hover {
    color: #991b1b;
}

.stream-packet-badge {
    font-weight: 600;
    font-size: 0.85em;
    opacity: 0.9;
    white-space: nowrap;
}

.stream-packet-final {
    color: #0b5ed7;
    border-bottom: 1px dotted currentColor;
}

.chat-bubble-content {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 2.8em; /* 2 satır */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Identification için sayaç özeti gösterildiğinde yükseklik kısıtlamasını kaldır */
.chat-bubble-content.has-meters {
    max-height: none;
    overflow: visible;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

.chat-timestamp {
    font-size: 10px;
    color: #6b7280;
    margin-bottom: 4px;
    padding: 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chat-message.sent .chat-timestamp {
    text-align: left;
}

.chat-message.received .chat-timestamp {
    text-align: right;
}

.chat-bubble-full {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mesaj popup modal */
.message-popup-modal .modal-dialog {
    min-height: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.message-popup-modal .modal-content {
    min-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.message-popup-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 120px); /* Header ve footer için yer bırak */
}

.message-popup-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Giden/Gelen Mesajlar Bölümü */
#stepMessagesSection {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #f9fafb;
}

#stepMessagesSection h6 {
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
}

#stepMessagesContainer {
    background-color: #ffffff;
    border-radius: 4px;
    padding: 10px;
}

/* Loading Overlay */
/* Overlay'in yüksekliği 200vh (viewport'un 2 katı) - bu sayede scroll edilebilir içerik için yeterli alan sağlanır */
#loadingOverlay {
    height: 200vh !important;
    min-height: 200vh !important;
    overflow-y: auto; /* İçerik taşarsa scroll edilebilir */
}

/* İçerideki flex container viewport yüksekliğinde kalmalı - böylece spinner ve textarea görünür alanda kalır */
/* position: sticky ile overlay scroll edilse bile içerik üstte sabit kalır */
#loadingOverlay > .d-flex {
    min-height: 100vh !important; /* Viewport yüksekliğinde kal */
    height: 100vh !important; /* Viewport yüksekliğinde sabit tut */
    position: sticky;
    top: 0;
}

#loadingOverlay .spinner-border {
    width: 4rem !important;
    height: 4rem !important;
}

#loadingOverlay #loadingLogMessages {
    height: auto !important;
    min-height: calc(1.5rem * 8) !important; /* rows="4" için normal yükseklik * 2 = 8 satır */
    max-height: none !important;
    line-height: 1.5rem; /* Satır yüksekliği */
}

/* MASS tab — Yenile / pagination yükleme durumu */
button[id^="reloadTable"].btn-success:focus:not(:focus-visible),
.pagination .page-link:focus:not(:focus-visible) {
    box-shadow: none;
    outline: none;
}

.mass-reload-btn {
    white-space: nowrap;
}

.btn-success.mass-tab-reload-loading,
.btn-success.mass-tab-reload-loading:focus,
.btn-success.mass-tab-reload-loading:active {
    box-shadow: none !important;
    opacity: 0.88;
    cursor: wait;
}

.mass-tab-reload-loading .mass-reload-icon {
    display: inline-block;
    animation: mass-reload-spin 0.75s linear infinite;
}

.mass-pagination-loading {
    opacity: 0.55;
    pointer-events: none;
}

.table-responsive.mass-table-loading {
    opacity: 0.55;
    pointer-events: none;
}

@keyframes mass-reload-spin {
    to {
        transform: rotate(360deg);
    }
}