* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0e1621;
    color: #e4e6eb;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    width: 100%;
}

.main-app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #17212b;
    border-right: 1px solid #242f3d;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0e1621;
    min-width: 0;
}

/* Sidebar Header */
.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #242f3d;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details span:first-child {
    font-weight: 600;
    font-size: 16px;
}

.status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #2ecc71;
}

.status i {
    font-size: 8px;
}

.new-chat-btn {
    background: #2b5278;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
}

.new-chat-btn:hover {
    background: #2e6e9e;
}

/* Search Bar */
.search-bar {
    padding: 12px 16px;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 36px;
    background: #242f3d;
    border: none;
    border-radius: 20px;
    color: #e4e6eb;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: #7f8c8d;
}

.search-bar input:focus {
    outline: none;
    background: #2b5278;
}

/* Chats List */
.chats-list {
    flex: 1;
    overflow-y: auto;
}

.empty-chats {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #242f3d;
}

.chat-item:hover {
    background: #242f3d;
}

.chat-item.active {
    background: #2b5278;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2b5278;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    position: relative;
}
.chat-avatar img
{
    width: 100%;
    border-radius: 50%;
    object-fit: cover;
    height: 100%;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 13px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: #7f8c8d;
    flex-shrink: 0;
}

.chat-time-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.unread-badge {
    background: #2ecc71;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #242f3d;
}

.encryption-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #2ecc71;
    margin-bottom: 12px;
}

.logout-btn {
    width: 100%;
    padding: 8px;
    background: #e74c3c;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    background: #17212b;
    border-bottom: 1px solid #242f3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2b5278;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.chat-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.member-count {
    font-size: 13px;
    color: #7f8c8d;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: transparent;
    border: none;
    color: #7f8c8d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: #242f3d;
    color: #e4e6eb;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages-area {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.welcome-message i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #2b5278;
}

.welcome-message h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #e4e6eb;
}

.welcome-message p {
    font-size: 14px;
}

/* Messages */
.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own {
    justify-content: flex-end;
}

.message-content {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 18px;
    background: #17212b;
}

.message.own .message-content {
    background: #2b5278;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 12px;
}

.message-sender {
    font-weight: 600;
    color: #2ecc71;
}

.message-time {
    color: #7f8c8d;
    font-size: 10px;
}

.message-text {
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.message-media {
    margin-top: 8px;
}

.message-media img,
.message-media video {
    max-width: 300px;
    border-radius: 12px;
    cursor: pointer;
}

.sticker {
    padding: 8px;
    background: #242f3d;
    border-radius: 16px;
    display: inline-block;
    font-size: 48px;
}

.system-message {
    text-align: center;
    padding: 8px 16px;
    background: #242f3d;
    border-radius: 20px;
    font-size: 12px;
    color: #7f8c8d;
    display: inline-block;
    margin: 0 auto;
}

.message.system {
    justify-content: center;
}

/* Input Area */
.input-area {
    padding: 16px 20px;
    background: #17212b;
    border-top: 1px solid #242f3d;
    flex-shrink: 0;
}

.input-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #7f8c8d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: #242f3d;
    color: #e4e6eb;
}

.message-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.message-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    background: #242f3d;
    border: none;
    border-radius: 24px;
    color: #e4e6eb;
    font-size: 14px;
}

.message-input-wrapper input::placeholder {
    color: #7f8c8d;
}

.message-input-wrapper input:focus {
    outline: none;
    background: #2b5278;
}

.send-btn {
    background: #2b5278;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #2e6e9e;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #17212b;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #242f3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
}

.close-modal {
    background: transparent;
    border: none;
    color: #7f8c8d;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #242f3d;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    color: #2ecc71;
    border-bottom: 2px solid #2ecc71;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Elements */
.modal-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #242f3d;
    border: none;
    border-radius: 8px;
    color: #e4e6eb;
    font-size: 14px;
}

.modal-input::placeholder {
    color: #7f8c8d;
}

.modal-input:focus {
    outline: none;
    background: #2b5278;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: #2b5278;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #2e6e9e;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
}

/* Lists */
.user-list, .rooms-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item, .room-item {
    padding: 12px;
    background: #242f3d;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-item:hover, .room-item:hover {
    background: #2b5278;
}

.start-chat-btn, .join-room-btn {
    padding: 6px 12px;
    background: #2b5278;
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.start-chat-btn:hover, .join-room-btn:hover {
    background: #2e6e9e;
}

/* Stickers Grid */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.sticker-item {
    background: #242f3d;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
    font-size: 40px;
}

.sticker-item:hover {
    transform: scale(1.05);
    background: #2b5278;
}

/* Notification */
#notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.notification {
    background: #2b5278;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 8px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #17212b;
}

::-webkit-scrollbar-thumb {
    background: #2b5278;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e6e9e;
}

/* Mobile Menu Buttons */
.mobile-menu-btn,
.mobile-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

.sidebar-overlay {
    display: none;
}

/* ============================================ */
/* АДАПТИВНОСТЬ */
/* ============================================ */

/* Планшеты */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 280px;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .chat-name {
        font-size: 14px;
    }

    .chat-preview {
        font-size: 12px;
    }

    .message-content {
        max-width: 75%;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 85%;
        max-width: 300px;
        height: 100%;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-info h3 {
        font-size: 16px;
    }

    .member-count {
        font-size: 11px;
    }

    .chat-avatar-large {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .messages-container {
        padding: 12px;
    }

    .message-content {
        max-width: 85%;
        padding: 8px 12px;
    }

    .message-text {
        font-size: 13px;
    }

    .sticker {
        font-size: 36px;
        padding: 6px;
    }

    .message-media img,
    .message-media video {
        max-width: 180px;
        cursor: pointer;
        transition: transform 0.2s ease;
    }

    .message-media img:hover {
        transform: scale(1.05);
    }

    .input-area {
        padding: 12px;
        padding-bottom: 60px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
    }

    .send-btn {
        width: 40px;
        height: 40px;
    }

    .stickers-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .sticker-item {
        font-size: 32px;
        padding: 8px;
    }

    .welcome-message {
        padding: 40px 20px;
    }

    .welcome-message i {
        font-size: 48px;
    }

    .welcome-message h3 {
        font-size: 18px;
    }
}

/* Маленькие мобильные */
@media (max-width: 480px) {
    .message-content {
        max-width: 90%;
    }

    .stickers-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .mobile-menu-btn,
    .mobile-back-btn {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}
/* Fix for mobile */
@media (max-width: 768px) {
    .main-app {
        display: flex;
        width: 100%;
        height: 100%;
        position: relative;
    }

    .chat-area {
        width: 100%;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100%;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: #17212b;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex !important;
    }
}
.main-app {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Убедитесь, что на мобильных main-app видим */
@media (max-width: 768px) {
    .main-app {
        display: flex !important;
    }
}
/* Mobile menu button - ensure visibility */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    margin-right: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    margin-right: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Force mobile menu on small screens */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }

    .chat-header > div:first-child {
        display: flex;
        align-items: center;
        flex: 1;
    }

    .chat-info {
        flex: 1;
        min-width: 0;
    }

    .chat-info h3 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
/* Call Modal Styles */
.call-modal .modal-content {
    max-width: 90vw;
    width: 800px;
    background: #0e1621;
    padding: 0;
    overflow: hidden;
}

.call-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.remote-video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remote-name {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
}

.local-video-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #fff;
    background: #333;
    z-index: 10;
}

#localVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 20;
}

.call-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn, .cam-btn, .speaker-btn {
    background: #2b5278;
    color: white;
}

.mic-btn.muted, .cam-btn.off {
    background: #e74c3c;
}

.end-call-btn {
    background: #e74c3c;
    color: white;
}

.accept-btn {
    background: #2ecc71;
    color: white;
    width: 60px;
    height: 60px;
}

/* Mini notification */
#miniNotification {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.image-modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.image-modal .close-btn:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.reject-btn {
    background: #e74c3c;
    color: white;
    width: 60px;
    height: 60px;
}

.call-status {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    text-shadow: 0 1px 2px black;
    font-size: 14px;
    z-index: 10;
}

.incoming-call-modal .modal-content {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Mobile call styles */
@media (max-width: 768px) {
    .call-container {
        height: 400px;
    }

    .local-video-container {
        width: 80px;
        height: 110px;
    }

    .call-btn {
        width: 40px;
        height: 40px;
        font-size: 11px;
    }

    .accept-btn, .reject-btn {
        width: 50px;
        height: 50px;
    }
}
/* Profile Modal */
.profile-modal {
    max-width: 500px;
    width: 90%;
}

.profile-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.profile-avatar-container {
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.avatar-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.avatar-btn {
    padding: 6px 12px;
    background: #2b5278;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.avatar-btn:hover {
    background: #2e6e9e;
}

.avatar-btn.remove {
    background: #e74c3c;
}

.avatar-btn.remove:hover {
    background: #c0392b;
}

.profile-form {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.profile-form .form-group {
    margin-bottom: 16px;
}

.profile-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #7f8c8d;
}

.profile-form label i {
    width: 20px;
}

.profile-form .modal-input {
    width: 100%;
    padding: 10px 12px;
    background: #242f3d;
    border: 1px solid #2b5278;
    border-radius: 8px;
    color: #e4e6eb;
    font-size: 14px;
}

.profile-form .modal-input:focus {
    outline: none;
    border-color: #2ecc71;
}

.profile-form .modal-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-form textarea.modal-input {
    resize: vertical;
    font-family: inherit;
}

.profile-form small {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 4px;
    display: block;
}

.profile-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.profile-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #242f3d;
}

.profile-divider span {
    background: #17212b;
    padding: 0 12px;
    font-size: 12px;
    color: #7f8c8d;
    position: relative;
    z-index: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #242f3d;
    display: flex;
    gap: 12px;
}

.modal-footer .modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.modal-footer .save-btn {
    background: #2ecc71;
    color: white;
}

.modal-footer .save-btn:hover {
    background: #27ae60;
}

.modal-footer .logout-btn {
    background: #e74c3c;
    color: white;
}

.modal-footer .logout-btn:hover {
    background: #c0392b;
}

/* Обновляем стили для sidebar header - добавляем кнопку профиля */
.sidebar-header {
    position: relative;
}

.sidebar-header .user-info {
    cursor: pointer;
    flex: 1;
}

.sidebar-header .user-info:hover {
    opacity: 0.8;
}

/* Добавляем кнопку профиля в sidebar */
.profile-btn {
    background: transparent;
    border: none;
    color: #7f8c8d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.profile-btn:hover {
    background: #242f3d;
    color: #e4e6eb;
}
/* Video Recorder Modal */
.recorder-modal {
    max-width: 600px;
    width: 90%;
}

.record-preview, .recorded-preview {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.record-preview video, .recorded-preview video {
    width: 100%;
    max-height: 400px;
    background: #000;
    border-radius: 12px;
}

.recording-indicator {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    display: none;
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.recording-text {
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
}

.recording-timer {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-family: monospace;
    font-weight: bold;
}

.recorder-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.recorder-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.recorder-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start-btn {
    background: #2ecc71;
    color: white;
}

.start-btn:hover:not(:disabled) {
    background: #27ae60;
}

.stop-btn {
    background: #e74c3c;
    color: white;
}

.stop-btn:hover:not(:disabled) {
    background: #c0392b;
}

.send-btn {
    background: #3498db;
    color: white;
}

.send-btn:hover:not(:disabled) {
    background: #2980b9;
}

.cancel-btn {
    background: #7f8c8d;
    color: white;
}

.cancel-btn:hover {
    background: #6c7a7d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .recorder-controls {
        gap: 8px;
    }

    .recorder-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .record-preview video, .recorded-preview video {
        max-height: 300px;
    }
}
/* PWA Install Button */
.install-pwa-btn {
    width: 100%;
    padding: 10px;
    background: #2b5278;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: background 0.2s;
    font-size: 14px;
}

.install-pwa-btn:hover {
    background: #2e6e9e;
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}