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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    padding: 24px 32px;
    border-bottom: 2px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
}

.header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 12px #00ff88;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Tabs Bar */
.tabs-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #111;
    border-bottom: 2px solid #1a1a1a;
    overflow-x: auto;
    overflow-y: hidden;
}

.tabs-list {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}

.tabs-list::-webkit-scrollbar {
    height: 4px;
}

.tabs-list::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.tabs-list::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    border-color: #3a3a3a;
    color: #aaa;
}

.tab.active {
    background: #0d3d2d;
    border-color: #00ff88;
    color: #00ff88;
}

.tab-name {
    user-select: none;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.tab-close:hover {
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
}

.tab.active .tab-close {
    color: #00ff88;
}

.tab.active .tab-close:hover {
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
}

.new-tab-btn {
    width: 36px;
    height: 36px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.new-tab-btn:hover {
    background: #00ff88;
    border-color: #00ff88;
    transform: scale(1.05);
}

.new-tab-btn svg {
    width: 18px;
    height: 18px;
    color: #888;
    transition: color 0.2s;
}

.new-tab-btn:hover svg {
    color: #000;
}

/* Tab Contents */
.tab-contents {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Chat Container */
.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #0a0a0a;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-message {
    padding: 48px 32px;
    text-align: center;
}

.welcome-message h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.welcome-message p {
    font-size: 16px;
    color: #888;
    font-weight: 500;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

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

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.message-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.message-content {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
}

.message.user .message-content {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    color: #fff;
}

.message.bot .message-content {
    background: #0d3d2d;
    border: 2px solid #00ff88;
    color: #e0e0e0;
}

.message.error .message-content {
    background: #3d0d0d;
    border: 2px solid #ff3333;
    color: #ffcccc;
}

.loading {
    display: inline-flex;
    gap: 6px;
    padding: 16px 20px;
}

.loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

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

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

/* Input Container */
.input-container {
    padding: 24px 32px 32px;
    background: #111;
    border-top: 2px solid #1a1a1a;
}

.method-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.method-toggle-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.method-toggle-btn {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.method-toggle-btn:hover {
    border-color: #3a3a3a;
    color: #aaa;
}

.method-toggle-btn[data-method="POST"] {
    background: #0d3d2d;
    border-color: #00ff88;
    color: #00ff88;
}

.method-toggle-btn[data-method="GET"] {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #888;
}

.method-toggle-btn[data-method="GET"]:hover {
    border-color: #00ff88;
    color: #00ff88;
}

.method-label {
    user-select: none;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

#input-field {
    flex: 1;
    padding: 16px 20px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
}

#input-field:focus {
    border-color: #00ff88;
}

#input-field:disabled {
    background: #0f0f0f;
    border-color: #1a1a1a;
    color: #555;
    cursor: not-allowed;
}

#input-field:disabled::placeholder {
    color: #333;
}

#input-field::placeholder {
    color: #555;
}

.send-btn {
    width: 56px;
    height: 56px;
    background: #00ff88;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    background: #00dd77;
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn svg {
    width: 22px;
    height: 22px;
    color: #000;
}

.send-btn:disabled {
    background: #2a2a2a;
    cursor: not-allowed;
    transform: none;
}

.send-btn:disabled svg {
    color: #555;
}

/* Config Bar */
.config-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.config-bar:last-child {
    margin-bottom: 0;
}

.config-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.config-item input {
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
}

.config-item input:focus {
    border-color: #444;
}

.config-item input::placeholder {
    color: #555;
}

/* Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 20px 24px;
    }

    .header h1 {
        font-size: 20px;
    }

    .chat-container {
        padding: 24px 20px;
    }

    .message {
        max-width: 95%;
    }

    .input-container {
        padding: 20px 24px 24px;
    }

    .config-bar {
        flex-direction: column;
        gap: 12px;
    }
}