input {
    width: 100px;
}

/* Кнопка закрытия — круглая */
.close-btn {
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #f8fafc;
    border-top: 1px solid #cbd5e1;
    z-index: 1000;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-nav.show {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 25%;
    height: 100%;
    padding: 5px 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
}

.mobile-nav-btn.active {
    color: #3b82f6;
}

.mobile-nav-btn i {
    font-size: 20px;
    margin-bottom: 2px;
}

/* WebSocket indicator */
.ws-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Hide top tabs on mobile */
@media (max-width: 768px) {
    #tabsContainer {
        display: none;
    }

    .tab-content {
        padding-bottom: 60px; /* Space for mobile nav */
    }

    .mobile-nav {
        display: flex;
    }
}

/* Scrolling for modals and tab content on small screens */
.modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.tab-content {
    overflow-y: auto;
}

@media (max-height: 700px) {
    .modal-content {
        max-height: 75vh;
    }
}

@media (max-height: 600px) {
    .modal-content {
        max-height: 70vh;
    }

    .tab-content {
        max-height: calc(100vh - 120px); /* Account for header and other elements */
    }
}

@media (max-height: 450px) {
    .modal-content {
        max-height: 60vh;
    }

    .tab-content {
        max-height: calc(100vh - 100px);
    }
}

/* WebSocket panel bottom padding */
body.ws-panel-open #tabsContainer + .tab-content,
body.ws-panel-open .tab-content:not(.hidden) {
    margin-bottom: 300px !important; /* Account for WebSocket panel height */
}

#websocket-messages-panel {
    max-height: 300px;
    height: auto;
    overflow: hidden;
}

#websocket-messages-content {
    max-height: 240px;
    height: auto;
    overflow: hidden;
}

#websocket-messages-list {
    padding-bottom: 190px;
}

/* Mobile response popup */
.mobile-response-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1001;
    overflow-y: auto;
    padding: 20px;
}

.mobile-response-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.mobile-response-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

/* Notification styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s ease-out;
    min-width: 250px;
}

.notification.error {
    background-color: #ef4444;
}

.notification.success {
    background-color: #10b981;
}

.notification.warning {
    background-color: #f59e0b;
}

.notification.info {
    background-color: #3b82f6;
}

.notification-content {
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 15px;
    padding: 0;
}

/* Apple-style design */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

input, select, textarea, button {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    border-radius: 10px;
    border: 1px solid #d2d2d7;
    padding: 8px 12px;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 2px #007aff;
    border-color: #007aff;
}

button {
    background-color: #ffffff;
    color: #007aff;
    border: 1px solid #d2d2d7;
    cursor: pointer;
    font-weight: 500;
}

button:hover {
    background-color: #f2f2f7;
}

button:active {
    transform: scale(0.98);
}

/* Mobile Bottom Navigation - Apple style */
.mobile-nav {
    height: 83px !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 0.5px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 -0.5px 0 rgba(0, 0, 0, 0.02), 0 -4px 12px rgba(0, 0, 0, 0.04) !important;
}

.mobile-nav.show {
    padding: 15px 0 !important;
}

.mobile-nav-btn {
    color: #8e8e93 !important;
    font-size: 10px !important;
}

.mobile-nav-btn.active {
    color: #007aff !important;
}

.mobile-nav-btn i {
    font-size: 24px !important;
    margin-bottom: 4px !important;
}

/* Mobile tab name display - Apple style */
.mobile-tab-name {
    height: 44px !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05) !important;
    font-weight: 500 !important;
    font-size: 17px !important;
    color: #1d1d1f !important;
}

.mobile-tab-name span {
    font-weight: 600 !important;
}

/* Mobile tab dropdown that appears above the mobile navigation - Apple style */
.mobile-tab-dropdown {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Horizontal tabs container for mobile dropdown */
.mobile-tabs-horizontal-container {
    gap: 8px !important;
    padding: 12px !important;
}

.mobile-tab-item {
    padding: 10px 16px !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.mobile-tab-item.active {
    background-color: #007aff !important;
    color: white !important;
    border-color: #007aff !important;
}

.mobile-tab-item:hover {
    background-color: #f2f2f7 !important;
}

/* Mobile tab actions in dropdown */
.mobile-tab-actions {
    border-top: 0.5px solid rgba(0, 0, 0, 0.05) !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.mobile-tab-actions button {
    border-radius: 10px !important;
    padding: 10px !important;
    font-weight: 500 !important;
}

/* Tab content styling - Apple style */
.tab-content {
    background-color: #ffffff !important;
    border-radius: 14px !important;
    margin: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* WebSocket messages panel - Apple style */
#websocket-messages-panel {
    background-color: #ffffff !important;
    border-radius: 14px !important;
    margin: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Mobile response popup - Apple style */
.mobile-response-popup {
    background-color: #f5f5f7 !important;
}

.mobile-response-popup-header {
    border-bottom: 0.5px solid #d2d2d7 !important;
    margin-bottom: 15px !important;
    background-color: #f5f5f7 !important;
}

.mobile-response-close {
    width: 30px !important;
    height: 30px !important;
    color: #8e8e93 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.mobile-response-close:hover {
    background-color: #e0e0e0 !important;
}

/* Notification styles - Apple style */
.notification {
    padding: 14px 16px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    min-width: 250px !important;
    background-color: #4c4c4c !important;
    border-left: 4px solid #007aff !important;
}

.notification.error {
    background-color: #4c4c4c !important;
    border-left-color: #ff3b30 !important;
}

.notification.success {
    background-color: #4c4c4c !important;
    border-left-color: #34c759 !important;
}

.notification.warning {
    background-color: #4c4c4c !important;
    border-left-color: #ffcc00 !important;
}

.notification.info {
    background-color: #4c4c4c !important;
    border-left-color: #007aff !important;
}

.notification-content {
    font-size: 14px !important;
}

.notification-close {
    color: #a7a7ae !important;
    font-size: 20px !important;
    margin-left: 15px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.notification-close:hover {
    background-color: #636366 !important;
    color: white !important;
}

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

/* Body tabs styling */
.body-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.body-tab.active {
    font-weight: 500;
}

.body-tab:hover {
    background-color: #e2e8f0;
}

.body-tab-close {
    margin-left: 6px;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
}

.body-tab-close:hover {
    background-color: #ff6b6b;
    color: white;
}

[class*="add-body-tab-"] {
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    transition: all 0.2s ease;
}

[class*="add-body-tab-"]:hover {
    background-color: #c6f6d5;
}
