/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html, .app-container, .shorts-player, .shorts-video-container, .shorts-video {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #0a0a0f 50%, #141420 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px;
    background-position: 0 0, 100px 100px, 50px 50px, 150px 150px;
    animation: starfield 30s linear infinite;
    z-index: 0;
    pointer-events: none;
}
@keyframes starfield {
    0% { transform: translate(0, 0); }
    100% { transform: translate(200px, 200px); }
}

/* Легкий режим для страниц авторизации */
body.auth-page {
    background: linear-gradient(135deg, #000000 0%, #0a0a0f 50%, #141420 100%);
}
body.auth-page::before,
body.auth-page::after {
    content: none !important;
    animation: none !important;
}
body.auth-page .auth-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(10, 10, 20, 0.9)) !important;
    backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), inset 0 0 50px rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}
body.auth-page .bottom-tabs { display: none; }

/* Космические эффекты и туманности (черный космос) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 35% 35%, rgba(200, 200, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 65% 65%, rgba(255, 255, 255, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 50% 10%, rgba(200, 200, 255, 0.05) 0%, transparent 40%);
    z-index: 0;
    animation: nebula 25s ease-in-out infinite;
    pointer-events: none;
}
@keyframes nebula {
    0%, 100% { 
        transform: translateX(0) translateY(0) scale(1); 
        opacity: 0.6;
    }
    33% { 
        transform: translateX(20px) translateY(-30px) scale(1.1); 
        opacity: 0.8;
    }
    66% { 
        transform: translateX(-30px) translateY(20px) scale(0.9); 
        opacity: 0.5;
    }
}

@keyframes liquidGlass {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg) scale(1); 
        opacity: 0.9;
    }
    20% { 
        transform: translateX(15px) translateY(-20px) rotate(3deg) scale(1.05); 
        opacity: 1;
    }
    40% { 
        transform: translateX(-20px) translateY(15px) rotate(-3deg) scale(0.95); 
        opacity: 0.8;
    }
    60% { 
        transform: translateX(25px) translateY(-10px) rotate(2deg) scale(1.02); 
        opacity: 0.95;
    }
    80% { 
        transform: translateX(-15px) translateY(20px) rotate(-2deg) scale(0.98); 
        opacity: 0.85;
    }
}

.app-container {
    display: flex;
    flex-direction: column;
    height: calc(var(--vh) * 100);
    min-height: 0;
    padding: 0;
    margin: 0;
}

/* Нижние вкладки */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 
        0 -8px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 25px 25px 0 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bottom-tabs.is-hidden { 
    transform: translateY(100%) !important; 
    opacity: 0 !important; 
    pointer-events: none !important; 
    height: 0 !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    width: 60px;
    height: 60px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-item i {
    font-size: 24px;
}

/* Убираем синее выделение на мобильных устройствах */
.tab-item, .btn, .side-btn, .control-btn, button, input, textarea, select {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

.tab-item:active, .btn:active, .side-btn:active, .control-btn:active, button:active {
    -webkit-tap-highlight-color: transparent;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.tab-item span:first-of-type {
    display: none;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    justify-content: center;
    color: white;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(15, 15, 25, 0.7));
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.7), rgba(30, 30, 40, 0.8));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(15, 15, 25, 0.6));
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.7), rgba(30, 30, 40, 0.8));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
a.btn-icon { text-decoration: none; }

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Экран приветствия */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.welcome-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(10, 10, 20, 0.9));
    backdrop-filter: blur(30px);
    border-radius: 35px;
    padding: 50px 40px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.7),
        inset 0 0 50px rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #fff !important;
}

.welcome-content:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 60px rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.welcome-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 60px;
    color: white;
    margin-bottom: 15px;
}

.logo h1 {
    font-size: 32px;
    color: white;
    font-weight: 700;
    margin: 0;
}

.logo .subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0 0 0;
    font-weight: 400;
}

.welcome-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    margin-bottom: 30px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Формы авторизации */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 25px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 50px;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

.auth-header h2 {
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Регистрация: превью аватарки и кроппер */
.avatar-upload-container {
    align-items: flex-start;
}

.avatar-preview {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.avatar-upload-container { position: relative; }
.avatar-file-overlay {
    position: absolute;
    top: 42px; /* aligns under label within the group */
    left: 0;
    width: 112px;
    height: 112px;
    opacity: 0;
    cursor: pointer;
}

.avatar-preview:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-initial-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Кроппер модалка */
.cropper-modal .modal-content {
    background: rgba(30, 30, 30, 0.92);
    border: 1px solid rgba(255,255,255,0.18);
}

.cropper-body {
    padding: 15px 10px 0 10px;
}

.cropper-area {
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
    border-radius: 14px;
}

.cropper-area img { width: 100%; display: block; }

.cropper-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.cropper-actions .left { display: flex; gap: 8px; }
.cropper-actions .right { display: flex; gap: 10px; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input {
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: rgba(200, 200, 255, 0.9) !important;
    text-decoration: none;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4) !important;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Лента */
.feed-container {
    background: transparent;
    min-height: 100vh;
}

.feed-header {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 
        0 5px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 25px 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 2px 0 0 0;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.modal.chat-picker { padding: 0 !important; }

/* Делает модалку видимой при добавлении класса */
.modal.is-visible { display: flex; }

.modal-content {
    background: rgba(50, 50, 50, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.btn-close:hover {
    background: #f0f0f0;
}

/* Интенсивные стили жидкого стекла для форм */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-group input[type="text"], 
.form-group input[type="email"], 
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus, 
.form-group input[type="email"]:focus, 
.form-group input[type="password"]:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Стили для загрузки файлов */
.file-upload-section {
    margin: 30px 0;
    text-align: center;
}

.upload-btn {
    width: 100%;
    max-width: 300px;
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(15, 15, 25, 0.7));
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
}

.upload-btn:hover {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.7), rgba(30, 30, 40, 0.8));
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.7),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.upload-btn i {
    font-size: 20px;
}

/* Превью файла */
.file-preview {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.preview-item {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
}

.preview-item video {
    width: 100%;
    max-height: 200px;
    border-radius: 15px;
    object-fit: cover;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 100, 100, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: rgba(255, 100, 100, 1);
    transform: scale(1.1);
}

/* Информация о Short */
.short-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.short-info i {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4) !important;
}

/* Действия формы */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.form-actions .btn {
    flex: 1;
    max-width: 200px;
    padding: 18px 25px;
    font-size: 16px;
    font-weight: 600;
}

.file-upload-section {
    margin: 20px 0;
}

.file-preview {
    margin-top: 15px;
}

.preview-item {
    position: relative;
    display: inline-block;
    margin: 10px 10px 10px 0;
}

.preview-item img,
.preview-item video {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
}

.btn-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Посты */
.posts-container {
    padding: 20px;
}

.feed-container .post, .posts-container .post, .post {
    background: transparent;
    border-radius: 0;
    margin: 0 0 16px 0;
    border: none;
    box-shadow: none;
    overflow: visible;
    position: relative;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.post-header {
    padding: 8px 0 12px 0;
    border: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.post-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.post-content {
    padding: 0 0 12px 0;
}

.post-content p {
    font-size: 16px;
    line-height: 1.5;
    color: white;
    margin-bottom: 15px;
}

.post-content img {
    width: min(92vw, 860px);
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    margin: 8px auto 12px auto;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.post-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.post-content video {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-content video:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.post-actions {
    padding: 8px 0 0 0;
    border-top: none;
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-like {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-like:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4757;
}

.btn-comment {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-comment:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #3742fa;
}

/* Комментарии */
.comments-section {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.comments-list {
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.comment {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comment-header {
    margin-bottom: 8px;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.comment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-username {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.comment-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.comment-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.add-comment {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-comment input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.add-comment input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.add-comment input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.add-comment button {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(10, 10, 20, 1)) !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-comment button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

.no-comments {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 20px;
}

/* Stories стили */
.stories-section {
    padding: 20px;
    margin-bottom: 20px;
}

.stories-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.story-item.add-story {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.story-item.add-story:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.story-item.add-story .story-avatar {
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.story-item span {
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-info i {
    color: #3742fa;
}

/* Уведомления стили */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
}

.notification-content {
    flex: 1;
}

.notification-content p {
    color: white;
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.notification-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.btn-like.liked {
    color: #ff4757;
}

/* Новый дизлайк и состояния лайка/дизлайка стрелками */
.btn-dislike {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-dislike:hover { background: rgba(255, 255, 255, 0.1); color: #ff4757; }

.btn-like.is-upvoted { color: #2ed573; }
.btn-dislike.is-downvoted { color: #ff4757; }

/* Галерея изображений миниатюрами */
.post-images-gallery { display: grid; grid-template-columns: 1fr; gap: 12px; justify-items: center; }
.post-image-small { width: min(95vw, 900px); height: auto; border-radius: 12px; overflow: hidden; cursor: pointer; } /* Increased from 92vw to 95vw and 860px to 900px */
.post-image-small img { width: 100%; height: auto; object-fit: contain; display: block; }

/* Видео как миниатюра */
.post-video-thumb { width: 165px; height: 165px; border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; } /* Increased from 110px to 165px (1.5x) */
.post-video-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-video-thumb::after { content: '\f04b'; font-family: 'Font Awesome 5 Free'; font-weight: 900; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.95); text-shadow: 0 2px 8px rgba(0,0,0,0.4); font-size: 33px; } /* Increased from 22px to 33px */

/* Контейнер шире — посты без карточек */
.posts-container { padding: 24px 20px; }

/* Состояния загрузки */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin: 40px auto;
    max-width: 300px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.loading i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    animation: spin 1s linear infinite;
}

.loading p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin: 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 15px 50px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i,
.error-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ccc;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.notification-success {
    border-left: 4px solid #2ed573;
}

.notification-error {
    border-left: 4px solid #ff4757;
}

.notification-info {
    border-left: 4px solid #3742fa;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Shorts стили */
.shorts-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    margin: 0;
}


.shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.short-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.short-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.short-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.short-video {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.short-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.short-info {
    padding: 15px;
}

.short-header {
    margin-bottom: 10px;
}

.short-content p {
    color: white;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.short-actions {
    display: flex;
    justify-content: flex-end;
}

.short-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Поиск стили */
.search-container {
    background: transparent;
    min-height: 100vh;
}

.search-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.search-section {
    padding: 20px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.search-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.search-results {
    padding: 0 20px 20px;
}

.search-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.search-placeholder i {
    font-size: 60px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.search-placeholder h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-result-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-type {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.result-content p {
    color: white;
    margin-bottom: 15px;
}

.result-content img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.video-preview {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

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

.user-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-info h4 {
    color: white;
    margin-bottom: 5px;
}

.user-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 5px;
}

.user-joined {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.hashtag-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hashtag-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.hashtag-info h4 {
    color: white;
    margin-bottom: 5px;
    font-size: 18px;
}

.hashtag-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

/* Стили для групп */
.groups-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.groups-container {
    padding: 0 20px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.group-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.group-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-info h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 18px;
}

.group-info p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    line-height: 1.5;
}

.group-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.group-stats span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-actions {
    display: flex;
    gap: 10px;
}

.empty-state, .error-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state i, .error-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state h3, .error-state h3 {
    color: white;
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border-color: rgba(255, 255, 255, 0.3);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Стили для Live трансляций */
.live-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.streams-container {
    padding: 0 20px;
}

.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.stream-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stream-preview {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-placeholder {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
}

.stream-status {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.live-indicator {
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.viewers-count {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
}

.stream-info {
    padding: 20px;
}

.stream-info h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 18px;
}

.stream-info p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    line-height: 1.5;
}

.stream-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stream-meta span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stream-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #2ed573;
}

.notification.error {
    border-left: 4px solid #ff4757;
}

.notification.info {
    border-left: 4px solid #3742fa;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Стили для сообщений */
.messages-container {
    padding: 20px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.message-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-info {
    flex: 1;
}

.message-info h3 {
    color: white;
    margin-bottom: 5px;
    font-size: 16px;
}

.message-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.message-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.message-status {
    display: flex;
    align-items: center;
}

.unread-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Профиль стили */
.profile-container {
    background: transparent;
    min-height: 100vh;
}

.profile-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-info {
    padding: 20px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-details h2 {
    color: white;
    font-size: 24px;
    margin-bottom: 10px;
}

.profile-details p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.profile-joined {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.profile-posts {
    padding: 0 20px 20px;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.posts-header h3 {
    color: white;
    font-size: 20px;
}

.posts-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.profile-post {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-post .post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.post-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.post-type {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.post-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.btn-delete {
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff4757;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: rgba(255, 71, 87, 0.3);
}

/* Адаптивность */
@media (max-width: 480px) {
    .welcome-content,
    .auth-card {
        padding: 30px 20px;
    }
    
    .logo h1 {
        font-size: 28px;
    }
    
    .auth-header h2 {
        font-size: 20px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .posts-container {
        padding: 15px;
    }
    
    .shorts-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
    }
}

/* Переключатель панели вкладок (стрелочка) */
.tabs-toggle {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) !important;
    bottom: 6px;
    width: 42px;
    height: 28px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    cursor: pointer;
    transition: bottom 0.3s ease, opacity 0.3s ease !important;
}

.tabs-toggle { display: flex; }

.tabs-toggle.collapsed { opacity: 0.9; }
.tabs-toggle.expanded { opacity: 1; }
.tabs-toggle:hover { 
    transform: translateX(-50%) !important;
    left: 50% !important;
}

/* Форма создания Short */
.create-short-form {
    padding: 30px;
}

.create-short-form .form-group {
    margin-bottom: 25px;
}

.create-short-form .form-group:last-of-type {
    margin-bottom: 0;
}

/* TikTok-подобный интерфейс Shorts */
.shorts-container {
    background: #000;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Убираем скролл на странице Shorts */
body.shorts-page {
    overflow: hidden;
    height: 100vh;
}

body.shorts-page .app-container {
    overflow: hidden;
    height: 100vh;
}

body.shorts-page .bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}


/* Shorts Player */
.shorts-player {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    padding: 0;
    margin: 0;
}

.shorts-video-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px); /* 70px ~ header */
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.short-video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(56.25vh, 420px); /* 9:16 box; 420px max on desktop */
    height: calc(min(56.25vh, 420px) * 16 / 9);
    max-height: 86vh;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    opacity: 0;
    transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}

.short-video-wrapper.enter { opacity: 1; }
.short-video-wrapper.next { transform: translate(-50%, calc(-50% + 40px)); opacity: 0; }
.short-video-wrapper.prev { transform: translate(-50%, calc(-50% - 40px)); opacity: 0; }
.short-video-wrapper.exit-up { transform: translate(-50%, calc(-160%)); opacity: 0; }
.short-video-wrapper.exit-down { transform: translate(-50%, 60%); opacity: 0; }

.shorts-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    cursor: pointer;
}

/* Для горизонтальных видео - добавляем черные полосы */
.shorts-video[data-orientation="horizontal"] {
    object-fit: contain;
    background: #000;
}

/* Видео контролы */
.video-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.control-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Информация о видео */
.video-info {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-40%); /* немного правее от центра */
    width: min(420px, 92vw);
    z-index: 10;
    color: white;
}

.video-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-description {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
}

.video-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff0050, #ff4081);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Боковые кнопки */
.side-controls {
    position: absolute;
    right: max(calc(50% - 240px), 10px);
    bottom: 110px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 12;
}

.side-btn {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.25); /* подложка всегда */
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.38), 0 0 0 2px rgba(255,255,255,0.14);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.side-btn:hover {
    background: rgba(255,255,255,0.13);
    box-shadow: 0 4px 20px 0 rgba(0,0,0,0.5), 0 0 0 2px rgba(255,255,255,0.22);
    color: #ff0050;
}

.side-btn i,
.side-btn svg {
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.28)); /* усиление светлой иконки */
}

.side-btn span {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.like-btn:hover {
    background: rgba(255, 0, 80, 0.3);
    border-color: rgba(255, 0, 80, 0.5);
}

.dislike-btn:hover {
    background: rgba(100, 100, 255, 0.3);
    border-color: rgba(100, 100, 255, 0.5);
}

.comment-btn:hover {
    background: rgba(255, 200, 0, 0.3);
    border-color: rgba(255, 200, 0, 0.5);
}

.share-btn:hover {
    background: rgba(0, 255, 100, 0.3);
    border-color: rgba(0, 255, 100, 0.5);
}

/* Навигационные подсказки */
.navigation-hints {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 10;
}

.swipe-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
}

.swipe-hint i {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .short-video-wrapper {
        width: 88vw;
        height: calc(88vw * 16 / 9);
        max-height: 80vh;
        border-radius: 14px;
    }
    .video-info { bottom: 78px; width: 88vw; transform: translateX(-36%); }
    .side-controls { right: 8px; bottom: 84px; gap: 14px; }
    
    .side-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .navigation-hints {
        right: 15px;
    }
}

/* Стили для комментариев */
.comments-modal {
    max-width: 500px;
    max-height: 80vh;
}

/* Shorts skeletons */
.short-skeleton { position: relative; width: 100%; height: calc(100vh - 70px); display:flex; align-items:center; justify-content:center; }
.skeleton-player { width: min(56.25vh, 420px); height: calc(min(56.25vh, 420px) * 16 / 9); border-radius:18px; background: linear-gradient(90deg,#1a1a1a 25%,#222 37%,#1a1a1a 63%); background-size:400% 100%; animation: shimmer 1.2s infinite; }
.skeleton-ui { position:absolute; bottom:90px; left:50%; transform:translateX(-50%); width:min(420px,92vw); display:flex; justify-content:flex-end; }
.skeleton-actions { display:flex; flex-direction:column; gap:12px; }
.skeleton-btn { width:50px; height:50px; border-radius:50%; background:#222; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Shake hint at end */
.shake-animation { animation: shake .3s; }
@keyframes shake { 0%{transform:translateX(0)} 25%{transform:translateX(-6px)} 50%{transform:translateX(6px)} 75%{transform:translateX(-3px)} 100%{transform:translateX(0)} }

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.comment {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

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

.comment-username {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.comment-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.comment-content p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.no-comments {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 20px;
}

.add-comment {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.add-comment input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    outline: none;
}

.add-comment input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.add-comment button {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(10, 10, 20, 0.95)) !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-comment button:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(15, 15, 25, 1)) !important;
    transform: scale(1.1);
}

/* Состояния загрузки и ошибок */
.empty-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin: 40px auto;
    max-width: 400px;
}

.empty-state i, .error-state i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-state h3, .error-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p, .error-state p {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-state .btn, .error-state .btn {
    margin-top: 10px;
}

/* Медиа модальное окно */
.media-viewer {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    padding: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* Полноэкранное светлое стекло для создания Short */
.create-short-modal.modal {
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(8px);
}
.create-short-modal .create-short-content {
    width: min(900px, 92vw);
    max-height: 90vh;
    overflow: auto;
    border-radius: 22px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    color: #111;
}
.create-short-content .modal-header { border-bottom: 1px solid rgba(0,0,0,0.08); }
.create-short-form input[type="text"],
.create-short-form textarea {
    background: rgba(255,255,255,0.9);
    color: #111;
    border: 1px solid rgba(0,0,0,0.12);
}
.create-short-form .upload-btn { background: rgba(255,255,255,0.75); color: #111; border-color: rgba(0,0,0,0.1); }
.create-short-form .upload-btn:hover { background: rgba(255,255,255,0.9); }
.create-short-form .form-actions .btn.btn-secondary { background: rgba(0,0,0,0.05); color:#111; border-color: rgba(0,0,0,0.08); }
.create-short-form .form-actions .btn.btn-primary { background: #111; color: #fff; border-color: #111; }
.upload-progress { margin-top: 12px; }
.progress-bar { width: 100%; height: 8px; background: rgba(0,0,0,0.06); border-radius: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9)); transition: width .3s ease; }

.media-close {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.media-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 15px;
}

/* Улучшенное позиционирование модального окна создания поста */
#createPostModal {
    align-items: flex-start;
    padding-top: 10vh;
}

#createPostModal .modal-content {
    margin-top: 0;
}

/* Кнопки с эффектом жидкого стекла */
.glass-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Поле ввода текста */
#postContent {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 15px !important;
    color: white !important;
    padding: 15px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    transition: all 0.3s ease !important;
}

#postContent:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none !important;
}

#postContent::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Страница пользователей */
.users-container {
    background: transparent;
    min-height: 100vh;
}

.users-header {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 
        0 5px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 25px 25px;
    margin-bottom: 30px;
}

.users-list {
    padding: 0 20px 100px 20px;
}

.user-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info {
    flex: 1;
    color: white;
}

.user-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.user-info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.user-joined {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.user-actions {
    display: flex;
    gap: 10px;
}

.user-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
}


/* реклама стили */
#adSlot {
    margin: 10px auto !important;
    text-align: center !important;
    max-width: 600px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

#adSlot > div {
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.ad-container {
    width: 100% !important;
    max-width: 400px !important; /* Уменьшаем максимальную ширину */
    margin: 0 auto !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    min-height: 120px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

.ad-container img, 
.ad-container video {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 300px !important;  /* Увеличено в 2 раза - с 150 до 300px */
    border-radius: 12px !important;
    object-fit: contain !important;
    cursor: pointer !important;
    display: block !important;
    margin: 0 auto !important;
}

.ad-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 8px !important;
    width: 100% !important;
    max-width: 400px !important; /* Такая же ширина как и у контейнера рекламы */
}

.ad-nav-btn {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: block !important;
}

.ad-nav-btn:hover {
    background: rgba(255,255,255,0.3) !important;
}

.ad-indicators {
    display: flex !important;
    gap: 8px !important;
    justify-content: center !important;
    flex: 1 !important;
}

.ad-indicator {
    width: 8px !important;
    height: 8px !important;
    background: rgba(255,255,255,0.5) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ad-indicator.active {
    width: 24px !important;
    height: 8px !important;
    background: #fff !important;
}

.ad-inner {
    text-align: center !important;
    color: #666 !important;
    padding: 20px !important;
}

.ad-inner.default-ad {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

.ad-inner.default-ad a {
    color: #4a90e2 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    margin-top: 8px !important;
}

.ad-inner.default-ad i {
    font-size: 24px !important;
    margin-bottom: 10px !important;
    display: block !important;
    color: #4a90e2 !important;
}

/* Поля ввода пароля */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    width: 100%;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Заголовок профиля */
.profile-header {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 
        0 5px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 25px 25px;
    margin-bottom: 30px;
}

.profile-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Users Page Header Fix */
.users-header {
    margin-top: -20px;
    margin-left: -20px;
    margin-right: -20px;
}

/* User Card Avatar */
.user-card .user-avatar {
    width: 50px;
    height: 50px;
    margin-right: 16px;
    flex-shrink: 0;
}

/* Generic Avatar Styles */
.avatar-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

/* Исправление: убираем все height/min-height/max-height для Shorts (player, video-container, video), чтобы JS расчёт работал корректно. */
.shorts-player,
.shorts-video-container,
.shorts-video {
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

@media (max-width: 700px) {
  .side-controls {
      bottom: 90px !important;
      right: 8px;
      gap: 12px;
  }
  .side-btn {
      width: 44px;
      height: 44px;
      font-size: 17px;
  }
}

body.body-shorts-view .bottom-tabs, .body-shorts-view .bottom-tabs, .shorts-container .bottom-tabs, .shorts-player ~ .bottom-tabs, .app-container > .bottom-tabs {
display: none !important;
visibility: hidden !important;
pointer-events: none !important;
height: 0 !important;
min-height: 0 !important;
max-height: 0 !important;
opacity: 0 !important;
}

.video-info {
    background: rgba(10,10,10,0.48);
    border-radius: 16px;
    padding: 16px 22px 12px 18px;
    color: white !important;
    backdrop-filter: blur(3px);
    max-width: 72vw;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.18);
}
.video-title, .video-description, .author-name {
    color: white !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

.side-controls { z-index: 1200 !important;}

/* Telegram-like Chats Layout */
.chat-layout { display:flex; flex: 1 1 auto; min-height: 0; height: calc(var(--vh) * 100); }
.chat-sidebar { width: 360px; min-width: 280px; max-width: 420px; border-right: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); backdrop-filter: blur(14px); display:flex; flex-direction:column; height: calc(var(--vh) * 100); }
.chat-sidebar-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom: 1px solid rgba(255,255,255,0.14); }
.chat-search { position:relative; padding:10px 12px; }
.chat-search i { position:absolute; top:50%; left:22px; transform: translateY(-50%); color: rgba(255,255,255,0.6); }
.chat-search input { width:100%; padding:12px 14px 12px 40px; border-radius: 14px; border:1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color:#fff; }
.chat-list { overflow-y:auto; padding: 6px 6px 12px 6px; flex: 1 1 auto; }
.chat-item { display:flex; gap:12px; padding:10px 10px; border-radius:14px; cursor:pointer; align-items:center; }
.chat-item:hover { background: rgba(255,255,255,0.08); }
.chat-avatar { width:48px; height:48px; border-radius:50%; overflow:hidden; background: rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.22); flex-shrink:0; }
.chat-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.chat-meta { flex:1; min-width:0; }
.chat-meta .row { display:flex; justify-content:space-between; gap:8px; }
.chat-meta .name { color:#fff; font-weight:600; }
.chat-meta .time { color: rgba(255,255,255,0.55); font-size:12px; }
.chat-meta .preview { color: rgba(255,255,255,0.8); font-size:14px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width: 70%; }
.chat-meta .indicators { display:flex; align-items:center; gap:6px; }

.chat-main { flex:1; display:flex; flex-direction:column; position: relative; overflow: hidden; height: 100%; }
.chat-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); backdrop-filter: blur(14px); }
.chat-peer { display:flex; gap:12px; align-items:center; }
.chat-peer-avatar { width:40px; height:40px; border-radius:50%; overflow:hidden; background: rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.22); }
.chat-peer-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.chat-peer-name { color:#fff; font-weight:600; }
.chat-peer-status { color: rgba(144,214,144,0.9); font-size:12px; }

.chat-empty { flex:1; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; color: rgba(255,255,255,0.75); }
.chat-empty i { font-size:46px; opacity:0.85; }

.chat-messages { flex:1; padding: 12px 14px 120px 14px; overflow-y:auto; display:block; }
.msg-row { display:flex; margin: 6px 0; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.peer { justify-content: flex-start; }
.bubble { max-width: 72%; padding: 12px 14px; border-radius: 16px 16px 16px 8px; background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.10)); border:1px solid rgba(255,255,255,0.18); color:#fff; box-shadow: 0 6px 18px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.12); }
.msg-row.mine .bubble { border-radius: 16px 16px 8px 16px; background: linear-gradient(135deg, rgba(0,0,0,0.65), rgba(15,15,20,0.6)); border-color: rgba(255,255,255,0.12); }
.bubble .text { white-space: pre-wrap; word-wrap: break-word; }
.bubble .meta { margin-top:6px; font-size:11px; color: rgba(255,255,255,0.65); text-align:right; display: flex; justify-content: space-between; align-items: center; }
.read-status { display: inline-block; margin-left: 4px; }

.chat-composer { position: sticky; bottom: 0; left: 0; width: auto; z-index: 10; display:flex; gap:8px; align-items:center; padding:10px; border-top:1px solid rgba(255,255,255,0.14); background: rgba(20,20,28,0.9); backdrop-filter: blur(8px); }
.msg-row.is-context .bubble { box-shadow: 0 0 0 2px rgba(255,255,255,0.35) inset; }

/* Animation for new messages */
.msg-row.new-message {
    animation: messageFall 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messageFall {
    0% {
        opacity: 0;
        transform: translateX(var(--msg-start-x, 20px)) translateY(-10px) rotate(var(--msg-rotation, 2deg));
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0) rotate(0);
    }
}

.msg-row.mine .bubble {
    --msg-start-x: 20px;
    --msg-rotation: -2deg;
}

.msg-row.peer .bubble {
    --msg-start-x: -20px;
    --msg-rotation: 2deg;
}

/* Online status indicator */
.chat-peer-status {
    position: relative;
}
.chat-peer-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #90d690;
    margin-right: 4px;
    animation: pulse 1.5s infinite;
}
.chat-peer-status.offline::before {
    background: #ff6b6b;
    animation: none;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Message Reactions */
.message-reactions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.reaction {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.reaction:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.reaction.own {
    background: rgba(0,150,255,0.25);
    border-color: rgba(0,150,255,0.5);
    box-shadow: 0 0 8px rgba(0,150,255,0.3);
}

.reaction-emoji {
    font-size: 12px;
}

.reaction-count {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 2px;
}

/* Reaction animation */
@keyframes reactionPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.reaction.pop {
    animation: reactionPop 0.3s ease-out;
}

/* Reaction picker */
.reaction-picker {
    position: fixed;
    background: rgba(30,30,40,0.95);
    border-radius: 24px;
    padding: 12px;
    display: flex;
    gap: 10px;
    z-index: 10000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    animation: pickerAppear 0.2s ease-out;
}

@keyframes pickerAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.reaction-option {
    font-size: 22px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-option:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}
.composer-preview { display:flex; gap:8px; padding:8px 6px; overflow-x:auto; }
.composer-thumb { position:relative; width:56px; height:56px; border-radius:8px; overflow:hidden; border:1px solid rgba(255,255,255,0.2); }
.composer-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.composer-remove { position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:50%; background: rgba(0,0,0,0.65); color:#fff; border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:12px; }
.chat-composer input[type="text"] { flex:1; padding:12px 14px; border-radius: 16px; border:1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color:#fff; }
.composer-btn { width:40px; height:40px; border-radius:50%; border:1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color:#fff; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.composer-btn.send { background: rgba(0,0,0,0.65); }

@media (max-width: 900px) {
  .chat-sidebar { width: 100%; min-width: 0; }
  .chat-meta .row .time, .chat-meta .row .preview { display:none; }
  /* Мобильный режим: сначала только список, при открытии чата показываем чат */
  .chat-main { display: none; }
  .chat-layout.chat-open .chat-sidebar { display: none; }
  .chat-layout.chat-open .chat-main { display: flex; }
  #chatBackBtn { display: inline-flex !important; }
}

/* Fullscreen bottom sheet for chat picker */
.chat-picker { align-items: stretch; background: rgba(0,0,0,0.55) !important; }
.chat-picker-sheet { width: 100%; height: calc(var(--vh) * 100); max-height: none; background: rgba(20,20,28,0.98); border-radius: 0; padding: 0; transform: translateY(100%); animation: sheet-in .24s ease-out forwards; }
@keyframes sheet-in { from { transform: translateY(100%);} to { transform: translateY(0);} }
.chat-picker-header { display:flex; align-items:center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.chat-picker-header .btn-close { width:36px; height:36px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; }
.chat-picker-search { position: relative; padding: 12px 14px; }
.chat-picker-search i { position:absolute; top: 50%; left: 36px; transform: translateY(-50%); color: rgba(255,255,255,0.6); }
.chat-picker-search input { width:100%; padding: 12px 14px 12px 46px; border-radius: 14px; border:1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color:#fff; font-size: 16px; }
.chat-picker-list { height: calc(100% - 130px); overflow-y:auto; padding: 0 12px 12px 12px; }

/* Mobile-specific chat improvements */
@media (max-width: 768px) {
  .chat-sidebar { 
    width: 100%; 
    min-width: 100%;
    max-width: 100%;
  }
  .chat-main { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none; /* Hidden by default, shown when chat is opened */
  }
  .chat-main.active {
    display: flex;
  }
  .chat-messages {
    padding: 12px 10px 110px 10px; /* Increased bottom padding for mobile composer */
  }
  .chat-composer {
    padding: 12px;
    gap: 8px;
  }
  .chat-composer input[type="text"] {
    padding: 14px;
    font-size: 16px; /* Larger font for mobile */
  }
  .composer-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .msg-row {
    margin: 8px 0; /* Slightly more spacing on mobile */
  }
  .bubble {
    max-width: 85%; /* Bubbles take more space on mobile */
    padding: 12px 16px;
  }
  .chat-meta .preview {
    max-width: 60%; /* Show more preview text on mobile */
  }
  .chat-peer {
    flex: 1;
  }
  .chat-peer-info {
    flex: 1;
  }
  .chat-peer-name {
    font-size: 16px; /* Make name slightly larger on mobile */
  }
}
