* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0a0f;
    --secondary-bg: rgba(20, 10, 30, 0.3);
    --tertiary-bg: #1a0a2e;
    --border-color: #00d4aa;
    --border-hover: #6ce3e9;
    --text-primary: #ffffff;
    --text-secondary: #00d4aa;
    --text-muted: #8892b0;
    --accent-warning: #ffd700;
    --accent-danger: #ff6b9d;
    --accent-info: #00d4aa;
    --purple-glow: #9b59b6;
    --teal-glow: #1abc9c;
    --border-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
    --purple-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
    --grid-pattern: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><defs><pattern id='grid' width='30' height='30' patternUnits='userSpaceOnUse'><path d='M 30 0 L 0 0 0 30' fill='none' stroke='rgba(0,212,170,0.3)' stroke-width='1'/></pattern></defs><rect width='100%' height='100%' fill='url(%23grid)'/></svg>");
}

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

body {
    font-family: 'Aldrich', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 35%, #16213e 100%);
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Navigation */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 5px 40px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-left {
    display: flex;
    gap: 10px;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
}

.top-bar a:hover {
    cursor: pointer;
    color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Desktop Layout */
.container {
    display: grid;
    grid-template-columns: minmax(350px, 400px) 1fr;
    height: calc(100vh - 80px);
    gap: 15px;
    padding: 15px;
    margin-top: 2.5rem;
    overflow: hidden;
    overflow-y: auto;
}

.left-panel {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 15px;
    min-height: 0;
}

.right-panel {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 15px;
    min-height: 0;
}

.logs-section {
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--border-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 20px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 18px;
    min-height: 18em;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.logs-header {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 12px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px currentColor;
}

.logs-header.model-info {
    text-align: center;
    background: rgba(10, 10, 15, 0.8);
}

.logs-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.settings-section {
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--border-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
    min-height: 10px;
    backdrop-filter: blur(10px);
}

.accordion-item {
    margin-bottom: 15px;
}

.accordion-header {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.8), rgba(16, 33, 62, 0.6));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.accordion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.2), transparent);
    transition: left 0.5s ease;
}

.accordion-header:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px rgba(107, 250, 255, 0.3);
    transform: translateY(-2px);
}

.accordion-header:hover::before {
    left: 100%;
}

.accordion-header span {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px currentColor;
}

.accordion-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--accent-info);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}

.accordion-content.open {
    max-height: 500px;
    padding: 20px;
    opacity: 1;
    pointer-events: auto;
    border-top: none;
}

.dialog-section {
    background:
        var(--grid-pattern),
        linear-gradient(135deg,
            rgba(28, 22, 59, 0.9) 0%,
            rgba(26, 10, 46, 0.8) 50%,
            rgba(16, 33, 62, 0.7) 100%);
    background-repeat: repeat;
    background-position: top left;
    background-attachment: local;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-height: 20em;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    box-shadow: var(--border-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Fullscreen контейнер */
#fullscreen-dialogue {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#fullscreen-dialogue.active {
    transform: translateX(0);
}

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    z-index: -1;
}


/* Меню внизу */
.fullscreen-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(0deg,
            rgba(10, 10, 15, 0.95) 0%,
            rgba(0, 0, 0, 0) 50%);
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1001;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px) saturate(1.8);
    -webkit-backdrop-filter: blur(25px) saturate(1.8);
}

/* Активное состояние — выезд вверх */
.fullscreen-menu.visible {
    transform: translateY(0);
}

/* Область для наведения */
.bottom-trigger-zone {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 30vh;
    /* Trigger zone */
    width: 100%;
    z-index: 1000;
    pointer-events: auto;
    background: transparent;
}

/* Кнопки меню (по желанию) */
.fullscreen-menu button {
    background: linear-gradient(135deg,
            rgba(40, 40, 50, 0.8) 0%,
            rgba(60, 60, 80, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.3);
    margin-right: 8px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fullscreen-menu button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 200, 255, 0.2) 50%,
            transparent 100%);
    transition: left 0.5s ease;
}

.fullscreen-menu button:hover {
    background: linear-gradient(135deg,
            rgba(60, 60, 80, 0.9) 0%,
            rgba(80, 80, 100, 0.7) 100%);
    border-color: rgba(0, 200, 255, 0.6);
    box-shadow:
        0 4px 16px rgba(0, 200, 255, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.fullscreen-menu button:hover::before {
    left: 100%;
}

.fullscreen-menu button:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 200, 255, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fullscreen-menu img {
    width: 48px;
    height: 38px;
    object-fit: contain;
    pointer-events: none;
    filter: brightness(1.1) contrast(1.2);
    transition: filter 0.2s ease;
}

.fullscreen-menu label {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg,
            rgba(30, 30, 40, 0.8) 0%,
            rgba(50, 50, 70, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.25);
    padding: 12px 20px;
    border-radius: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 200px;
}

.fullscreen-menu label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 200, 255, 0.1) 50%,
            transparent 100%);
    transition: left 0.6s ease;
}

.fullscreen-menu label:hover {
    background: linear-gradient(135deg,
            rgba(40, 40, 60, 0.9) 0%,
            rgba(70, 70, 90, 0.7) 100%);
    border-color: rgba(0, 200, 255, 0.4);
    box-shadow:
        0 4px 20px rgba(0, 200, 255, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 1);
}

.fullscreen-menu label:hover::before {
    left: 100%;
}

.fullscreen-menu label input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 140px;
    height: 6px;
    background: linear-gradient(to right,
            rgba(20, 20, 30, 0.8) 0%,
            rgba(40, 40, 60, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 200, 255, 0.1);
}

.fullscreen-menu label input[type="range"]:hover {
    border-color: rgba(0, 200, 255, 0.4);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(0, 200, 255, 0.15);
}

.fullscreen-menu label input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
            rgba(0, 200, 255, 0.9) 0%,
            rgba(0, 150, 255, 0.7) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(0, 200, 255, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.fullscreen-menu label input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg,
            rgba(0, 220, 255, 1) 0%,
            rgba(0, 170, 255, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(0, 200, 255, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-menu label input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(0, 200, 255, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Firefox thumb */
.fullscreen-menu label input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
            rgba(0, 200, 255, 0.9) 0%,
            rgba(0, 150, 255, 0.7) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(0, 200, 255, 0.3);
}

/* Firefox track */
.fullscreen-menu label input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(to right,
            rgba(20, 20, 30, 0.8) 0%,
            rgba(40, 40, 60, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 3px;
}



#fullscreen-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px 20px 120px;
    gap: 12px;
    overflow-y: auto;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fullscreen-message {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 65%;
}

.fullscreen-message.left {
    justify-content: flex-start;
    padding-right: 30em;
}

.fullscreen-message.right {
    justify-content: flex-end;
    padding-left: 30em;
}

.bubble {
    padding: 12px 12px;
    border-radius: 14px;
    font-size: 16px;
    animation: fadeIn 0.4s ease;
}

.fullscreen-message-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-left: auto;
    margin-bottom: 5px;
    font-size: 0.8em;
    color: #ccc;
    font-family: 'Audiowide', sans-serif;
}

.bubble-text {
    background: rgba(26, 10, 46, 0.8);
    color: white;
    border: 1px solid rgba(0, 200, 255, 0.3);
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 100%;
    word-wrap: break-word;
}


.fullscreen-message.center {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.fullscreen-message.right .bubble-text {
    background: rgba(0, 180, 255, 0.2);
    border-color: rgba(0, 180, 255, 0.4);
    text-align: right;
}

.fullscreen-message.center .bubble-text {
    background: rgba(109, 109, 109, 0.543);
    border: 1px solid rgba(79, 79, 79, 0.4);
    text-align: center;
    padding: 10px 20px;
    display: inline-block;
    border-radius: 12px;
}

.thinking-content {
    display: flex;
    align-items: center;
    font-style: italic;
    color: #888;
}

.thinking-text {
    margin-right: 4px;
}

.thinking-dots {
    display: inline-flex;
}

.thinking-dots span {
    animation: thinking 1.4s infinite;
    animation-fill-mode: both;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.dialog-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-top: 50px;
    position: relative;
    z-index: 2;
}

.bot-profiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: fit-content;
}

.bot-profile {
    background: linear-gradient(135deg,
            rgba(26, 10, 46, 0.7) 0%,
            rgba(16, 33, 62, 0.5) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    backdrop-filter: blur(10px);
    box-shadow: var(--border-shadow);
    transition: all 0.3s ease;
}

.bot-profile:hover {
    border-color: var(--border-hover);
    box-shadow: var(--purple-shadow);
    transform: translateY(-2px);
}

.bot-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.bot-profile h3 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 3px currentColor;
    font-weight: 600;
}

.bot-profile select {
    background-color: #15002e;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bot-profile button {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-right: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.bot-profile button:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(53, 127, 236, 0.3);
}

.bot-profile textarea {
    flex: 1;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-primary);
    font-family: 'Aldrich', sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 130px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.bot-profile textarea:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 15px rgba(32, 147, 255, 0.3);
}

.bot-profile textarea::placeholder {
    color: var(--text-muted);
}

.input-section {
    background: linear-gradient(135deg,
            rgba(26, 10, 46, 0.7) 0%,
            rgba(16, 33, 62, 0.5) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    flex-shrink: 0;
    height: fit-content;
    backdrop-filter: blur(10px);
    box-shadow: var(--border-shadow);
}

.input-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.input-section h3 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 4px currentColor;
    font-weight: 600;
}

.input-controls {
    display: flex;
    gap: 10px;
}

.input-wrapper {
    position: relative;
}

.input-section textarea {
    width: 100%;
    height: 110px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 60px 15px 15px;
    color: var(--text-primary);
    font-family: 'Aldrich', sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.input-section textarea:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 15px rgba(50, 170, 255, 0.3);
}

.input-section textarea::placeholder {
    color: var(--text-muted);
}

.send-button {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #19ffec11;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s;
}

.send-button img {
    width: 1.9em;
}

.send-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(89, 145, 182, 0.367);
}

.settings-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 4px currentColor;
}

.control-group select,
.control-group input {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-group select:focus,
.control-group input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 15px rgba(48, 187, 247, 0.3);
}

.control-group select {
    background-color: #15002e;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.number-input input {
    width: 80px;
    text-align: center;
}

.number-input input::-webkit-outer-spin-button,
.number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.refresh-btn {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 8px 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all 0.3s ease;
}

.refresh-btn img {
    width: 1.2em;
}

.refresh-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.control-button {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-button:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 211, 255, 0.3);
}

.control-button.pause {
    color: var(--accent-warning);
    border-color: var(--accent-warning);
}

.control-button.pause:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.control-button.clear {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.control-button.clear:hover {
    box-shadow: 0 6px 20px rgba(107, 171, 255, 0.4);
}

.control-button.fullscreen {
    position: absolute;
    padding: 10px 15px;
    top: 15px;
    right: 20px;
    z-index: 999;
    color: var(--accent-info);
    border-color: var(--accent-info);
}

.control-button.fullscreen img {
    width: 2em;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px;
    z-index: 1000;
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.nav-tab.active {
    background-color: var(--tertiary-bg);
    color: var(--text-primary);
}

.mobile-section {
    display: none;
}

.mobile-delete-user-button {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-right: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.mobile-delete-user-button:active {
    transform: translateY(2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(89, 145, 182, 0.367);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Smooth transitions */
* {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Mobile and tablet layout */
@media (max-width: 992px) {
    body {
        overflow-y: auto;
        padding-bottom: 70px;
    }

    .container {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 70px);
        padding: 15px 15px 0;
        gap: 0;
    }

    .left-panel,
    .right-panel {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .mobile-section {
        flex: 1;
        display: none;
        flex-direction: column;
        margin-bottom: 20px;
        min-height: 0;
    }

    .mobile-section.active {
        display: flex;
    }

    /* Chat Section */
    .mobile-chat-section {
        background:
            var(--grid-pattern),
            linear-gradient(135deg,
                rgba(28, 22, 59, 0.9) 0%,
                rgba(26, 10, 46, 0.8) 50%,
                rgba(16, 33, 62, 0.7) 100%);
        background-repeat: repeat;
        background-position: top left;
        background-attachment: local;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        flex: 1;
        overflow-y: auto;
        position: relative;
        margin-bottom: 15px;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .mobile-chat-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }



    /* Bot Setup Section */
    .mobile-bot-setup {
        display: flex;
        flex-direction: column;
        gap: 15px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .mobile-bot-card {
        background-color: var(--secondary-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        flex-shrink: 0;
    }

    .mobile-bot-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-bot-title {
        color: var(--text-secondary);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex: 1;
        min-width: 200px;
    }

    .mobile-bot-select {
        background-color: var(--tertiary-bg);
        border: 1px solid var(--border-hover);
        border-radius: 4px;
        padding: 6px 10px;
        color: var(--text-primary);
        font-size: 12px;
        outline: none;
        cursor: pointer;
    }

    .mobile-bot-textarea {
        width: 100%;
        height: 120px;
        background-color: var(--primary-bg);
        border: 1px solid var(--border-hover);
        border-radius: 6px;
        padding: 12px;
        color: var(--text-primary);
        font-family: 'Aldrich', sans-serif;
        font-size: 14px;
        resize: none;
        outline: none;
    }

    .mobile-bot-textarea:focus {
        border-color: #555;
    }

    /* Input Section */
    .mobile-input-section {
        background-color: var(--secondary-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        position: relative;
        flex-shrink: 0;
        height: fit-content;
    }

    .mobile-input-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .mobile-input-title {
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-input-controls {
        display: flex;
        gap: 8px;
    }

    .mobile-input-wrapper {
        position: relative;
    }

    .mobile-input-textarea {
        width: 100%;
        height: 100px;
        background-color: var(--primary-bg);
        border: 1px solid var(--border-hover);
        border-radius: 6px;
        padding: 12px 50px 12px 12px;
        color: var(--text-primary);
        font-family: 'Aldrich', sans-serif;
        font-size: 16px;
        /* Prevents zoom on iOS */
        resize: none;
        outline: none;
    }

    .mobile-input-textarea:focus {
        border-color: #5d6afb;
    }

    .mobile-input-textarea::placeholder {
        color: var(--text-muted);
    }

    .mobile-send-button {
        position: absolute;
        right: 10px;
        bottom: 20px;
        background-color: #19ffec11;
        border: 1px solid var(--border-hover);
        border-radius: 6px;
        padding: 8px 10px;
        cursor: pointer;
        color: var(--text-secondary);
        font-size: 16px;
        transition: all 0.2s;
    }

    .mobile-send-button img {
        width: 1.9em;
    }

    .mobile-send-button:active {
        transform: translateY(2px) scale(1.1);
        box-shadow: 0 6px 20px rgba(89, 145, 182, 0.367);
    }

    /* Settings Section */
    .mobile-settings-section {
        background-color: var(--secondary-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .mobile-settings-controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-control-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-control-group label {
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
    }

    .mobile-control-group select,
    .mobile-control-group input {
        background-color: var(--tertiary-bg);
        border: 1px solid var(--border-hover);
        border-radius: 6px;
        padding: 12px;
        color: var(--text-primary);
        font-size: 14px;
        outline: none;
    }

    .mobile-control-group input:focus {
        border-color: #1976d2;
        transform: translateY(1px) scale(1.01);
    }

    .mobile-control-group select:active {
        transform: translateY(1px) scale(1.01);
    }

    .mobile-accordion-item {
        margin-bottom: 10px;
    }

    .mobile-accordion-header {
        background-color: var(--tertiary-bg);
        border: 1px solid var(--border-hover);
        border-radius: 6px;
        padding: 12px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.2s;
    }

    .mobile-accordion-header:active {
        transform: translateY(1px) scale(1.01);
    }

    /* Logs Section */
    .mobile-logs-section {
        background-color: var(--secondary-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        flex: 1;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        min-height: 200px;
        display: flex;
        flex-direction: column;
    }

    .mobile-logs-header {
        color: var(--text-secondary);
        margin-bottom: 10px;
        font-size: 11px;
        flex-shrink: 0;
        background: rgba(10, 10, 15, 0.8);
    }

    .mobile-logs-header.model-info {
        text-align: center;
    }

    .mobile-logs-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .control-button {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .mobile-bot-title {
        font-size: 10px;
        min-width: 150px;
    }

    .mobile-bot-textarea {
        height: 100px;
        font-size: 13px;
    }

    .mobile-input-textarea {
        height: 80px;
    }

    .control-button {
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* Улучшения для больших экранов */
@media (min-width: 1200px) {
    .container {
        grid-template-columns: minmax(400px, 450px) 1fr;
    }

    .bot-profiles {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .bot-profile {
        min-height: 50px;
    }

    .bot-profile textarea {
        flex: 0.5;
        min-height: 60px;
    }

    .bot-profile-header {
        margin-bottom: 5px;
    }


}

@media (min-width: 1600px) {
    .container {
        grid-template-columns: 500px 1fr;
        padding: 20px;
        gap: 20px;
    }

    .bot-profiles {
        grid-template-columns: 1fr 1fr;
    }

    .bot-profile {
        min-height: 200px;
    }

    .bot-profile textarea {
        flex: 1;
        min-height: 120px;
    }

    .bot-profile-header {
        margin-bottom: 10px;
    }

}

.mobile-section.active {
    animation: fadeIn 0.3s ease-out;
}

/* Состояния загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



.message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    max-width: 80%;
}

.message-user {
    background-color: rgba(57, 57, 57, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(215, 215, 215, 0.1);
    border-radius: 8px;
    margin: 0 auto;
}

.message-bot1 {
    background-color: rgba(74, 4, 149, 0.428);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(49, 11, 90, 0.428);
    border-radius: 8px;
    margin-right: auto;
    margin-left: 0;
}

.message-bot2 {
    background-color: #05846a98;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(5, 89, 32, 0.1);
    border-radius: 8px;
    margin-left: auto;
    margin-right: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #b7b7b7;
    font-family: 'Audiowide', display;
    gap: 20px;
}

.message-content {
    line-height: 1.5;
}

.api-keys-form .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.api-keys-form label {
    width: 110px;
}

.api-keys-form input {
    flex: 1;
    padding: 5px;
    background-color: #000000;
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 4px;
}

.api-keys-form .clear-key,
.api-keys-form .toggle-key {
    background: none;
    border: 1px solid #777;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.api-keys-form .clear-key:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(53, 127, 236, 0.3);
    transform: translateY(2px);
}

.api-keys-form .toggle-key {
    font-size: 16px;
    line-height: 1;
}

.api-keys-form .toggle-key:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(53, 127, 236, 0.3);
    transform: translateY(2px);
}

.api-keys-form .clear-key img {
    width: 16px;
    height: 16px;
}

.api-keys-form .save-keys {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 10px;
    margin-right: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.api-keys-form .use-service-key {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(16, 33, 62, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 10px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.api-keys-form .use-service-key:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(53, 127, 236, 0.3);
    transform: translateY(2px);
}

.api-keys-form .use-service-key:active {
    background: #333;
    transform: translateY(1px);
}

.api-keys-form .save-keys:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(53, 127, 236, 0.3);
    transform: translateY(2px);
}

.api-keys-form .save-keys:active {
    background: #333;
    transform: translateY(1px);
}

.creativity-controls .slider-group {
    margin-bottom: 15px;
}

.creativity-controls .slider-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-secondary);
    text-shadow: 0 0 10px currentColor;
}

.creativity-controls input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    margin-top: 5px;
    background: linear-gradient(to right,
            rgba(20, 20, 30, 0.8) 0%,
            rgba(40, 40, 60, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 200, 255, 0.1);
}

.creativity-controls input[type="range"]:hover {
    border-color: rgba(0, 200, 255, 0.4);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(0, 200, 255, 0.15);
}

.creativity-controls input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
            rgba(0, 200, 255, 0.9) 0%,
            rgba(0, 150, 255, 0.7) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(0, 200, 255, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.creativity-controls input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg,
            rgba(0, 220, 255, 1) 0%,
            rgba(0, 170, 255, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(0, 200, 255, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.creativity-controls input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(0, 200, 255, 0.6),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Firefox thumb */
.creativity-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
            rgba(0, 200, 255, 0.9) 0%,
            rgba(0, 150, 255, 0.7) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(0, 200, 255, 0.3);
}

/* Firefox track */
.creativity-controls input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(to right,
            rgba(20, 20, 30, 0.8) 0%,
            rgba(40, 40, 60, 0.6) 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 3px;
}

.thinking-indicator {
    opacity: 0.8;
}

.thinking-content {
    display: flex;
    align-items: center;
    font-style: italic;
    color: #888;
}

.thinking-text {
    margin-right: 4px;
}

.thinking-dots {
    display: inline-flex;
}

.thinking-dots span {
    animation: thinking 1.4s infinite;
    animation-fill-mode: both;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.log-message {
    padding: 2px 0;
    font-size: 0.9em;
}

.log-error {
    color: #d32f2f;
}

.log-warning {
    color: #f57c00;
}

.log-success {
    color: #388e3c;
}

.log-info {
    color: #1976d2;
}

/* Delete confirmation modal */
#confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#confirm-overlay.active {
    display: flex;
}

.confirm-modal {
    background: var(--primary-bg);
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--border-shadow);
}

.confirm-modal .modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
}

.confirm-modal button {
    padding: 6px 16px;
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.confirm-modal button:hover {
    background: var(--secondary-bg);
}