/* Современный стиль для страницы профиля пользователя */

/* Основной контейнер профиля */
.profile-container {
    background-color: #f5f7fa;
    border-radius: 10px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 30px;
    width: 100%;
}

.profile-container>.profile-content {
    margin-bottom: 0px;
}

/* Обложка профиля - важно убедиться, что у нее прописана высота и фон */
.profile-cover {
    position: relative;
    height: 200px;
    background-color: #3498db;
    background-image: linear-gradient(135deg, #3498db 0%, #8e44ad 100%);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* Если есть конкретное изображение, подставляем его поверх градиента */
.profile-cover.with-image {
    background-image: var(--cover-image);
}

/* Аватар пользователя */
.profile-avatar {
    position: relative;
    margin: -50px auto 10px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #fff;
    /* padding: 4px; */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
    text-align: center;
}

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

/* Имя пользователя */
.profile-name {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin: 5px 0;
    color: #333;
}

/* Статус онлайн/оффлайн - важно для отображения индикатора */
.user-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    font-size: 14px;
    color: #6c757d;
    gap: 5px;
    flex-direction: column;
    max-width: 200px;
    margin: 0 auto;
}

.user-status-main {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-status-main::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.user-status.online .user-status-main::before {
    background-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.user-status.offline .user-status-main::before {
    background-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.last-seen {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 3px;
    text-align: center;
}

/* Статус пользователя */
.user-custom-status {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    /* margin-bottom: 15px; */
    margin: 10px 0;
    padding: 0 20px;
}

.user-custom-status-edit {
    margin-left: 5px;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-custom-status-edit:hover {
    opacity: 1;
}

/* Форма редактирования статуса */
.status-edit-form {
    display: none;
    margin-top: 5px;
}

.status-edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.update_status,
.cancel_status {
    background: none;
    border: 1px solid #ddd;
    cursor: pointer;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.update_status {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.update_status:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

.cancel_status {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.cancel_status:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.status-input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
    font-size: 13px;
}

.status-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Двухколоночный макет профиля - важно установить правильные пропорции */
.profile-content {
    display: flex;
    flex-wrap: wrap;
    width: 100%;

}

.profile-left-column {
    width: 250px;
    padding: 0;
    background-color: #f5f7fa;
    border-right: 0 solid #e9ecef;
}

.profile-right-column {
    flex: 1;
    min-width: 300px;
    padding: 0;
}

/* Стили для кнопок действий */
.profile-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	margin: 15px 0;
	justify-content: center;
    /* Центрируем кнопки */
}

.button-primary,
.button-admin {
    display: inline-block;
    padding: 4px 8px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    /* width: 100%; */
    box-sizing: border-box;
    /* Учитываем padding в ширине */
}

.button-primary {
    background-color: #3498db;
    color: white;
}

.button-admin {
    background-color: #9b59b6;
    color: white;
}

.button-primary:hover {
    background-color: #2980b9;
}

.button-admin:hover {
    background-color: #8e44ad;
    color: white;
}

/* Стили для социальных ссылок */
.social-links {
    display: flex;
    justify-content: center;
    margin: 0;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    transition: transform 0.2s, background-color 0.2s;
}

.social-link:hover {
    position: relative; top: -3px;
}

.social-link.facebook {
    background-color: #3b5998;
}

.social-link.instagram {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}

.social-link.linkedin {
    background-color: #0077b5;
}

/* Стили для вкладок */
.profile-tabs {
    margin-bottom: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.tabs-navigation {
		display: flex;
		gap: 2px;
		margin-left: 10px;
		border-radius: 8px 0;
}

.tab-link {
    padding: 15px 20px;
    display: inline-block;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.tab-link:hover {
    color: #3498db;
}

.tab-link.active {
    color: #3498db;
    font-weight: 600;
}

.tab-link.active:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #3498db;
    border-radius: 3px 3px 0 0;
}

.tab-link .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #3498db;
    color: white;
    height: 20px;
    min-width: 20px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 5px;
    padding: 0 6px;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.tab-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.tab-description {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Стили для вкладки модерации */
.moderation-articles-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

.moderation-article-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 15px;
    border-left: 4px solid #f39c12;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.moderation-article-card:hover {
    position: relative; top: -3px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.article-title {
    flex: auto;
    margin: 0 15px 0 0;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.article-title a:hover {
    color: #3498db;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.pending {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.rejected {
    background: linear-gradient(135deg, #f8d7da, #ff6b6b);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.article-meta-info {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.meta-value {
    font-size: 14px;
}

.type-published {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-draft {
    background: #e2e3e5;
    color: #383d41;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-pending {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-rejected {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.rejection-feedback {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.rejection-feedback::before {
    content: "⚠️";
    position: absolute;
    top: -8px;
    left: 20px;
    background: white;
    padding: 0 8px;
    font-size: 16px;
}

.feedback-header {
    color: #856404;
    margin-bottom: 10px;
    font-weight: 600;
}

.feedback-content {
    color: #6c757d;
    line-height: 1.6;
    font-size: 14px;
}

.article-preview {
    margin-bottom: 25px;
}

.preview-text {
    color: #6c757d;
    line-height: 1.6;
    font-size: 14px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
}

.article-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    position: relative; top: -2px;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    color: white;
}

.btn-resubmit {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-resubmit:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    position: relative; top: -2px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    color: white;
}

.waiting-indicator {
    color: #f39c12;
    font-style: italic;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 20px;
}

.empty-state p {
    margin-bottom: 25px;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 24px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    position: relative; top: -2px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Стили для статистики пользователя */
.user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    border-radius: 4px;
    padding: 2px;
    padding: 8px 0;
    max-width: 100%;
    box-sizing: border-box;
}

.stats-item {
    text-align: center;
    padding: 10px 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    min-width: 0;
    overflow: hidden;
    height: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 65px;
    max-height: 65px;
}

.stats-item:hover {
    position: relative; top: -2px;
}

.stats-number {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #3498db;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stats-label {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.2;
    word-wrap: break-word;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .moderation-article-card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        padding: 8px;
        border-left: 4px solid #f39c12;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .profile-content {
        flex-direction: column;
    }

    .profile-left-column {
        padding: 0px;
    }

    .profile-left-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .user-articles {
        grid-template-columns: 1fr;
    }

    .info-item {
        flex-direction: column;
        text-align: left;
    }

    .info-value {
        text-align: left;
        margin-top: 5px;
    }

    .tab-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 10px;
    }

    .user-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .stats-item {
        padding: 8px 5px;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }

    .stats-number {
        font-size: 18px;
    }

    .stats-label {
        font-size: 11px;
    }

    .article-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .article-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .moderation-article-card>.article-actions {
        flex-direction: row;
    }

    .article-actions>.btn {
        justify-content: center;
        width: auto;
    }

    .tab-pane.active>.articles-list>.user-article>.article-actions {
        flex-direction: row;
    }
}

@media (max-width: 480px) {

    .tab-pane.active>.articles-list>.user-article>.article-actions {
        flex-direction: column;
    }

    .status-edit-actions {
        flex-direction: row;
        gap: 6px;
    }

    .update_status,
    .cancel_status {
        width: 100%;
        justify-content: center;
        padding: 5px 10px;
    }

    .status-input {
        min-width: 100%;
        margin-bottom: 8px;
    }

    .user-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px;
    }

    .stats-item {
        padding: 6px 4px;
        height: 55px;
        min-height: 55px;
        max-height: 55px;
    }

    .stats-number {
        font-size: 16px;
    }

    .stats-label {
        font-size: 10px;
    }

    .profile-actions {
			display: flex;
			flex-direction: row;
			gap: 10px;
			margin: 15px 0;
			justify-content: center;
    }

    .article-actions>.btn {
        justify-content: center;
        width: 100%;

    }

    .moderation-article-card>.article-actions {
        gap: 2px;
    }
}

/* Стили для вкладки черновиков */
.drafts-articles-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.draft-article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    border-left: 4px solid #6c757d;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.draft-article-card:hover {
    position: relative; top: -3px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-left-color: #495057;
}

.draft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.draft-title {
    flex: 1;
    margin: 0 15px 0 0;
}

.draft-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.draft-title a:hover {
    color: #6c757d;
}

.draft-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
    color: #383d41;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid #d6d8db;
}

.draft-status-badge::before {
    content: "📝";
    font-size: 14px;
}

.draft-meta-info {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.draft-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.draft-meta-row:last-child {
    margin-bottom: 0;
}

.draft-meta-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.draft-meta-value {
    font-size: 14px;
    color: #6c757d;
}

.draft-preview {
    margin-bottom: 25px;
}

.draft-preview-text {
    color: #6c757d;
    line-height: 1.6;
    font-size: 14px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
    font-style: italic;
}

.draft-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-continue {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.btn-continue:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    position: relative; top: -2px;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    color: white;
}

.btn-publish {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-publish:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    position: relative; top: -2px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 10px 12px;
    min-width: 40px;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    position: relative; top: -2px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
}

.draft-helper-text {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 25px;
    color: #1565c0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.draft-helper-text::before {
    content: "💡";
    font-size: 18px;
}

.empty-drafts-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.empty-drafts-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-drafts-state h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 20px;
}

.empty-drafts-state p {
    margin-bottom: 25px;
    font-size: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Стили для пагинации черновиков */
.drafts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.drafts-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.drafts-page-link:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #6c757d;
}

.drafts-page-link.active {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

@media (max-width: 768px) {
    .user-article {
        padding: 10px;
    }

    .user-article {
        margin-bottom: 5px;
    }

    .button-secondary {
        /* display: flex;
        justify-content: center;
        width: 100%; */
        width: fit-content;
    }

    .article-status-tab-user-articles-list {
        padding: 0 !important;
    }

    .draft-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .draft-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .draft-actions {
        flex-direction: row;
        flex-wrap: wrap;
        /* align-items: stretch; */
    }

    .btn {
        justify-content: center;
    }

    .drafts-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .drafts-page-link {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

.status-badge-tab-user-articles-list {
    padding: 0;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background-color: unset;
}

.article-status-tab-user-articles-list {
    background-color: unset;
    color: #856404;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Модалка ЛС: валидация и элементы управления */
input.is-invalid,
textarea.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.dm-counter {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.dm-hint {
    font-size: 12px;
    color: #6b7280;
}

.button-primary:disabled,
.btn-primary:disabled,
.btn:disabled {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #f9fafb !important;
    cursor: not-allowed;
    opacity: 1;
}

.button-primary:disabled:hover,
.btn-primary:disabled:hover,
.btn:disabled:hover {
    background-color: #9ca3af !important;
}

.messages-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 5px 10px;
    color: #374151;
}

.messages-btn:hover {
    background: #eee;
    color: #666666;
}
