:root {
    --sidebar-width: 240px;
    --text: #1a1a1a;
    --text-muted: #6c757d;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --border: #e0e0e0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg-light);
}

.navbar {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    height: 64px;
}

.sidebar {
    background: var(--bg);
    border-right: 1px solid var(--border);
    min-height: 100vh;
}

.nav-link {
    color: var(--text);
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    font-weight: 450;
}

.nav-link:hover {
    background: #f1f3f5;
}

.nav-link.active {
    background: #e9ecef;
    font-weight: 550;
    color: #000;
}

main {
    background: var(--bg-light);
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.table {
    font-size: 0.94rem;
}

.table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
}

.table td {
    vertical-align: middle;
}

.text-muted {
    color: var(--text-muted) !important;
}

@theme {
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
}

.chat-container {
    display: flex;
    min-height: 100vh; /* Минимальная высота с учетом всех элементов */
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chat-list {
    width: 300px;
    background-color: #fff;
    border-right: 1px solid #e1e3e6;
    overflow-y: auto;
    padding: 10px;
    transition: transform 0.3s ease-in-out; /* Плавное переключение */
}

.chat-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-list-item:hover {
    background-color: #f5f7fa;
}

.chat-list-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.chat-last-message {
    font-size: 14px;
    color: #888;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-image: url('https://telegram.org/img/tgme/pattern.jpg?1');
    background-size: cover;
}

.chat-header {
    background-color: #fff;
    border-bottom: 1px solid #e1e3e6;
    padding: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 60%;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
}

.message.received {
    background-color: #fff;
    align-self: flex-start;
    margin-top: 15px;
}

.message.sent {
    background-color: #0088cc;
    color: white;
    align-self: flex-end;
    margin-top: 15px;
}

.message p {
    margin: 0;
    font-size: 15px;
    word-wrap: break-word; /* Перенос длинных слов */
}

.timestamp {
    font-size: 12px;
    color: #999;
    position: absolute;
    bottom: 2px;
    right: 10px;
    white-space: nowrap; /* Предотвращаем перенос */
}

/* Поле ввода */

.chat-input {
    background-color: #fff;
    padding: 15px;
    border-top: 1px solid #e1e3e6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e1e3e6;
    border-radius: 20px;
    outline: none;
    font-size: 15px;
}

.chat-input button {
    padding: 10px 20px;
    background-color: #0088cc;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-input button:hover {
    background-color: #0077b3;
}

/* Мобильная адаптация */

@media (max-width: 768px) {
    .chat-list {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); /* Тень для выделения */
    }

    .chat-list.active {
        transform: translateX(0);
    }

    .chat-content {
        width: 100%;
        transition: margin-left 0.3s ease-in-out; /* Плавное смещение */
    }

    .chat-content.shifted {
        margin-left: 300px; /* Смещение при открытой панели */
    }

    .toggle-chat-list {
        position: absolute;
        left: 10px;
        top: 10px;
        z-index: 1001;
        padding: 10px;
        background-color: #0088cc;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }

    .toggle-chat-list:hover {
        background-color: #0077b3;
    }
}

@media (min-width: 769px) {
    .toggle-chat-list {
        display: none;
    }
}

/* Улучшение прокрутки */

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background-color: #f0f2f5;
}

/* Новые классы для страницы анкет */

.profiles-container {
    display: flex;
    min-height: 100vh;
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.profiles-list {
    width: 300px;
    background-color: #fff;
    border-right: 1px solid #e1e3e6;
    overflow-y: auto;
    padding: 10px;
    transition: transform 0.3s ease-in-out;
}

.profiles-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profiles-list-item:hover {
    background-color: #f5f7fa;
}

.profiles-list-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.profile-preview {
    font-size: 14px;
    color: #888;
}

.profiles-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-image: url('https://telegram.org/img/tgme/pattern.jpg?1');
    background-size: cover;
}

.profiles-header {
    background-color: #fff;
    border-bottom: 1px solid #e1e3e6;
    padding: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profiles-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.profiles-cards {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-card {
    max-width: 300px;
    padding: 15px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.profile-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: cover;
}

.profile-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #000;
}

.profile-card p {
    margin: 0 0 10px;
    font-size: 14px;
    color: #666;
}

.profile-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.profile-actions button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: background-color 0.2s;
}

.profile-actions .dislike {
    background-color: #ff4444;
    color: #fff;
}

.profile-actions .dislike:hover {
    background-color: #cc0000;
}

.profile-actions .like {
    background-color: #00cc00;
    color: #fff;
}

.profile-actions .like:hover {
    background-color: #00b300;
}

/* Мобильная адаптация */

@media (max-width: 768px) {
    .profiles-list {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    .profiles-list.active {
        transform: translateX(0);
    }

    .profiles-content {
        width: 100%;
        transition: margin-left 0.3s ease-in-out;
    }

    .profiles-content.shifted {
        margin-left: 300px;
    }

    .toggle-profiles-list {
        position: absolute;
        left: 10px;
        top: 10px;
        z-index: 1001;
        padding: 10px;
        background-color: #0088cc;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }

    .toggle-profiles-list:hover {
        background-color: #0077b3;
    }
}

@media (min-width: 769px) {
    .toggle-profiles-list {
        display: none;
    }
}

/* Улучшение прокрутки */

.profiles-cards::-webkit-scrollbar,
.profiles-list::-webkit-scrollbar {
    width: 8px;
}

.profiles-cards::-webkit-scrollbar-thumb,
.profiles-list::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.profiles-cards::-webkit-scrollbar-track,
.profiles-list::-webkit-scrollbar-track {
    background-color: #f0f2f5;
}

/* === МЕТКИ В СПИСКЕ ЧАТОВ === */

.chat-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blocked-badge {
    background: #d32f2f;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blocked-badge.admin {
    background: #8B1A1A;
}

.chat-item.user-blocked {
    opacity: 0.8;
}

.chat-item.admin-blocked {
    opacity: 0.55;
    pointer-events: none;
}

.chat-item.user-blocked .chat-preview,
.chat-item.admin-blocked .chat-preview {
    color: #999;
    font-style: italic;
}

/* === БОЛЬШИЕ ЭКРАНЫ БЛОКИРОВКИ === */

.blocked-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(8px);
}

.admin-block {
    background: rgba(240, 230, 230, 0.98);
}

.user-block {
    background: rgba(255, 255, 255, 0.98);
}

.blocked-card {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 420px;
}

.blocked-icon {
    font-size: 64px;
    color: #d32f2f;
    margin-bottom: 20px;
}

.blocked-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.blocked-card p {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.blocked-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #e65100;
}

.btn-secondary {
    background: #ddd;
    color: #333;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
}

/* Остальные стили (без изменений) */

.chat-app {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.btn-profiles {
    position: fixed;
    top: 16px;
    right: 16px;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    z-index: 100;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px
}

.btn-profiles:hover {
    background: #e65100;
    transform: translateY(-1px)
}

.btn-menu {
    position: fixed;
    top: 16px;
    left: 16px;
    background: white;
    border: 1px solid var(--border);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    z-index: 101;
    box-shadow: var(--shadow)
}

.chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    height: 100%;
    background: white;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1)
}

.chat-sidebar.active {
    transform: translateX(0)
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700
}

.btn-close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer
}

.chat-list-inner {
    flex: 1;
    overflow-y: auto;
    padding: 8px
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative
}

.chat-item:hover {
    background: #f5f7fa
}

.chat-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px
}

.chat-info {
    flex: 1;
    min-width: 0
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px
}

.chat-preview {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.chat-meta {
    text-align: right;
    font-size: 11px;
    color: var(--text-light)
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    position: absolute;
    bottom: 14px;
    right: 12px;
    border: 2px solid white
}

.status-dot.online {
    background: #00cc00
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light)
}

.btn-small {
    margin-top: 12px;
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px
}

.chat-main {
    flex: 1;
    margin-left: 0;
    transition: margin-left .3s;
    min-height: 100vh;
    background: var(--bg);
    position: relative
}

@media (min-width: 992px) {
    .btn-menu, .btn-close-sidebar {
        display: none
    }

    .chat-sidebar {
        transform: translateX(0)
    }

    .chat-main {
        margin-left: 340px
    }
}

.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
    max-height: 120px;
    overflow-y: auto;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 32px;
    color: #666;
}

.preview-item .file-name {
    font-size: 11px;
    text-align: center;
    padding: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
