/* profile.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600&display=swap');

/* Основной контейнер шапки профиля */
.profile-header {
    position: relative;
    width: 100%;
    height: 350px; /* 250px баннер + 125px для половины аватара */
    margin-bottom: 50px;
}

/* Баннер профиля */
.profile-banner {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 250px; /* Фиксированная высота для всех экранов */
    /* Можно заменить на фоновое изображение:
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    */
    background-image: url('../img/collage.svg');
    background-size: 120% auto;
    background-position: top center;
    
    z-index: 1;
}

/* Контент шапки профиля */
.profile-header-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-start;
    padding-top: 250px; /* Фиксированный отступ для всех экранов */
    padding-left: 46px;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    width: 90%;
}

/* Аватар */
.profile-avatar-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 5px solid #f0f0f0; /* вместо белого – мягкий серый stroke */
    flex-shrink: 0;
    margin-right: 20px; /* отступ текста от аватарки */
    position: relative;
    z-index: 3;
    margin-top: -100px; /* Фиксированный отступ для всех экранов */
}

/* Контейнер шапки профиля */
.profile-header-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap; /* Позволяет элементам переноситься на новую строку */
}

/* Основная информация профиля */
.profile-main-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: white;
    flex: 1 1 auto; /* Позволяет растягиваться и сжиматься */
    min-width: 0; /* Важно для правильной работы flex */
    margin-top: 12px;
}

/* Имя пользователя */
.profile-username {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: white;
    margin: 0;
}

/* Уровень и класс */
.profile-level-info {
    margin-top: 8px;
}

.profile-level-text {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.morale-bar-container {
    width: 200px;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    align-self: flex-start; /* Выравнивание по верху */
    margin-top: 16px;
    margin-right: 20px;
}

.morale-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(127, 100, 140, 1) 0%, rgba(83, 8, 158, 1) 100%);
    border-radius: 8px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

.morale-bar-text {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .morale-bar-container {
        margin-left: 0;
        width: 100%;
        max-width: 200px;
    }
}



/* Контент профиля */
.profile-content {
    padding: 20px 0;
    min-height: 500px;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .profile-header-content {
        padding-left: 40px;
        width: 95%;
    }
    
    .profile-avatar-large {
        width: 180px;
        height: 180px;
        margin-right: 18px;
        /* margin-top остается -100px */
    }
    
    .profile-username {
        font-size: 22px;
    }
    
    .profile-level-text {
        font-size: 16px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-left: 20px;
        padding-right: 20px;
        width: 100%;
    }
    
    .profile-avatar-large {
        width: 150px;
        height: 150px;
        margin-right: 0;
        /* margin-top остается -100px */
    }
    
    .profile-main-info {
        align-items: center;
        /* margin-top остается 16px */
    }
    
    .profile-username {
        font-size: 20px;
    }
    
    .profile-level-text {
        font-size: 16px;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .profile-header-content {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .profile-avatar-large {
        width: 120px;
        height: 120px;
        border-width: 3px;
        /* margin-top остается -100px */
    }
    
    .profile-username {
        font-size: 18px;
    }
    
    .profile-level-text {
        font-size: 14px;
    }
}


/* Стили для блока создания поста */
.post-composer {
    width: 100%;
    max-width: 1200px;
    min-width: 600px;
    margin: 0 auto;
    background-color: transparent;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}


.post-header {
    display: flex;
    align-items: top;
    margin-bottom: 12px;
}

.post-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    margin-right: 16px;
}

.post-user-info {
    display: flex;
    align-items: baseline; /* вместо center */
    gap: 12px;
    flex: 1;
    min-width: 0;
}


.post-username {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.post-user-details {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: white;
    white-space: nowrap;
}

/* Исправления для .post-text-area */
.post-text-area {
    width: calc(100% - 80px - 52px); /* 80px = отступ слева, 52px = отступ справа */
    min-height: 60px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.5;
    color: white;
    background: transparent;
    padding: 0;
    margin-top: -36px;
    margin-left: 80px; /* оставляем для позиционирования */
    margin-right: 52px; /* можно убрать, так как ширина уже учитывает правый отступ */
    overflow-y: auto;
    word-wrap: break-word;
    box-sizing: border-box;
    transition: height 0.1s ease;
}




.post-text-area::placeholder {
    color: white;
}

.post-footer {
    position: relative;
    margin-top: 12px;
    height: 48px;
}

.post-char-counter {
    position: absolute;
    bottom: 24px;
    left: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #666;
}

.post-char-counter.warning {
    color: #ff9800;
}

.post-char-counter.danger {
    color: #f44336;
}

.post-share-btn {
    position: absolute;
    bottom: 24px;
    right: 52px;
    background: #2C2C2C;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.post-share-btn:hover {
    background: #363636;
    transition: all 500ms ease;
}

.post-share-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .post-composer {
        width: 100%;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .post-composer {
        min-width: 320px;
        padding: 16px;
        width: 100%;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-left: 80px;
        margin-top: -50px;
    }
    
    .post-share-btn {
        right: 20px;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .post-composer {
        padding: 12px;
    }
    
    .post-avatar {
        width: 48px;
        height: 48px;
    }
    
    .post-user-info {
        margin-left: 64px;
        margin-top: -36px;
    }
    
    .post-username {
        font-size: 14px;
    }
    
    .post-user-details {
        font-size: 11px;
    }
}

/*Стили для кнопок модерации*/

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.icon-button:hover {
    background-color: #f5f5f5;
}

.icon-button:hover img {
    opacity: 0.7;
}

.icon-button img {
    transition: opacity 0.2s ease;
}

/* Стили для popup редактирования */
.edit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.edit-popup-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.edit-popup-content {
    background: #2C2C2C;
    color: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.edit-popup-content h3 {
    margin: 0 0 16px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 500;
}

.edit-textarea {
    width: 100%;
    min-height: 200px;
    background: #3C3C3C;
    color: white;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    resize: vertical;
    box-sizing: border-box;
}

.edit-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.edit-char-counter {
    font-size: 12px;
    color: #666;
    margin: 8px 0 16px 0;
}

.edit-char-counter.warning {
    color: #ff9800;
}

.edit-char-counter.danger {
    color: #f44336;
}

.edit-popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.edit-approve-btn, .edit-cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.edit-approve-btn {
    background: #27ae60;
    color: white;
}

.edit-approve-btn:hover:not(:disabled) {
    background: #229954;
}

.edit-approve-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.edit-cancel-btn {
    background: #666;
    color: white;
}

.edit-cancel-btn:hover {
    background: #777;
}

/* Ссылки имени и класса в постах */
.post-username-link {
  font-family: 'Roboto', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.post-username-link:hover {
  color: #cfcfcf; /* чуть светлее при наведении */
}

.post-class-link {
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.post-class-link:hover {
  color: #dcdcdc;
}


