/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background: #16213e;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    overflow: hidden;
}

/* ===== ШАПКА ===== */
header {
    text-align: center;
    padding: 15px 10px 10px;
    background: #0f3460;
    flex-shrink: 0;
}
header h1 {
    font-size: 1.6em;
    background: linear-gradient(90deg, #00d4aa, #4a8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle { color: #aaa; font-size: 0.9em; }

/* ===== МЕНЮ РОЛЕЙ ===== */
.role-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: #0f3460;
    flex-shrink: 0;
    border-bottom: 1px solid #1a1a2e;
}
.role-selector span { color: #ccc; font-size: 0.9em; }
.role-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.role-buttons button {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e94560;
    background: transparent;
    color: #e94560;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.role-buttons button.active {
    background: #e94560;
    color: white;
}

/* ===== ВЕРХНЕЕ МЕНЮ (кнопки действий) ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: #0f3460;
    flex-shrink: 0;
    border-bottom: 1px solid #1a1a2e;
}
.action-btn, .forum-link, .tariff-link, .donate-link {
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    background: #1a1a2e;
    color: #ccc;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.action-btn:hover, .forum-link:hover, .tariff-link:hover, .donate-link:hover {
    background: #e94560;
    color: white;
}

/* ===== ОКНО ЧАТА ===== */
.chat-window {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #1a1a2e;
    /* минимальная высота, чтобы чат не схлопывался */
    min-height: 0;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 0.95em;
}
.user-message {
    align-self: flex-end;
    background: #e94560;
    color: white;
    border-bottom-right-radius: 4px;
}
.bot-message {
    align-self: flex-start;
    background: #0f3460;
    color: #eee;
    border-bottom-left-radius: 4px;
}

/* ===== ПОЛЕ ВВОДА ===== */
.input-area {
    display: flex;
    padding: 10px 12px;
    background: #1a1a2e;
    border-top: 1px solid #0f3460;
    flex-shrink: 0;
}
.input-area input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 25px;
    border: none;
    background: #0f3460;
    color: white;
    font-size: 16px;
    outline: none;
}
.input-area button {
    margin-left: 8px;
    padding: 10px 18px;
    border-radius: 25px;
    border: none;
    background: #e94560;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}
.voice-btn {
    background: #0f3460;
    border: none;
    color: #ccc;
    font-size: 1.2em;
    padding: 0 10px;
    cursor: pointer;
}
.status {
    text-align: center;
    font-size: 0.8em;
    color: #888;
    padding: 4px;
    flex-shrink: 0;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}
.modal-content {
    background: #16213e;
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}
.close { color: #aaa; float: right; font-size: 28px; cursor: pointer; }
.mood-rating { font-size: 2em; }

/* ===== ПОДВАЛ ===== */
footer {
    text-align: center;
    padding: 10px;
    background: #0f3460;
    color: #aaa;
    font-size: 0.7em;
    flex-shrink: 0;
}
footer a { color: #ccc; margin: 0 8px; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 600px) {
    header { padding: 10px 8px 6px; }
    header h1 { font-size: 1.2em; }
    .subtitle { font-size: 0.7em; }

    .role-selector {
        padding: 4px 8px;
        gap: 4px;
    }
    .role-selector span { font-size: 0.75em; }
    .role-buttons button {
        font-size: 10px;
        padding: 2px 8px;
    }

    .action-buttons {
        padding: 4px 8px;
        gap: 4px;
    }
    .action-btn, .forum-link, .tariff-link, .donate-link {
        font-size: 10px;
        padding: 3px 8px;
    }

    .chat-window {
        padding: 10px;
        gap: 6px;
    }
    .message {
        font-size: 0.9em;
        padding: 8px 12px;
        max-width: 90%;
    }

    .input-area {
        padding: 6px 8px;
    }
    .input-area input {
        font-size: 14px;
        padding: 8px 12px;
    }
    .input-area button {
        font-size: 14px;
        padding: 8px 14px;
    }
    .voice-btn {
        font-size: 1em;
        padding: 0 8px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 15px;
    }
    /* ===== МЕНЮ АВТОРИЗАЦИИ ===== */
    #auth-menu {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.8em;
    margin-bottom: 5px;
    }
    #auth-menu a {
    color: #4a8cff;
    text-decoration: none;
    cursor: pointer;
    }
    #auth-menu a:hover {
    text-decoration: underline;
    }
    #auth-menu span {
    color: #ccc;
    }
}