/* Глобальные стили */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* Шапка */
header {
    background-color: #1f1f1f;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Логотип – изображение */
header .logo img {
    height: 40px;
    width: auto;
    transition: opacity 0.2s;
}
header .logo img:hover {
    opacity: 0.8;
}

/* Навигация */
nav a {
    color: #ffffff;
    margin-left: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
nav a:hover {
    color: #cccccc;
}

/* Основной контент */
main {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Блок создания поста */
.create-post {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid #2c2c2c;
}
.create-post h3 {
    margin-top: 0;
    color: #ffffff;
}
.create-post textarea {
    width: 100%;
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}
.create-post textarea:focus {
    outline: none;
    border-color: #ffffff;
}
.create-post input[type="file"] {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 15px;
    width: 100%;
}
.create-post button {
    background-color: #ffffff;
    color: #121212;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.create-post button:hover {
    background-color: #dddddd;
}

/* Посты */
.post {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #2c2c2c;
    transition: transform 0.1s;
}
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #ffffff;
}
.post-header a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}
.post-header a:hover {
    text-decoration: underline;
}
.post-header small {
    margin-left: auto;
    color: #888;
}
.post-content p {
    line-height: 1.5;
    margin: 0 0 10px 0;
}
.post-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* Профиль */
.profile {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #2c2c2c;
}
.avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    margin-bottom: 15px;
}
.profile-avatar {
    text-align: center;
    margin-bottom: 20px;
}
.avatar-upload {
    margin-top: 15px;
}
.avatar-upload form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.avatar-upload input[type="file"] {
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px;
    color: #e0e0e0;
    width: auto;
}
.avatar-upload button {
    background-color: #ffffff;
    color: #121212;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
.avatar-upload button:hover {
    background-color: #dddddd;
}

/* Кнопки */
.button {
    display: inline-block;
    background-color: #ffffff;
    color: #121212;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}
.button:hover {
    background-color: #dddddd;
}
.friend-actions {
    margin: 20px 0;
}

/* Таблицы (для админки) */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1e1e1e;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    border: 1px solid #2c2c2c;
    padding: 10px;
    text-align: left;
}
th {
    background-color: #2c2c2c;
    color: #ffffff;
}
tr:hover {
    background-color: #2a2a2a;
}

/* Формы авторизации */
.container {
    max-width: 400px;
    margin: 80px auto;
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #2c2c2c;
}
.container h1 {
    color: #ffffff;
    margin-bottom: 10px;
}
.container .logo {
    margin-bottom: 20px;
}
.container .logo img {
    height: 60px;
    width: auto;
}
input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    box-sizing: border-box;
}
input:focus, textarea:focus {
    outline: none;
    border-color: #ffffff;
}
button {
    background-color: #ffffff;
    color: #121212;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 16px;
}
button:hover {
    background-color: #dddddd;
}
.errors, .error {
    background-color: #330000;
    color: #ff8888;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}
a {
    color: #ffffff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.comments {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #2c2c2c;
}
.comments h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #ffffff;
}
.comment {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 10px;
}
.avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ffffff;
}
.comment-header a {
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
}
.comment-header a:hover {
    text-decoration: underline;
}
.comment-header small {
    color: #888;
    font-size: 11px;
}
.comment-content {
    color: #e0e0e0;
    font-size: 13px;
    margin-left: 40px;
}
.comment-form {
    margin-top: 10px;
}
.comment-form textarea {
    width: 100%;
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    resize: vertical;
    margin-bottom: 5px;
}
.comment-form textarea:focus {
    outline: none;
    border-color: #ffffff;
}
.comment-form button {
    background-color: #ffffff;
    color: #121212;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    width: auto;
}
.comment-form button:hover {
    background-color: #dddddd;
}
.post-actions {
    margin-top: 10px;
    padding-top: 5px;
}
.like-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background 0.2s;
}
.like-btn:hover {
    background: #2c2c2c;
}
.like-btn.liked {
    color: #ff4444;
}
.admin-badge {
    vertical-align: middle;
}