* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Скрыть полоску скролла везде */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* Отключаем стандартный pull-to-refresh браузера */
    overscroll-behavior-y: contain;
}

html {
    overscroll-behavior-y: contain;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    margin-bottom: 24px;
}

.splash-logo img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.splash-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: splash-spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes splash-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Auth Container - на весь экран с прокруткой */
#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#auth-container::-webkit-scrollbar {
    display: none;
}

#auth-container.hidden {
    display: none;
}

.container {
    width: 100%;
    padding: 20px;
}

/* Auth Wrapper */
.auth-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Auth Header - логотип, название, слоган */
.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}

.auth-slogan {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Auth Box - форма */
.auth-box {
    background: white;
    width: 100%;
    padding: 24px 20px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-form-title {
    text-align: center;
    color: #333;
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
}

.auth-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    margin-bottom: 0;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
}

button:focus,
button:active,
.btn:focus,
.btn:active {
    outline: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
}

.btn-secondary:hover {
    background: #333;
    box-shadow: none;
    transform: none;
}

.form-buttons {
    display: flex;
    gap: 12px;
}

.form-buttons .btn {
    flex: 1;
}

.message {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
}

.message:empty {
    display: none;
}

.message.error {
    background: #ffe6e6;
    color: #d63031;
}

.message.success {
    background: #e6ffe6;
    color: #27ae60;
}

.switch-auth {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.switch-auth a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

.hidden {
    display: none;
}

/* Главная страница */
#home-section {
    width: 100%;
    min-height: 100vh;
}

.home-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-header h1 {
    font-size: 24px;
}

.btn-logout {
    width: auto;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
}

.btn-logout:hover {
    background: white;
    color: #667eea;
}

.home-main {
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.welcome-card {
    background: white;
    padding: 40px 60px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.welcome-card h2 {
    color: white;
    margin-bottom: 15px;
}

.welcome-card p {
    color: white;
}

.user-info {
    margin-top: 10px;
}

.user-info span {
    font-weight: 600;
    color: #667eea;
}

/* Выбор пола */
.gender-select {
    display: flex;
    gap: 15px;
}

.gender-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.gender-option:hover {
    border-color: #667eea;
}

.gender-option input {
    width: auto;
    margin-right: 8px;
}

.gender-option input:checked + span {
    color: #667eea;
    font-weight: 600;
}

.gender-option:has(input:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Чекбокс соглашения */
.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #667eea;
}

.checkbox-text {
    flex: 1;
}

.checkbox-text a {
    color: #667eea;
    text-decoration: none;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Кнопка Google */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    color: #333;
    border: 2px solid #e1e1e1;
    font-weight: 500;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Разделитель */
.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e1e1;
}

.divider span {
    padding: 0 15px;
    color: #999;
    font-size: 14px;
}

/* Онбординг */
#onboarding-section {
    background: white;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#onboarding-section h1 {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 600;
}

.onboarding-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
}

/* Автокомплит */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f0f0ff;
}

.autocomplete-item-name {
    font-weight: 500;
    color: #333;
}

.autocomplete-item-sub {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.autocomplete-empty {
    padding: 12px 15px;
    color: #999;
    text-align: center;
    font-size: 14px;
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Селект */
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Подсказка */
.hint {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

/* Сетка профессий */
.professions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.profession-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 2px solid #e1e1e1;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.profession-chip:hover {
    border-color: #667eea;
}

.profession-chip input {
    display: none;
}

.profession-chip:has(input:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.profession-chip:has(input:checked) span {
    color: white;
}

/* ==================== */
/* ПРИЛОЖЕНИЕ (APP)     */
/* ==================== */

#app-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    z-index: 50;
}

#app-container.hidden {
    display: none;
}

/* Ограничение ширины для десктопа */
@media (min-width: 480px) {
    #app-container {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}

/* Top Navigation */
.top-nav {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    z-index: 100;
}

.top-nav-scroll {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.top-nav-scroll::-webkit-scrollbar {
    display: none;
}

.top-nav-item {
    padding: 8px 16px;
    border: none;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.top-nav-item:hover {
    background: #e0e0e0;
}

.top-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item:hover {
    color: #667eea;
}

.nav-item.active {
    color: #667eea;
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* min-height: 0 важен для flex контейнера со скроллом */
    min-height: 0;
}

.app-content::-webkit-scrollbar {
    display: none;
}

.page {
    display: none;
    min-height: 100%;
}

.page.active {
    display: block;
}

#page-feed {
    /* Скролл обрабатывается .app-content */
    overscroll-behavior-y: contain;
}

/* Pull to Refresh */
.pull-to-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
    background: #f5f5f5;
}

.pull-to-refresh.pulling {
    height: 50px;
}

.pull-to-refresh.refreshing {
    height: 50px;
}

.pull-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-size: 14px;
}

.pull-indicator svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.pull-to-refresh.ready .pull-indicator svg {
    transform: rotate(180deg);
}

.pull-to-refresh.refreshing .pull-indicator svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Feed */
.feed-container {
    padding: 16px;
    padding-bottom: 24px;
}

.load-more-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    color: #667eea;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.load-more-btn:active {
    background: #eee;
}

.feed-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.feed-empty p {
    font-size: 16px;
    margin-bottom: 8px;
}

.feed-empty-hint {
    font-size: 14px;
    color: #bbb;
}

/* Post Card */
.post-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Welcome Card */
.welcome-card {
    position: relative;
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.welcome-card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-card-close:hover {
    background: rgba(255,255,255,0.3);
}

.welcome-card-icon {
    margin-bottom: 12px;
}

.welcome-card-icon svg {
    opacity: 0.9;
}

.welcome-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.welcome-card-text {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
    margin-bottom: 16px;
}

.welcome-card-btn {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.welcome-card-btn:hover {
    background: rgba(255,255,255,0.9);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.post-meta {
    font-size: 12px;
    color: #999;
}

.post-more-btn {
    padding: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
}

.post-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.post-type-badge.search {
    background: #e3f2fd;
    color: #1976d2;
}

.post-type-badge.offer {
    background: #e8f5e9;
    color: #388e3c;
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.post-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.post-tag {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.post-actions {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.post-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    cursor: pointer;
    transition: background 0.2s;
}

.post-action-btn:hover {
    background: #ebe8fd;
}

/* Post Images Gallery */
.post-images {
    display: grid;
    gap: 4px;
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
}

.post-images.single {
    grid-template-columns: 1fr;
}

.post-images.double {
    grid-template-columns: 1fr 1fr;
}

.post-images.triple {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-images.triple .post-image:first-child {
    grid-row: span 2;
}

.post-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.post-images.single .post-image {
    aspect-ratio: 16/9;
    max-height: 300px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.post-image:hover img {
    transform: scale(1.02);
}

/* Image Viewer (Full Screen) */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.image-viewer-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-viewer-prev,
.image-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-viewer-prev {
    left: -60px;
}

.image-viewer-next {
    right: -60px;
}

.image-viewer-prev:hover,
.image-viewer-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-viewer-counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Mobile adjustments for image viewer */
@media (max-width: 600px) {
    .image-viewer-prev,
    .image-viewer-next {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .image-viewer-prev {
        left: 10px;
    }

    .image-viewer-next {
        right: 10px;
    }

    .image-viewer-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }
}

/* Create Page */
.create-container {
    padding: 20px 16px;
    background: white;
    min-height: 100%;
}

.create-container h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
}

.post-type-select {
    display: flex;
    gap: 12px;
}

.post-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.post-type-option input {
    display: none;
}

.post-type-option:has(input:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.post-type-option:has(input:checked) span {
    color: #667eea;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Кнопка геолокации */
.btn-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-location:hover {
    background: #667eea;
    color: white;
}

.btn-location.active {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.btn-location.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Image Upload */
.image-upload-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #667eea;
    border: 2px dashed #667eea;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: #f0f4ff;
    border-style: solid;
}

.btn-upload.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.image-previews {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

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

.image-preview .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.image-preview .remove-image:hover {
    background: #f44336;
}

.image-preview.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

.image-upload-hint {
    font-size: 12px;
    color: #999;
    margin: 4px 0 0 0;
}

.image-upload-hint.error {
    color: #f44336;
}

.image-upload-hint.checking {
    color: #ff9800;
}

/* Chats Page */
.chats-container {
    padding: 16px;
}

.chats-container h2 {
    margin-bottom: 16px;
    color: #333;
}

.chats-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
}

.chats-search-box svg {
    color: #999;
    flex-shrink: 0;
}

.chats-search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
}

.chats-search-box input::placeholder {
    color: #aaa;
}

.chats-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.chats-empty-hint {
    font-size: 14px;
    color: #bbb;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f5f5f5;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    position: relative;
}

.chat-online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

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

.chat-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.chat-last-message {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 12px;
    color: #bbb;
}

/* Search Page */
.search-container {
    padding: 16px;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-icon-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Search Filters */
.search-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #e1e1e1;
    border-radius: 20px;
    background: white;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.search-filter-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.search-filter-btn.active svg {
    fill: white;
}

/* Active Filters Tags */
.search-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.search-active-filters.hidden {
    display: none;
}

.active-filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f0f0f0;
    border-radius: 16px;
    font-size: 13px;
    color: #333;
}

.active-filter-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: #ccc;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.active-filter-tag button:hover {
    background: #f44336;
}

/* Search Results */
.search-results {
    min-height: 200px;
}

.search-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.search-hint svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-hint p {
    margin: 0;
}

.search-hint-sub {
    font-size: 14px;
    color: #bbb;
    margin-top: 4px !important;
}

.search-hint.hidden {
    display: none;
}

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

.search-results-list.hidden {
    display: none;
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: #999;
}

.search-loading.hidden {
    display: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e1e1e1;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.search-empty.hidden {
    display: none;
}

.search-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Search Result Card */
.search-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.search-result-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.search-result-username {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 4px;
}

.search-result-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.search-result-location svg {
    width: 12px;
    height: 12px;
}

.search-result-professions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.search-result-profession {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
}

.search-result-distance {
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
    flex-shrink: 0;
}

/* Location Modal */
.search-location-modal-content {
    max-width: 360px;
    text-align: left;
}

.location-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.location-tab {
    flex: 1;
    padding: 10px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.location-tab.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.location-tab-content {
    margin-bottom: 16px;
}

.location-tab-content.hidden {
    display: none;
}

.location-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    text-align: center;
}

#search-location-modal .distance-options {
    margin-bottom: 16px;
}

#search-get-location-btn {
    width: 100%;
}

#search-location-modal .form-group {
    margin-bottom: 12px;
}

#search-apply-city-btn {
    width: 100%;
    margin-top: 8px;
}

/* Profile Page */
.profile-container {
    padding: 20px 16px;
    text-align: center;
}

.profile-header {
    margin-bottom: 20px;
}

/* Новый компактный хедер профиля */
.profile-header-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
}

.profile-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-name-row #profile-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.profile-name-row .profile-username {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.profile-location-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-location-status .profile-location {
    color: #888;
    font-size: 13px;
    margin: 0;
}

.profile-location-status .profile-availability {
    margin: 0;
}

.profile-avatar-small {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.profile-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    cursor: pointer;
}

.profile-stats-compact {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    flex: 1;
    min-width: 0;
    gap: 4px;
    text-align: center;
}

.stat-item-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0;
    min-width: 0;
}

.stat-item-compact .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.stat-item-compact .stat-label {
    font-size: 11px;
    color: #999;
}

/* Меню профиля в виде списка */
.profile-menu-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f5f5f5;
}

.profile-menu-item:active {
    background: #eee;
}

.profile-menu-item svg:first-child {
    color: #667eea;
    flex-shrink: 0;
}

.profile-menu-item span {
    flex: 1;
}

.profile-menu-item .menu-arrow {
    color: #ccc;
    flex-shrink: 0;
}

.profile-menu-item.danger {
    color: #f44336;
}

.profile-menu-item.danger svg:first-child {
    color: #f44336;
}

.profile-menu-divider {
    height: 1px;
    background: #eee;
    margin: 0 16px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 36px;
    font-weight: 600;
}

#profile-name {
    font-size: 24px;
    color: #333;
    margin-bottom: 2px;
}

.profile-username {
    color: #667eea;
    font-size: 14px;
    margin-bottom: 4px;
}

.profile-location {
    color: #999;
    font-size: 14px;
}

.profile-professions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.profile-professions .profession-chip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: default;
}

/* Статус доступности */
.profile-availability {
    display: none;
}

.profile-availability.visible {
    display: flex;
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.availability-badge.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.availability-badge.busy {
    background: #ffebee;
    color: #c62828;
}

.availability-badge.partially {
    background: #fff3e0;
    color: #ef6c00;
}

.availability-badge.not_available {
    background: #f5f5f5;
    color: #757575;
}

.availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.availability-badge.available .availability-dot {
    background: #4caf50;
}

.availability-badge.busy .availability-dot {
    background: #f44336;
}

.availability-badge.partially .availability-dot {
    background: #ff9800;
}

.availability-badge.not_available .availability-dot {
    background: #9e9e9e;
}

/* Навыки */
.profile-skills {
    display: none;
    margin-bottom: 16px;
}

.profile-skills.visible {
    display: block;
}

.profile-skills-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.profile-skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.skill-tag {
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.profile-bio {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
    display: none;
}

.profile-bio.visible {
    display: block;
}

.profile-bio-text {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.profile-experience {
    display: none;
    margin-bottom: 16px;
}

.profile-experience.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-experience-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #388e3c;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.profile-experience-badge svg {
    width: 16px;
    height: 16px;
}

.profile-socials {
    display: none;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.profile-socials.visible {
    display: flex;
}

.profile-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    color: #667eea;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.profile-social-link svg {
    width: 22px;
    height: 22px;
}

.profile-profession-tag {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

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

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #ff5252;
    color: white;
}

.btn-danger:hover {
    background: #ff3333;
}

.btn-logout-full {
    width: 100%;
    background: #ff5252;
    margin-top: 20px;
}

.btn-logout-full:hover {
    background: #ff1744;
    box-shadow: 0 5px 20px rgba(255, 82, 82, 0.4);
}

/* Profile Calendar */
.profile-calendar-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

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

.calendar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.calendar-nav-btn:hover {
    background: #e0e0e0;
}

.calendar-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: #666;
}

.calendar-month {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    padding: 8px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #333;
    border-radius: 8px;
    background: #f9f9f9;
    position: relative;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    background: #e3f2fd;
    font-weight: 600;
    color: #1976d2;
}

.calendar-day.busy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

.calendar-day.busy.today {
    box-shadow: 0 0 0 2px #1976d2;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-dot.busy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Portfolio Page */
.portfolio-container {
    padding: 0;
    background: white;
    min-height: 100%;
}

.portfolio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.portfolio-header h2 {
    margin: 0;
    font-size: 18px;
}

.back-btn,
.add-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}

.back-btn:hover,
.add-btn:hover {
    background: #f0f0f0;
}

.add-btn {
    color: #667eea;
}

/* Навыки и опыт в портфолио */
.portfolio-skills {
    display: none;
    padding: 16px;
    background: white;
    margin: 0 12px 12px;
    border-radius: 12px;
}

.portfolio-skills.visible {
    display: block;
}

.portfolio-section-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.portfolio-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-experience {
    display: none;
    padding: 0 12px 12px;
}

.portfolio-experience.visible {
    display: flex;
    justify-content: center;
}

.portfolio-experience-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.portfolio-experience-badge svg {
    width: 18px;
    height: 18px;
}

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

/* Старые стили для изображений (для обратной совместимости) */
.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.portfolio-item-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-item-role {
    font-size: 10px;
    opacity: 0.8;
}

/* Новые стили для карточек портфолио */
.portfolio-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.portfolio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.portfolio-card-content {
    flex: 1;
    min-width: 0;
}

.portfolio-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-card-role {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 2px;
}

.portfolio-card-year {
    font-size: 12px;
    color: #999;
}

.portfolio-card-arrow {
    flex-shrink: 0;
    color: #ccc;
    margin-left: 12px;
}

.portfolio-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.portfolio-empty .empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.portfolio-empty p {
    margin: 4px 0;
}

.portfolio-empty .empty-hint {
    font-size: 13px;
}

/* Work Image Upload */
.work-image-upload {
    width: 100%;
}

.work-image-preview {
    width: 100%;
    height: 180px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #999;
    background: #fafafa;
    transition: all 0.2s;
    overflow: hidden;
}

.work-image-preview:hover {
    border-color: #667eea;
    color: #667eea;
}

.work-image-preview.has-image {
    border-style: solid;
    border-color: #667eea;
}

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

/* Add Work Modal */
#add-work-modal .modal-content {
    max-width: 400px;
    text-align: left;
}

/* View Work Modal */
.view-work-content {
    max-width: 400px;
    max-height: 85vh;
    padding: 0;
    overflow-y: auto;
}

.view-work-image {
    width: 100%;
    aspect-ratio: 16/9;
    background: #f5f5f5;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    cursor: pointer;
}

.view-work-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.view-work-info {
    padding: 20px;
    padding-top: 24px;
    text-align: left;
}

.view-work-content .modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.view-work-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.view-work-role {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 12px;
}

.view-work-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.view-work-year {
    color: #999;
    font-size: 13px;
}

.view-work-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-top: 8px;
}

.view-work-link:hover {
    text-decoration: underline;
}

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

.view-work-actions .btn {
    flex: 1;
}

/* Полноэкранный просмотр изображения */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox.hidden {
    display: none;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: #ff5252;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #ff1744;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 340px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* Message Actions Modal */
.message-actions-content {
    max-width: 280px;
    padding: 8px;
}

.message-actions-list {
    display: flex;
    flex-direction: column;
}

.message-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
}

.message-action-btn:hover {
    background: #f5f5f5;
}

.message-action-btn.danger {
    color: #ff5252;
}

.message-action-btn.hidden {
    display: none;
}

/* Delete Confirm Modal */
.delete-message-content {
    max-width: 300px;
}

.delete-message-text {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.delete-message-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.delete-message-actions .btn {
    flex: 1;
    padding: 10px 16px;
}

/* Reply Preview */
.reply-preview {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.reply-preview.hidden {
    display: none;
}

.reply-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.reply-preview-line {
    width: 3px;
    height: 36px;
    background: #667eea;
    border-radius: 2px;
    flex-shrink: 0;
}

.reply-preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reply-preview-name {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
}

.reply-preview-text {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.reply-preview-close:hover {
    background: #e0e0e0;
    color: #666;
}

/* Reply Quote in Message */
.message-reply-quote {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    cursor: pointer;
    max-width: 100%;
}

.chat-message.outgoing .message-reply-quote {
    background: rgba(255, 255, 255, 0.15);
}

.reply-quote-line {
    width: 3px;
    background: #667eea;
    border-radius: 2px;
    flex-shrink: 0;
}

.chat-message.outgoing .reply-quote-line {
    background: rgba(255, 255, 255, 0.7);
}

.reply-quote-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.reply-quote-name {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.chat-message.outgoing .reply-quote-name {
    color: rgba(255, 255, 255, 0.9);
}

.reply-quote-text {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-message.outgoing .reply-quote-text {
    color: rgba(255, 255, 255, 0.8);
}

/* Settings Modal */
.settings-modal-content {
    text-align: left;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Language selector */
.language-selector {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.language-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.language-btn:hover {
    background: #eee;
}

.language-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.lang-flag {
    font-weight: 700;
    font-size: 12px;
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.language-btn.active .lang-flag {
    background: rgba(255,255,255,0.2);
}

.lang-name {
    font-size: 14px;
    font-weight: 500;
}

.settings-modal-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.settings-modal-btn:hover,
.settings-modal-btn:active {
    background: #667eea;
    color: white;
}

.settings-modal-btn svg {
    fill: currentColor;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.settings-item:last-child {
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Settings Danger Zone */
.settings-danger-zone {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.btn-danger {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    color: #f44336;
    border: 1px solid #f44336;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #f44336;
    color: white;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Delete Account Modal */
.delete-account-modal-content {
    text-align: center;
    max-width: 360px;
}

.delete-account-icon {
    color: #f44336;
    margin-bottom: 16px;
}

.delete-account-modal-content h3 {
    color: #333;
    margin-bottom: 12px;
}

.delete-account-warning {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.delete-account-list {
    text-align: left;
    background: #fff5f5;
    border-radius: 8px;
    padding: 12px 12px 12px 32px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.delete-account-list li {
    margin-bottom: 6px;
}

.delete-account-list li:last-child {
    margin-bottom: 0;
}

.delete-account-confirm {
    margin-bottom: 20px;
    text-align: left;
}

.delete-account-confirm label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.delete-account-confirm input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    letter-spacing: 2px;
}

.delete-account-confirm input:focus {
    outline: none;
    border-color: #f44336;
}

.delete-account-actions {
    display: flex;
    gap: 12px;
}

.delete-account-actions .btn {
    flex: 1;
    padding: 12px;
}

.delete-account-actions .btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: none;
}

.delete-account-actions .btn-danger {
    background: #f44336;
    color: white;
    border: none;
}

.delete-account-actions .btn-danger:disabled {
    background: #ccc;
}

/* ==================== СТРАНИЦА НАСТРОЕК ==================== */
.settings-page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.settings-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #eee;
}

.settings-page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.settings-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.settings-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.settings-page-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.settings-page-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-page-item:first-of-type {
    padding-top: 0;
}

.settings-item-info {
    flex: 1;
}

.settings-item-title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.settings-item-desc {
    display: block;
    font-size: 13px;
    color: #999;
}

.settings-danger {
    border: 1px solid #ffebee;
}

.settings-danger .settings-section-title {
    color: #f44336;
}

.settings-danger-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    color: #f44336;
    border: 1px solid #f44336;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.settings-danger-btn:hover,
.settings-danger-btn:active {
    background: #f44336;
    color: white;
}

.settings-action-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.settings-action-btn:hover,
.settings-action-btn:active {
    background: #667eea;
    color: white;
}

.settings-action-btn svg {
    fill: currentColor;
}

/* Модальное окно изменения пароля */
.change-password-modal-content {
    width: 90%;
    max-width: 400px;
    padding: 0;
}

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

.change-password-modal-content .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.change-password-modal-content .modal-close {
    width: auto;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
}

.change-password-modal-content .modal-close:hover {
    background: #f0f0f0;
    color: #666;
}

.change-password-form {
    padding: 20px;
}

.change-password-form .form-group {
    margin-bottom: 16px;
}

.change-password-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.change-password-form .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.change-password-form .form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.change-password-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.change-password-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.change-password-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: none;
}

.change-password-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#change-password-message {
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

#change-password-message.error {
    background: #ffebee;
    color: #f44336;
}

#change-password-message.success {
    background: #e8f5e9;
    color: #4caf50;
}

/* ==================== СТРАНИЦА О ПРИЛОЖЕНИИ ==================== */
.about-page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.about-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #eee;
}

.about-page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.about-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    text-align: center;
}

.about-page-logo {
    margin-bottom: 16px;
}

.about-page-logo img {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
}

.about-page-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.about-page-version {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.about-page-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
}

.about-page-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.about-page-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.about-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-features-list li {
    font-size: 14px;
    color: #666;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.about-features-list li:last-child {
    border-bottom: none;
}

.about-features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 600;
}

.help-link-inline {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.help-link-inline:hover {
    text-decoration: underline;
}

.about-contact {
    font-size: 14px;
    color: #667eea;
}

.about-page-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.about-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.about-link:hover {
    color: #5a6fd6;
    text-decoration: underline;
}

.about-page-copyright {
    font-size: 12px;
    color: #999;
    margin-top: 24px;
}

/* Help Modal */
.help-modal-content {
    text-align: left;
}

.help-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-item h4 {
    color: #333;
    margin-bottom: 6px;
    font-size: 15px;
}

.help-item p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* About Modal */
.about-modal-content {
    text-align: center;
}

.about-content {
    padding: 20px 0;
}

.about-logo {
    margin-bottom: 16px;
}

.about-logo img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
}

.about-content h4 {
    font-size: 22px;
    color: #333;
    margin-bottom: 4px;
}

.about-version {
    color: #999;
    font-size: 13px;
    margin-bottom: 16px;
}

.about-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.about-copyright {
    color: #bbb;
    font-size: 12px;
}

.distance-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.distance-option {
    padding: 14px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.distance-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.profession-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.profession-filter-btn {
    padding: 8px 14px;
    border: 2px solid #e1e1e1;
    border-radius: 20px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.profession-filter-btn:hover,
.profession-filter-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-close {
    width: 100%;
    padding: 14px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-reset {
    width: 100%;
    padding: 14px;
    border: none;
    background: #ffebee;
    border-radius: 8px;
    font-size: 16px;
    color: #f44336;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.modal-reset:hover {
    background: #ffcdd2;
}

.modal-reset.hidden {
    display: none;
}

/* Type filter buttons */
.type-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.type-filter-btn {
    padding: 14px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-filter-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.type-filter-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Confirm Modal */
.confirm-modal-content {
    max-width: 300px;
}

.confirm-icon {
    margin-bottom: 16px;
    color: #667eea;
}

.confirm-icon.warning {
    color: #ff9800;
}

.confirm-icon.danger {
    color: #f44336;
}

.confirm-icon.success {
    color: #4caf50;
}

#confirm-title {
    margin-bottom: 8px;
    font-size: 18px;
}

#confirm-message {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.btn-confirm-cancel {
    flex: 1;
    background: #f0f0f0;
    color: #666;
}

.btn-confirm-cancel:hover {
    background: #e0e0e0;
    box-shadow: none;
    transform: none;
}

.btn-confirm-ok {
    flex: 1;
}

.btn-confirm-ok.danger {
    background: #f44336;
}

.btn-confirm-ok.danger:hover {
    background: #d32f2f;
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.4);
}

/* Post Action Modal */
.post-action-modal-content {
    max-width: 300px;
}

/* Модальное окно информации о групповом чате */
.group-chat-info-content {
    max-width: 360px;
    text-align: left;
}

.group-chat-photo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.group-chat-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: white;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}

.group-chat-photo:hover {
    transform: scale(1.05);
}

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

.group-chat-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.group-chat-photo-overlay svg {
    fill: white;
}

.group-chat-photo:hover .group-chat-photo-overlay {
    opacity: 1;
}

.group-chat-edit-section {
    margin-bottom: 16px;
}

.btn-edit-chat-name {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.group-chat-members h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.group-chat-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.group-chat-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.group-chat-member:hover {
    background: #f0f0f0;
}

.group-chat-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.group-chat-member-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.group-chat-member-status {
    font-size: 12px;
    color: #999;
}

.group-chat-member-status.online {
    color: #4caf50;
}

.group-chat-member-role {
    font-size: 12px;
    color: #888;
}

.group-chat-member-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

#post-action-title {
    margin-bottom: 16px;
}

.post-action-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.post-action-btn:hover {
    background: #ebe8fd;
}

.post-action-btn.danger {
    color: #f44336;
}

.post-action-btn.danger:hover {
    background: #ffebee;
}

.post-action-btn svg {
    flex-shrink: 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
}

.toast.warning {
    background: #ff9800;
}

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

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

/* Edit Profile Modal */
.edit-profile-modal-content {
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
}

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

.modal-header h3 {
    margin: 0;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.edit-profile-form .form-group {
    margin-bottom: 16px;
}

/* Avatar upload в редактировании профиля */
.avatar-upload-group {
    margin-bottom: 20px;
}

.avatar-upload-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.avatar-preview span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-text {
    background: none;
    border: none;
    color: #e74c3c;
    padding: 8px 12px;
    cursor: pointer;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Модальное окно кадрирования */
.crop-modal-content {
    max-width: 90vw;
    max-height: 85vh;
    width: 400px;
    overflow: hidden;
}

.crop-container {
    width: 100%;
    height: 300px;
    max-height: 50vh;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    touch-action: none;
}

.crop-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Блокировка скролла body при открытом кроппере */
body.crop-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Фикс для cropper на мобильных */
.cropper-container {
    touch-action: none;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box {
    touch-action: none;
}

.crop-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Круглая область кадрирования */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-view-box {
    outline: none;
    box-shadow: 0 0 0 1px #39f, 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Просмотр аватара на полный экран */
.profile-avatar-small {
    cursor: pointer;
}

.avatar-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-fullscreen.active {
    opacity: 1;
}

.avatar-fullscreen img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-fullscreen-letter {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 80px;
    font-weight: 600;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.input-with-prefix:focus-within {
    border-color: #667eea;
}

.input-prefix {
    padding: 12px 0 12px 15px;
    background: #f5f5f5;
    color: #999;
    font-size: 16px;
    border-right: 1px solid #e1e1e1;
    padding-right: 10px;
}

.input-with-prefix input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 16px;
}

.input-with-prefix input:focus {
    outline: none;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e4fd;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
}

.professions-grid-small {
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
    margin: 8px -4px 0;
}

.professions-grid-small .profession-chip {
    font-size: 12px;
    padding: 6px 10px;
}

/* Профессии - новый селектор с модалкой */
.professions-selector {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
}

.selected-professions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 30px;
}

.selected-profession-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.selected-profession-tag .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.selected-profession-tag .remove-btn:hover {
    background: rgba(255,255,255,0.5);
}

.add-profession-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 2px dashed #ccc;
    background: white;
    border-radius: 10px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-profession-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Модалка выбора профессий */
.profession-modal-content {
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.profession-search {
    padding: 0 16px 16px;
}

.profession-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.profession-search input:focus {
    border-color: #667eea;
}

.profession-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.profession-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.profession-list-item:hover {
    background: #f0f0f0;
}

.profession-list-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
}

.profession-list-item .name {
    font-size: 15px;
    color: #333;
}

.profession-list-item .add-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    border-radius: 50%;
    color: white;
}

.profession-list-item.selected .add-icon {
    background: #4caf50;
}

/* ==================== ЧАТЫ ==================== */

/* Бейдж непрочитанных в навигации */
.nav-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    background: #f44336;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.nav-badge.hidden {
    display: none;
}

/* Список чатов */
.chats-list {
    padding: 0;
}

.chats-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.chats-empty p {
    margin-bottom: 8px;
}

.chats-empty-hint {
    font-size: 14px;
    color: #bbb;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.chat-item:hover {
    background: #f9f9f9;
}

.chat-item:first-child {
    border-radius: 12px 12px 0 0;
}

.chat-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.chat-item:only-child {
    border-radius: 12px;
}

.chat-item-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.chat-item-avatar.project-chat-avatar {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    font-size: 24px;
}

.chat-item-avatar.support-chat-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 24px;
}

/* Индикатор онлайн в списке чатов */
.chat-item-avatar-wrapper {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.online-indicator.offline {
    background: #9e9e9e;
}

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

.chat-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-item-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.chat-item-time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.chat-item-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-item-message {
    flex: 1;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-message.unread {
    color: #333;
    font-weight: 500;
}

.chat-item-unread {
    min-width: 20px;
    height: 20px;
    background: #667eea;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Экран чата */
.chat-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f5f5f5;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

@media (min-width: 480px) {
    .chat-view {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
    }
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    flex-shrink: 0;
    z-index: 10;
}

.chat-back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-back-btn:hover {
    background: #f0f0f0;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    overflow: hidden;
}

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

.chat-header-info {
    flex: 1;
}

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

.chat-header-status {
    font-size: 13px;
    color: #999;
}

.chat-header-status.online {
    color: #4caf50;
}

.chat-header-status:empty {
    display: none;
}

.chat-menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-menu-btn:hover {
    background: #f0f0f0;
}

/* Сообщения */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.chat-message {
    width: 100%;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
}

/* Исходящие сообщения - контент справа */
.chat-message.outgoing {
    justify-content: flex-end;
}

/* Входящие сообщения - контент слева */
.chat-message.incoming {
    justify-content: flex-start;
    gap: 8px;
}

.chat-message:hover .chat-message-content {
    filter: brightness(0.97);
}

/* Индикатор свайпа для ответа */
.swipe-reply-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Иконка слева для исходящих */
.chat-message.outgoing .swipe-reply-icon {
    left: 16px;
}

/* Иконка справа для входящих */
.chat-message.incoming .swipe-reply-icon {
    right: 16px;
}

.chat-message.incoming .swipe-reply-icon svg {
    transform: scaleX(-1);
}

.chat-message.swiping .swipe-reply-icon {
    transform: translateY(-50%) scale(1);
}

.chat-message.swiping .chat-message-content {
    box-shadow: 0 0 0 2px #667eea;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
}

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

.chat-message-avatar.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-message-avatar.clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.chat-message-content {
    padding: 10px 14px;
    border-radius: 18px;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    min-width: 0;
    max-width: 80%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.chat-message.incoming .chat-message-content {
    max-width: calc(80% - 40px); /* Ограничиваем ширину контента (минус аватар) */
}

.chat-message.outgoing .chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.chat-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-sender-name-link {
    cursor: pointer;
    transition: opacity 0.2s;
}

.chat-sender-name-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.chat-message-role {
    font-size: 10px;
    font-weight: 500;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 8px;
}

/* Карточки заметок/проектов в чате */
.chat-shared-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 12px;
    cursor: pointer;
    margin: 4px 0;
}

.chat-message.outgoing .chat-shared-card {
    background: rgba(255,255,255,0.2);
}

.chat-shared-icon {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-shared-icon svg {
    fill: white;
}

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

.chat-shared-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.chat-shared-desc {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-shared-owner {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Карточка приглашения в проект */
.chat-invite-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 14px;
    color: white;
    min-width: 220px;
}

.invite-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.invite-header svg {
    flex-shrink: 0;
}

.invite-project-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.invite-role {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.invite-status {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
}

.invite-status.accepted {
    background: rgba(76, 175, 80, 0.3);
}

.invite-status.declined {
    background: rgba(244, 67, 54, 0.3);
}

.invite-status.expired {
    background: rgba(255, 152, 0, 0.3);
}

.invite-status.pending {
    background: rgba(255, 255, 255, 0.2);
}

.invite-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.invite-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.invite-btn.accept {
    background: white;
    color: #667eea;
}

.invite-btn.accept:hover {
    background: #f0f0f0;
}

.invite-btn.decline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.invite-btn.decline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Список чатов для шаринга */
.share-chat-list {
    max-height: 400px;
    overflow-y: auto;
}

.share-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.share-chat-item:hover {
    background: #f5f5f5;
}

.share-chat-item:last-child {
    border-bottom: none;
}

.share-chat-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}

.share-chat-name {
    font-size: 15px;
    font-weight: 500;
}

/* Просмотр заметки/проекта из чата */
.view-shared-content {
    max-height: 80vh;
    overflow-y: auto;
}

.shared-note-author {
    font-size: 13px;
    color: #666;
    margin: -8px 0 8px;
    padding: 0 16px;
}

.shared-note-body,
.shared-project-body {
    padding: 16px;
}

.shared-note-text {
    white-space: pre-wrap;
    line-height: 1.6;
    margin-bottom: 16px;
}

.shared-note-checklist h4,
.shared-project-roles h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.shared-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.shared-checklist-item.done {
    color: #888;
    text-decoration: line-through;
}

.shared-checklist-item .check-icon {
    color: #667eea;
}

.shared-project-desc {
    margin-bottom: 12px;
    line-height: 1.5;
}

.shared-role-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.shared-role-item:last-child {
    border-bottom: none;
}

.role-name {
    font-weight: 500;
}

.role-vacant {
    color: #f44;
    font-size: 12px;
}

.chat-message.outgoing {
    align-self: flex-end;
}

.chat-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-message.incoming .chat-message-time {
    text-align: left;
}

.chat-message-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
    margin-top: 2px;
}

.chat-message-status.read {
    color: rgba(255, 255, 255, 0.9);
}

.chat-date-separator {
    text-align: center;
    padding: 16px 0;
}

.chat-date-separator span {
    background: #e0e0e0;
    color: #666;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Кнопка загрузки старых сообщений */
.chat-load-more {
    text-align: center;
    padding: 12px 16px;
}

.btn-load-more {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-load-more:active {
    background: #eee;
}

/* Индикатор печати */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #999;
}

.chat-typing-indicator.hidden {
    display: none;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Поле ввода */
.chat-input-area {
    background: white;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chat-input-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 24px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.chat-input-form input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn svg {
    margin-left: 2px;
}

/* Пустой чат */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    padding: 40px;
    text-align: center;
}

.chat-empty-icon {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.chat-empty-icon svg {
    width: 40px;
    height: 40px;
    color: #ccc;
}

/* ==================== ПРОЕКТЫ ==================== */

/* Страница списка проектов */
.projects-container {
    padding: 0;
}

.projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.projects-header h2 {
    margin: 0;
    font-size: 18px;
}

.projects-tabs {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.projects-list {
    padding: 16px;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.project-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-role-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.project-role-badge.organizer {
    background: #e3f2fd;
    color: #1976d2;
}

.project-role-badge.invited {
    background: #fff3e0;
    color: #f57c00;
}

.project-card-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.project-card-status.active {
    background: #e8f5e9;
    color: #4caf50;
}

.project-card-status.completed {
    background: #f5f5f5;
    color: #999;
}

.project-card-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #999;
}

.project-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-card-meta svg {
    width: 14px;
    height: 14px;
}

.project-card-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.role-tag {
    font-size: 11px;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
}

.role-tag.needed {
    background: #fff3e0;
    color: #ff9800;
}

.role-tag.filled {
    background: #e8f5e9;
    color: #4caf50;
}

.projects-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.projects-empty .empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.projects-empty p {
    margin: 4px 0;
}

.projects-empty .empty-hint {
    font-size: 13px;
}

/* Детали проекта */
.project-detail-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.project-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.project-detail-header h2 {
    margin: 0;
    font-size: 18px;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

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

.project-detail-content {
    padding: 16px;
    flex: 1;
}

.project-info-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.project-status-badge {
    display: inline-block;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 12px;
}

.project-status-badge.active {
    background: #e8f5e9;
    color: #4caf50;
}

.project-status-badge.completed {
    background: #f5f5f5;
    color: #999;
}

.project-description {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 16px;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.meta-item svg {
    color: #999;
}

.project-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.project-section h3 {
    font-size: 16px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-count {
    font-size: 13px;
    font-weight: normal;
    color: #999;
}

.team-roles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-role-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: background 0.2s;
}

.team-role-item.clickable {
    cursor: pointer;
}

.team-role-item.clickable:hover {
    background: #f0f0f0;
}

.team-role-item.clickable:active {
    background: #e8e8e8;
}

.team-role-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-role-status.needed {
    background: #fff3e0;
    color: #ff9800;
}

.team-role-status.filled {
    background: #e8f5e9;
    color: #4caf50;
}

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

.team-role-profession {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.team-role-person {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.team-role-note {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.team-role-actions {
    display: flex;
    gap: 8px;
}

.team-role-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.team-role-btn:hover {
    background: #667eea;
    color: white;
}

.team-role-btn.danger:hover {
    background: #f44336;
}

.btn-add-role {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.equipment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.equipment-item {
    padding: 8px 14px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
}

.equipment-empty {
    color: #999;
    font-size: 14px;
}

.project-organizer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 8px;
}

.organizer-label {
    color: #999;
}

.organizer-name {
    color: #667eea;
    font-weight: 500;
}

.organizer-name.clickable {
    cursor: pointer;
}

.organizer-name.clickable:hover {
    text-decoration: underline;
}

.project-actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-chat-project {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
}

.btn-leave-project {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #ff5252;
    color: white;
}

.btn-leave-project:hover {
    background: #ff1744;
}

/* Модальное окно проекта */
.project-modal-content {
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.roles-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.roles-input-container select {
    flex: 1;
    min-width: 0;
}

.roles-input-container .btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.btn-small {
    padding: 10px 16px;
    min-width: auto;
}

.selected-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.selected-role-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
}

.selected-role-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.selected-role-tag button:hover {
    opacity: 1;
}

/* Меню проекта */
.menu-modal-content {
    max-width: 300px;
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    color: #333;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item-danger {
    color: #f44336;
}

.menu-item-danger:hover {
    background: #ffebee;
}

/* ==================== ЗАМЕТКИ ==================== */

/* Страница списка заметок */
.notes-container {
    padding: 0;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.notes-header h2 {
    margin: 0;
    font-size: 18px;
}

.notes-list {
    padding: 16px;
}

.note-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.note-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.note-card-icons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.note-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-card-icon.text {
    background: #e3f2fd;
    color: #2196f3;
}

.note-card-icon.checklist {
    background: #e8f5e9;
    color: #4caf50;
}

.note-card-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-preview {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.note-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

.note-card-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar {
    width: 60px;
    height: 4px;
    background: #e1e1e1;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s;
}

.notes-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.notes-empty .empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.notes-empty p {
    margin: 4px 0;
}

.notes-empty .empty-hint {
    font-size: 13px;
}

/* Страница редактирования заметки */
.note-edit-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-edit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
}

.note-title-input {
    flex: 1;
    border: none;
    font-size: 18px;
    font-weight: 600;
    padding: 8px 0;
    outline: none;
    background: transparent;
}

.note-title-input::placeholder {
    color: #bbb;
    font-weight: normal;
}

/* Скрываем переключатель типов - теперь текст и чеклист показываются вместе */
.note-type-switch {
    display: none;
}

.type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.type-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.note-content-area {
    flex: 1;
    padding: 16px;
    background: #f9f9f9;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.note-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.note-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-text-content {
    width: 100%;
    min-height: 150px;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.note-text-content::placeholder {
    color: #bbb;
}

.note-checklist {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.checklist-items {
    margin-bottom: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checklist-checkbox.checked {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.checklist-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.checklist-item.completed .checklist-text {
    text-decoration: line-through;
    color: #999;
}

.checklist-delete {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: all 0.2s;
    opacity: 0;
}

.checklist-item:hover .checklist-delete {
    opacity: 1;
}

.checklist-delete:hover {
    background: #ffebee;
    color: #f44336;
}

.checklist-add {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.checklist-add input {
    flex: 1;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.checklist-add input:focus {
    border-color: #667eea;
}

.note-edit-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #e1e1e1;
}

.note-edit-footer .btn {
    width: 100%;
}

/* ==================== ПРОСМОТР ПРОФИЛЯ ПОЛЬЗОВАТЕЛЯ ==================== */

.user-profile-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.user-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e1e1e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-profile-header h2 {
    margin: 0;
    font-size: 18px;
}

.user-profile-content {
    padding: 16px;
    flex: 1;
    overflow-x: hidden;
}

.user-profile-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.user-profile-name-row .user-profile-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.user-profile-name-row .user-profile-username {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.user-profile-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.user-profile-location-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.user-profile-location-status .user-profile-location {
    color: #888;
    font-size: 13px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-profile-location-status .user-profile-availability {
    margin: 0;
}

.user-profile-avatar {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

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

.user-profile-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.user-profile-username {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.user-profile-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #888;
    margin: 0;
}

.user-profile-availability {
    display: none;
}

.user-profile-availability.visible {
    display: flex;
}

.user-profile-professions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.user-profile-professions .profession-chip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: default;
}

.user-profile-skills {
    display: none;
    margin-bottom: 24px;
}

.user-profile-skills.visible {
    display: block;
}

.user-profile-skills .profile-skills-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.user-profile-skills .profile-skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.user-profile-about {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.user-profile-about h3 {
    font-size: 14px;
    color: #999;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.user-profile-about p {
    font-size: 15px;
    color: #333;
    margin: 0;
    line-height: 1.5;
}

.user-profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-profile-actions .btn {
    flex: 1 1 auto;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.user-profile-actions .btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

@media (max-width: 360px) {
    .user-profile-actions {
        flex-direction: column;
    }

    .user-profile-actions .btn {
        width: 100%;
    }
}

/* Объявления пользователя в профиле */
.user-profile-posts {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.user-profile-posts h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.user-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-post-card {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-post-card:hover {
    background: #f0f0f0;
}

.user-post-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.user-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.user-post-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.user-post-type.search {
    background: #e3f2fd;
    color: #1976d2;
}

.user-post-type.offer {
    background: #e8f5e9;
    color: #388e3c;
}

.user-posts-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* Кликабельные аватар и имя в постах */
.post-avatar.clickable,
.post-author-name.clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-avatar.clickable:hover {
    opacity: 0.8;
}

.post-author-name.clickable:hover {
    color: #667eea;
}

/* Кликабельный заголовок чата */
.chat-header-info.clickable {
    cursor: pointer;
}

.chat-header-info.clickable:hover .chat-header-name {
    color: #667eea;
}

/* Add to Project Modal */
.add-to-project-modal-content {
    max-width: 380px;
    text-align: left;
}

.add-to-project-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
}

.add-to-project-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
    flex-shrink: 0;
}

.add-to-project-user-info {
    flex: 1;
    min-width: 0;
}

.add-to-project-user-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.add-to-project-user-prof {
    font-size: 13px;
    color: #666;
}

.add-to-project-step {
    margin-top: 8px;
}

.add-to-project-step.hidden {
    display: none;
}

.step-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Project Select List */
.project-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.project-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-select-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.project-select-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

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

.project-select-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.project-select-meta {
    font-size: 12px;
    color: #999;
}

.project-select-empty,
.role-select-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

.project-select-empty.hidden,
.role-select-empty.hidden {
    display: none;
}

.project-select-empty p,
.role-select-empty p {
    margin-bottom: 12px;
}

/* Role Select List */
.role-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.role-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-select-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.role-select-item.filled {
    opacity: 0.5;
    cursor: not-allowed;
}

.role-select-item.filled:hover {
    border-color: #e1e1e1;
    background: white;
}

.role-select-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.role-select-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
}

.role-select-status.needed {
    background: #fff3e0;
    color: #f57c00;
}

.role-select-status.filled {
    background: #e8f5e9;
    color: #4caf50;
}

/* ==================== ПОДПИСКИ ==================== */

/* Кликабельные stat-item */
.stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
    border-radius: 8px;
    margin: -8px;
}

.stat-item.clickable:hover {
    background: rgba(102, 126, 234, 0.1);
}

.stat-item.clickable:active {
    transform: scale(0.95);
}

/* User Profile Stats */
.user-profile-stats {
    display: flex;
    justify-content: space-around;
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.user-stat-item {
    text-align: center;
    min-width: 0;
}

.user-stat-item.clickable {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-stat-item.clickable:hover {
    background: rgba(102, 126, 234, 0.1);
}

.user-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.user-stat-label {
    font-size: 11px;
    color: #999;
}

/* Follow Button */
.btn-follow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    margin: 12px 0 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-follow:not(.following) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-follow.following {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-follow.following:hover {
    background: #fff0f0;
    color: #f44336;
    border-color: #f44336;
}

.btn-follow svg.hidden {
    display: none;
}

/* Follow List Page */
.follow-list-container {
    padding: 0 16px 16px;
}

.follow-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
}

.follow-list-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.follow-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.follow-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.follow-list-empty.hidden {
    display: none;
}

.follow-list-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.follow-list-empty p {
    font-size: 15px;
}

/* Follow Card */
.follow-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.follow-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

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

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

.follow-card-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.follow-card-username {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 2px;
}

.follow-card-profession {
    font-size: 12px;
    color: #999;
}

.follow-card-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.follow-card-btn.follow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.follow-card-btn.following {
    background: white;
    color: #666;
    border: 2px solid #e1e1e1;
}

.follow-card-btn.following:hover {
    border-color: #f44336;
    color: #f44336;
}

/* User Posts Page */
#page-user-posts {
    overflow-y: auto;
    height: 100%;
}

.user-posts-container {
    padding: 0 16px 16px;
    min-height: 100%;
}

.user-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
}

.user-posts-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.user-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-posts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.user-posts-empty.hidden {
    display: none;
}

.user-posts-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.user-posts-empty p {
    font-size: 15px;
}

/* Мобильные стили для сообщений в чате */
@media (max-width: 480px) {
    .chat-message-content {
        max-width: 85%;
    }

    .chat-message.incoming .chat-message-content {
        max-width: calc(85% - 40px);
    }
}
