body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #0d0d1c;
    color: #fff;
}

.profile-wrapper {
    position: relative;
}

.profile-banner {
    width: 100%;
    max-width: 2000px; 
    margin: 0 auto;
    height: 270px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    border-radius: 0 0 20px 20px;
}

.profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.7);
    transition: transform 0.5s ease;
}

.profile-avatar {
    position: relative;
    margin: -75px auto 0 auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #0d0d1c;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 2;
    background: #0d0d1c;
}

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

.profile-info {
    text-align: center;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards;
}

.profile-info h1 {
    font-size: 1.8rem;
    margin: 0;
    margin-top: 5px;
}

.profile-info span {
    color: #b0b0b0;
    display: block;
    margin-bottom: 10px;
}

.bio {
    max-width: 500px;
    margin: 15px auto 0;
    background: rgba(255,255,255,0.05);
    padding: 12px 20px;
    border-radius: 20px;
}

.bio strong {
    color: #a8a8ff;
}

.bio p {
    margin: 8px 0 0;
    color: #d0d0e0;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-primary {
    background: linear-gradient(90deg, #5865F2, #7b6ff7);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.85;
}



@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.official-channel {
    text-align: center;
    margin-top: 15px;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.2s forwards;
}

.official-channel a {
    display: inline-block;
    background: linear-gradient(90deg, #dc2626, #991b1b);
    color: white !important;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.official-channel a:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    text-decoration: none;
}

.profile-tabs-wrapper {
    max-width: 800px;
    margin: 30px auto 0;
    padding: 0 20px;
}

.profile-tabs {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
}

.profile-tab-link {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    color: #8a8aa0;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.profile-tab-link.active {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: white;
}

.profile-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a8a8ff, #667eea);
    border-radius: 3px;
}

.profile-tab-link:hover:not(.active) {
    background: #22223a;
    color: #d0d0e0;
}

.profile-publications-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.profile-publications-container .feed-card {
    background: #1a1a2e;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #2a2a3e;
    transition: transform 0.2s ease;
}

.profile-publications-container .feed-card:hover {
    transform: translateY(-2px);
}

.profile-publications-container .card-header {
    padding: 16px 16px 0 16px;
}

.profile-publications-container .author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-publications-container .author-avatar-link {
    text-decoration: none;
}

.profile-publications-container .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-publications-container .avatar-placeholder {
    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: bold;
    font-size: 20px;
    text-transform: uppercase;
}

.profile-publications-container .author-details {
    flex: 1;
}

.profile-publications-container .author-name {
    color: #a8a8ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.profile-publications-container .author-name:hover {
    color: white;
    text-decoration: underline;
}

.profile-publications-container .post-time {
    color: #8a8aa0;
    font-size: 12px;
}

.profile-publications-container .card-body {
    padding: 12px 16px;
}

.profile-publications-container .post-text-container {
    margin-bottom: 12px;
}

.profile-publications-container .post-text {
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.profile-publications-container .post-text.collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.profile-publications-container .post-text.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, #1a1a2e);
    pointer-events: none;
}

.profile-publications-container .post-text.collapsed .read-more-link {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #1a1a2e;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 10;
}

.profile-publications-container .post-text.expanded {
    max-height: none;
    overflow: visible;
}

.profile-publications-container .post-text.expanded .read-more-link {
    position: static;
    display: inline-block;
    margin-top: 10px;
}

.profile-publications-container .read-more-link {
    display: inline-block;
    margin-top: 5px;
    color: #a8a8ff;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.profile-publications-container .read-more-link:hover {
    text-decoration: underline;
}

.profile-publications-container .post-photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2px;
    margin-top: 12px;
}

.profile-publications-container .gallery-item {
    position: relative;
    overflow: hidden;
    background: #2a2a3e;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.profile-publications-container .gallery-item:hover {
    transform: scale(1.02);
}

.profile-publications-container .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-photos-gallery:has(.gallery-item:only-child) {
    grid-template-columns: 1fr;
}

.post-photos-gallery:has(.gallery-item:only-child) .gallery-item {
    aspect-ratio: auto;
    max-height: 500px;
}

.post-photos-gallery:has(.gallery-item:only-child) .gallery-item img {
    object-fit: contain;
    background: #0a0a0f;
}

.profile-publications-container .article-title {
    font-size: 20px;
    color: #e0e0e0;
    margin-bottom: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-publications-container .article-description-container {
    margin-bottom: 12px;
}

.profile-publications-container .article-description {
    color: #a0a0b0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.profile-publications-container .article-description.collapsed {
    max-height: 80px;
    overflow: hidden;
    position: relative;
}

.profile-publications-container .article-description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #1a1a2e);
    pointer-events: none;
}

.profile-publications-container .read-more-description-link {
    display: inline-block;
    margin-top: 5px;
    color: #a8a8ff;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
}

.profile-publications-container .read-more-description-link:hover {
    text-decoration: underline;
}

.profile-publications-container .article-photo {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.profile-publications-container .article-photo img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.profile-publications-container .article-photo img:hover {
    transform: scale(1.02);
}

.profile-publications-container .article-full-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.profile-publications-container .article-full-link:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

.profile-publications-container .card-footer {
    padding: 0 16px 16px 16px;
    border-top: 1px solid #2a2a3e;
    margin-top: 8px;
}

.profile-publications-container .post-comments-block {
    margin-top: 12px;
}

.profile-publications-container .top-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    background: #1f1f30;
    border-radius: 10px;
    padding: 10px;
}

.profile-publications-container .top-comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-publications-container .top-comment-content {
    flex: 1;
}

.profile-publications-container .top-comment-content strong a {
    color: #a8a8ff;
    text-decoration: none;
}

.profile-publications-container .top-comment-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #d0d0e0;
}

.profile-publications-container .top-comment-content span {
    font-size: 12px;
    color: #8a8aa0;
}

.profile-publications-container .show-comments-btn {
    background: none;
    border: none;
    color: #6c6c8a;
    cursor: pointer;
    padding: 8px 0;
    font-size: 13px;
    transition: color 0.2s ease;
    width: 100%;
    text-align: left;
}

.profile-publications-container .show-comments-btn:hover {
    color: #a8a8ff;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 3px solid #2a2a3e;
    border-top: 3px solid #a8a8ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#comments-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
}

.photo-modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
}

.photo-modal-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-photo-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

.close-photo-modal:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.photo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 48px;
    cursor: pointer;
    padding: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
}

.photo-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.photo-nav-prev {
    left: 30px;
}

.photo-nav-next {
    right: 30px;
}

.photo-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 2001;
}

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

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #1f1f30;
    border-radius: 10px;
}

.comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-header strong a {
    color: #a8a8ff;
    text-decoration: none;
}

.comment-header small {
    color: #6c6c8a;
    font-size: 11px;
}

.comment-text {
    margin: 5px 0;
    color: #d0d0e0;
    word-break: break-word;
}

.like-btn {
    background: none;
    border: none;
    color: #8a8aa0;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.like-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.no-comments {
    text-align: center;
    color: #8a8aa0;
    padding: 20px;
}

@media (max-width: 768px) {
    .profile-avatar {
        width: 120px;
        height: 120px;
        margin: -60px auto 0 auto;
    }
    
    .profile-info {
        margin-top: 5px;
    }

    .profile-info h1 {
        font-size: 1.5rem;
    }
    
    .profile-tabs-wrapper {
        margin-top: 20px;
    }
    
    .profile-tab-link {
        padding: 10px;
        font-size: 14px;
    }
    
    .profile-publications-container .post-photos-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .profile-publications-container .author-avatar,
    .profile-publications-container .avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .profile-publications-container .article-title {
        font-size: 18px;
    }
    
    .photo-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 28px;
        padding: 12px;
    }
    
    .photo-nav-prev {
        left: 15px;
    }
    
    .photo-nav-next {
        right: 15px;
    }
    
    .close-photo-modal {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .profile-publications-container .post-photos-gallery {
        grid-template-columns: 1fr;
    }
    
    .profile-publications-container .gallery-item {
        aspect-ratio: 16/9;
    }
    
    .bio {
        margin: 15px 20px;
    }
    
    .photo-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
        padding: 10px;
    }
}
.profile-publications-container .post-text {
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
}

.profile-publications-container .post-text br {
    display: none;
}

.profile-publications-container .post-text-container {
    white-space: normal;
}