.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
    overflow-x: hidden; /* Предотвращаем горизонтальную прокрутку */
    width: 100%;
    box-sizing: border-box;
}

.profile-header {
    margin-bottom: 30px;
}

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

.profile-info {
    margin-top: 20px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.interest-tag {
    background-color: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal-dialog {
    max-width: 500px;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.profile-photo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.photo-actions {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    display: none;
}

.profile-photo-container:hover .photo-actions {
    display: flex;
    gap: 5px;
}

.photo-gallery {
    margin-top: 20px;
}

.gallery-photo {
    width: 100%;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-photo:hover {
    transform: scale(1.05);
}

.gallery-photo.main-photo {
    border: 2px solid #0d6efd;
}

.gallery-photo-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none;
    gap: 5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 3px;
    border-radius: 3px;
}

.position-relative:hover .gallery-photo-actions {
    display: flex;
}

.gallery-photo-actions .btn {
    padding: 2px 5px;
    font-size: 12px;
}

#photoViewModal .modal-body {
    padding: 0;
}

#photoViewModal .modal-body img {
    max-height: 80vh;
    object-fit: contain;
}

/* Avatar styles */
.profile-avatar-xl {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-hero-card {
    border-radius: 1rem;
    overflow: hidden;
}

.profile-photo-strip .btn {
    font-weight: 500;
}

.profile-gallery-modal-grid .profile-gallery-tile {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-gallery-modal-grid .profile-gallery-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.profile-gallery-tile-actions {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
}

.profile-gallery-tile .gallery-tile-open:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.avatar-actions {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* NEO-63: кнопка добавления фото (камера) — идеальный круг (как круглые иконки соцсетей).
   Без фикс. width/height асимметричный padding .btn-sm + .rounded-circle давал горизонтальный овал. */
.avatar-actions .btn-group > .btn,
.avatar-actions .btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}

/* CC Badge */
.cc-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #2962ff, #1565c0);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery */
.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1;
}

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

/* Info blocks */
.profile-info-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(78, 115, 223, 0.1);
    border-radius: 10px;
    margin-right: 1rem;
    transition: background-color 0.2s;
}

.profile-info-icon:hover {
    background: rgba(78, 115, 223, 0.2);
}

.profile-info-icon i {
    font-size: 1.2rem;
    color: #4e73df;
}

.profile-info-content {
    flex: 1;
}

/* Social networks */
.profile-social-networks {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-social-networks .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.profile-social-networks .btn:hover {
    transform: scale(1.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: transform 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(45deg, #4e73df, #2e59d9);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #2e59d9, #1e47c8);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(46, 89, 217, 0.2);
}

/* Stats */
.stat-item {
    padding: 1.5rem;
    background: rgba(78, 115, 223, 0.1);
    border-radius: 1rem;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(78, 115, 223, 0.15);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #4e73df;
}

/* Interests */
.interest-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(78, 115, 223, 0.1);
    border-radius: 2rem;
    margin: 0.25rem;
    transition: all 0.2s;
}

.interest-tag:hover {
    background: rgba(78, 115, 223, 0.2);
    transform: translateY(-2px);
}

.interest-tag i {
    margin-right: 0.5rem;
    color: #4e73df;
}

/* Единый стиль кнопок-«шестерёнок» для редактирования секций профиля */
.profile-edit-gear-btn {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.profile-edit-gear-btn i {
    font-size: 1rem;
}

/* Уровень владения интересом / навыком: горизонтальный ряд точек (слева направо) */
.level-dots {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.level-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.level-dots .dot.filled {
    background-color: #ffc107;
    border: 1px solid #e0a800;
}

.level-dots .dot.empty {
    background-color: transparent;
    border: 1px solid #ced4da;
}

.badge .level-dots {
    margin-left: 0;
}

.badge .level-dots .dot.empty {
    border-color: rgba(255, 255, 255, 0.5);
}

.interest-tag .stars {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .profile-sidebar {
        margin-bottom: 2rem;
    }
    
    .stat-item {
        margin-bottom: 1rem;
    }
}

/* Мобильные стили для предотвращения горизонтальной прокрутки */
@media (max-width: 768px) {
    .profile-container {
        padding: 1rem 0.5rem;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Только внутри профиля: на /search и др. страницах глобальный width:100% ломает input-group и ряды кнопок */
    .profile-container .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .profile-container .profile-edit-gear-btn {
        width: 2.25rem !important;
        min-width: 2.25rem;
        margin-bottom: 0;
    }

    /* NEO-52: соцкнопки остаются квадратными 40×40 (иначе rounded-circle даёт овал на мобильном) */
    .profile-container .profile-social-networks .btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        flex: 0 0 auto;
        margin-bottom: 0;
        border-radius: 50%;
    }

    .interests-list {
        justify-content: center;
    }
    
    .interest-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin: 0.2rem;
    }
}

@media (max-width: 576px) {
    .profile-container {
        padding: 0.5rem 0.25rem;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .profile-section-title {
        font-size: 1.2rem;
    }
    
    .interest-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-container > * {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
}

.toast {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modal customization */
.modal-content {
    border-radius: 1rem;
    border: none;
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: none;
    padding: 1.5rem;
}

/* Modal Photo Viewer */
.btn-close-white {
    filter: invert(1);
}

.z-index-1 {
    z-index: 1;
}

/* Фото интересов */
.interest-photos-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #0d6efd;
    text-decoration: underline;
    white-space: nowrap;
}
.interest-photos-link:hover {
    color: #0a58ca;
}

.interest-manage-photos-btn {
    padding: 0.15rem 0.5rem;
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.interest-photo-thumb-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #f8f9fa;
}
.interest-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.interest-photo-delete-btn {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
}
 