/*
 * Файл: app/static/css/base.css
 * Версия: 7.0 (Chat UI Update)
 */

/* =============================================== */
/* === ГЛОБАЛЬНЫЕ СТИЛИ И ШРИФТЫ              === */
/* =============================================== */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5; 
    color: #212529;
    transition: opacity 0.4s ease-in-out;
}

body.fade-out {
    opacity: 0;
}


/* =============================================== */
/* === НАВИГАЦИЯ (NAVBAR)                      === */
/* =============================================== */

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    object-fit: cover;
    background-color: #ffffff;
}

.dropdown-menu {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.navbar .vr {
    opacity: 0.25;
}


/* =============================================== */
/* === СТИЛИ ДЛЯ FUTURISTIC ТЕМЫ (ГЛАВНАЯ)     === */
/* =============================================== */

.futuristic-body {
    background-color: #000000;
    
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.futuristic-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding: 2rem;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeInGlow 2.5s ease-in-out;
}

@keyframes fadeInGlow {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.hero-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.7));
}

.hero-title {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, 0 0 42px #0af, 0 0 82px #0af, 0 0 92px #0af;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    color: #cceeff;
    text-transform: uppercase;
    opacity: 0.8;
}

.hero-buttons {
    margin-top: 2.5rem;
}

.btn-glass {
    display: inline-block;
    padding: 12px 28px;
    margin: 10px;
    color: #fff;
    border: 1px solid rgba(0, 170, 255, 0.5);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 170, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.btn-glass span {
    position: relative;
    z-index: 2;
}

.btn-glass:hover {
    color: #000;
    border-color: #00aaff;
    box-shadow: 0 0 25px rgba(0, 170, 255, 0.8);
}

.btn-glass::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%) rotate(45deg);
    transition: all 0.7s ease;
    opacity: 0;
}

.btn-glass:hover::before {
    width: 0;
    height: 0;
    opacity: 1;
}

.btn-glass.primary:hover {
    background: #00aaff;
}

.btn-glass.secondary:hover {
    background: #ffffff;
}

/* =============================================== */
/* === СТРАНИЦА ВХОДА (LOGIN)                  === */
/* =============================================== */

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    padding: 20px;
}

.auth-container {
    max-width: 420px;
    width: 100%;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e7eaf0;
}

.auth-container .logo {
    max-width: 150px;
    margin: 0 auto 30px auto;
    display: block;
}

.auth-container h2 {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 40px;
}

.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    z-index: 100;
}


/* =============================================== */
/* === ТАБЛИЦЫ И ПАНЕЛИ УПРАВЛЕНИЯ             === */
/* =============================================== */

.table-wrapper {
    max-height: 75vh;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

.table-wrapper .table-responsive {
    overflow-x: auto;
    position: relative;
    border: none;
}

.table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
    box-shadow: inset 0 -2px 0 #dee2e6;
}

.table-wrapper tbody tr {
    cursor: pointer;
}

.table-wrapper::-webkit-scrollbar,
.table-wrapper .table-responsive::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-wrapper::-webkit-scrollbar-track,
.table-wrapper .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.table-wrapper .table-responsive::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.table-wrapper .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.floating-actions-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    padding-bottom: 20px;
}

#mass-actions-panel {
    background-color: #ffffff;
    padding: 12px 24px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    white-space: nowrap;
}

#mass-actions-panel:not(.d-none) {
    animation: slideUp 0.35s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================== */
/* === ВИДЖЕТ ЧАТА (ОБНОВЛЕННЫЙ)               === */
/* =============================================== */

.chat-widget-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #0d6efd;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.unread-dot {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
}

#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: fadeInWidget 0.3s ease-in-out;
    overflow: hidden;
}

@keyframes fadeInWidget {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#chat-widget-header {
    background: #007bff;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    flex-shrink: 0;
}

.chat-back-button, .chat-action-btn {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.chat-user-list {
    overflow-y: auto;
    border-top: 1px solid #dee2e6;
}

#chat-room-view {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#chat-widget-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f0f2f5;
}

.message {
    display: flex;
    margin-bottom: 10px;
    max-width: 85%;
}

.message-content {
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sent {
    margin-left: auto;
    flex-direction: row-reverse;
}

.sent .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.received {
    margin-right: auto;
}

.received .message-content {
    background-color: #e4e6eb;
    color: #050505;
    border-bottom-left-radius: 4px;
}

/* --- ✨ ИЗМЕНЕНИЕ 2: Стили для новой формы отправки --- */
.chat-form-container {
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
    flex-shrink: 0;
}

#chat-widget-form {
    position: relative; /* Делаем контейнер относительным */
    display: flex;
    align-items: center;
}

#chat-widget-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 45px 10px 15px; /* Увеличиваем отступ справа для кнопки */
    resize: none;
    font-size: 0.9rem;
    line-height: 1.4;
}

#chat-widget-send-btn {
    position: absolute; /* Позиционируем кнопку абсолютно */
    right: 5px;
    top: 50%;
    transform: translateY(-50%); /* Центрируем по вертикали */
    
    border: none;
    background-color: #007bff;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#chat-widget-send-btn:hover {
    background-color: #0056b3;
}
/* -------------------------------------------------------- */

#typing-indicator {
    padding: 0 10px 5px 10px;
    font-style: italic;
    color: #6c757d;
    font-size: 0.8rem;
}