* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #0b0c0e;
    color: #e3e6e8;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    padding: 20px;
    gap: 20px;
}

.hidden { display: none !important; }

/* Регистрация */
.box {
    background: #18191c;
    border: 1px solid #2e3035;
    padding: 40px;
    border-radius: 12px;
    width: 400px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h2 { font-size: 20px; text-align: center; margin-bottom: 10px; color: #fff;}

input[type="text"], select {
    background: #202225;
    border: 1px solid #2f3136;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.social-toggles { display: flex; gap: 10px; }
.btn-toggle {
    background: #2f3136;
    border: 1px solid #4f545c;
    color: #b9bbbe;
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}
.social-input { display: none; }
.social-input.visible { display: block; }

.btn-primary {
    background: #5865f2;
    color: white;
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* Интерфейс Чата */
#chat-screen {
    width: 100%;
    height: 100%;
}

.media-panel {
    width: 320px;
    background: #18191c;
    border: 1px solid #2e3035;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group {
    background: #202225;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2f3136;
}

.control-group button {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    font-weight: bold;
    margin-bottom: 5px;
    cursor: pointer;
}

.media-panel button:not(.btn-action):not(.btn-danger) {
    background: #2f3136;
    border: 1px solid #4f545c;
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.media-panel button.active {
    border-color: #43b581;
}

.btn-action {
    background: #4f545c;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-danger {
    background: #f04747;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: auto;
}

/* Окно сообщений */
.chat-panel {
    flex: 1;
    background: #18191c;
    border: 1px solid #2e3035;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-row {
    background: #202225;
    padding: 10px 14px;
    border-radius: 8px;
    width: fit-content;
    max-width: 80%;
}
.message-row .author { color: #00b0f4; font-weight: bold; margin-right: 5px; }

/* Дизайн карточек БОТА */
.system-bot-card {
    background: #232428;
    border-left: 4px solid #5865f2;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.error-card { border-left-color: #f04747; }

.bot-header { font-size: 12px; color: #b9bbbe; display: flex; align-items: center; gap: 6px; }
.bot-badge {
    background: #5865f2;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.token-highlight {
    background: #2f3136;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #faa61a;
}

.bot-actions { display: flex; gap: 10px; margin-top: 5px; }
.btn-card-action {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}
.btn-dl { background: #4f545c; color: white; }
.btn-rep { background: #f04747; color: white; display: inline-block; text-align: center; }

.bot-response {
    color: #99aab5;
    font-size: 14px;
    background: rgba(88, 101, 242, 0.1);
    padding: 8px;
    border-radius: 6px;
}

/* Поле ввода */
.input-area { padding: 20px; background: #2f3136; display: flex; gap: 10px; position: relative; }
.autocomplete-wrapper { flex: 1; position: relative; }
.input-area button {
    background: #5865f2;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
}

/* Выпадающие подсказки */
.hints-box {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #202225;
    border: 1px solid #4f545c;
    border-radius: 6px;
    z-index: 10;
    overflow: hidden;
}
.hint-item {
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #2f3136;
}
.hint-item:hover { background: #2f3136; }

/* Анимация поиска собеседника */
.search-loader-container {
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 200px;
}

.search-status-text {
    z-index: 2;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    animation: textPulse 2s infinite ease-in-out;
}

.radar-pulse {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(88, 101, 242, 0.2);
    border: 2px solid #5865f2;
    border-radius: 50%;
    animation: radarExpand 2.5s infinite linear;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
}

.radar-pulse.p2 { animation-delay: 0.8s; }
.radar-pulse.p3 { animation-delay: 1.6s; }

.error-reasons-list {
    margin-left: 20px;
    color: #b9bbbe;
    font-size: 14px;
    line-height: 1.6;
}
.error-reasons-list li { margin-bottom: 5px; }

.btn-check { background: #43b581; color: white; text-decoration: none; display: inline-block; text-align: center; }
.btn-retry { background: #5865f2; color: white; }

@keyframes radarExpand {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}
@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.btn-action.active-call {
    background: #43b581 !important;
}
/* Discord-style голосовое пространство */
.discord-video-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.discord-video-grid.hidden {
    display: none !important;
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
}

.video-container {
    position: relative;
    background: #0b0c0e;
    border-radius: 8px;
    border: 2px solid #2e3035;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111214;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}

.btn-action.active-call {
    background: #43b581 !important;
}

.media-panel button.active {
    border-color: #43b581 !important;
    background: #3a4047 !important;
}
/* Фиксированная кнопка GitHub */
.github-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #72767d;
    z-index: 9999;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.github-link:hover {
    color: #fff;
    transform: scale(1.1);
}