body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f4f4f4;
}
.form-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
input, button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
}
button {
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.chat-header {
    text-align: center;
    margin-bottom: 20px;
}
.chat-list {
    list-style: none;
    padding: 0;
}
.chat-item {
    background: #e0e0e0;
    margin: 10px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}
.chat-item:hover {
    background: #d4d4d4;
}

.chat-room {
    max-width: 600px;
    margin: 20px auto;
}
.back-btn {
    margin-bottom: 10px;
    padding: 5px 10px;
    background: #ccc;
    border: none;
    cursor: pointer;
}
.messages {
    border: 1px solid #ccc;
    padding: 10px;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msg {
    padding: 8px;
    margin: 5px 0;
    border-radius: 6px;
    max-width: 70%;
    word-wrap: break-word;
}
.own {
    background: #a8dadc;
    align-self: flex-end;
    text-align: right;
}
.other {
    background: #f1faee;
    align-self: flex-start;
}
.msg img, .msg video {
    max-width: 100%;
    margin-top: 6px;
    border-radius: 8px;
}
.msg a {
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
    word-break: break-word;
}
.msg a:hover {
    text-decoration: underline;
}
.msg button {
    margin-left: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
}

form {
    display: flex;
    gap: 8px;
}
input[type="text"] {
    flex: 1;
}
.file-btn {
    cursor: pointer;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #eee;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    border-top: 1px solid #ccc;
}
.bottom-nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    margin: 0 20px;
    padding: 5px 15px;
    border-radius: 20px;
    transition: background-color 0.3s;
}
.bottom-nav a:hover {
    background-color: #ddd;
}
.center {
    text-align: center;
    margin: 20px 0;
}

/* Стили для профиля */
.profile-header {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.profile-header h1 {
    margin: 20px 0;
    color: #333;
    font-size: 28px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

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

.stat-item strong {
    display: block;
    font-size: 24px;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-item span {
    color: #666;
    font-size: 14px;
}

/* Стили для поиска */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e1e1e1;
    border-radius: 25px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    color: #333;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2);
}

.search-input::placeholder {
    color: #999;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.search-result-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.search-result-item .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #007bff, #00bfff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.search-result-item .username {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.search-loading,
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 15px;
    background: #f8f9fa;
    border-radius: 15px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Стили для постов */
.posts {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.post {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

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

.post-content {
    padding: 20px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.post-media {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

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

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

.post-actions button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.post-actions button:hover {
    background: #f0f0f0;
}
