/* ========== PROFILE ========== */

.profile-page {
    width: 100%;
    padding: 0 8px 8px 8px; /* Уменьшил с 12px */
}

/* На десктопе */
@media (min-width: 768px) {
    .profile-page {
        padding: 0 12px 12px 12px;
    }
}

/* ===== BANNER ===== */
.profile-banner {
    width: 100%;
    height: 180px; /* Уменьшил с 260px на мобильных */
    background: var(--wood);
    border-radius: 16px; /* Уменьшил с 24px */
    overflow: hidden;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .profile-banner {
        height: 220px;
        border-radius: 20px;
        margin-bottom: 20px;
    }
}

@media (min-width: 1024px) {
    .profile-banner {
        height: 260px;
        border-radius: 24px;
    }
}

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

.banner-default {
    height: 100%;
    background: linear-gradient(135deg, var(--wood), var(--wood-dark));
}

/* ===== HEADER ===== */
.profile-header {
    display: flex;
    justify-content: center;
    margin-top: -50px; /* Уменьшил с -80px на мобильных */
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .profile-header {
        margin-top: -70px;
        margin-bottom: 16px;
    }
}

/* ===== GLASS INFO BLOCK ===== */
.profile-info {
    width: 100%;
    max-width: 960px;
    padding: 20px 16px; /* Уменьшил с 32px 40px */

    background: var(--bg-glass);
    border: 1px solid var(--card-border);
    border-radius: 20px; /* Уменьшил с 28px */

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    box-shadow: var(--shadow-glass);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px; /* Уменьшил с 20px */

    text-align: center;
}

@media (min-width: 768px) {
    .profile-info {
        padding: 28px 24px;
        border-radius: 24px;
        gap: 20px;
    }
}

/* ===== AVATAR ===== */
.profile-avatar {
    width: 90px; /* Уменьшил с 130px на мобильных */
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .profile-avatar {
        width: 110px;
        height: 110px;
    }
}

@media (min-width: 1024px) {
    .profile-avatar {
        width: 130px;
        height: 130px;
    }
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem; /* Уменьшил с 3.5rem */
    color: #fff;
    background: linear-gradient(135deg, var(--wood), var(--wood-dark));
}

/* ===== NAME ===== */
.profile-info h1 {
    margin: 0;
    font-size: 1.5rem; /* Уменьшил с 2.2rem */
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

@media (min-width: 768px) {
    .profile-info h1 {
        font-size: 1.8rem;
    }
}

/* ===== STATS ===== */
.profile-stats {
    display: flex;
    gap: 16px; /* Уменьшил с 24px */
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem; /* Уменьшил с 0.95rem */
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .profile-stats {
        gap: 24px;
        font-size: 0.95rem;
    }
}

.profile-stats b {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== BIO (CLICKABLE) ===== */
.bio-trigger {
    width: 100%;
    max-width: 720px;
    padding: 12px 16px; /* Уменьшил с 16px 20px */
    
    background: var(--bg-glass-light);
    border: 1px solid var(--card-border);
    border-radius: 14px; /* Уменьшил с 16px */

    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    
    position: relative;
    z-index: 10;

    transition: background .2s ease;
    color: var(--text-primary);
    text-align: left;
    font-size: 0.85rem; /* Меньше шрифт на мобильных */
}

@media (min-width: 768px) {
    .bio-trigger {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
}

.bio-trigger:hover {
    background: var(--bg-glass);
}

/* ===== EDIT BUTTON ===== */
.profile-edit-button {
    width: 100%;
    max-width: 720px;
    margin-top: 8px;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px; /* Уменьшил с 10px 24px */
    background: var(--bg-glass-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    border-radius: 40px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem; /* Уменьшил с 0.95rem */
    transition: all 0.2s;
    min-height: 40px; /* Для тапа */
}

@media (min-width: 768px) {
    .btn-edit {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

.btn-edit:hover {
    background: var(--bg-glass);
    transform: translateY(-2px);
}

.btn-edit i {
    font-size: 0.9rem;
    color: var(--accent);
}

/* ===== ACTIONS ===== */
.profile-actions {
    display: flex;
    gap: 10px; /* Уменьшил с 12px */
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-subscribe {
    background: var(--accent) !important;
    color: white !important;
    border: none !important;
    padding: 8px 20px; /* Уменьшил с 10px 24px */
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 40px;
}

@media (min-width: 768px) {
    .btn-subscribe {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

.btn-subscribe:hover {
    background: var(--accent-hover) !important;
}

.btn-subscribe.on {
    background: var(--bg-glass) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--card-border) !important;
}

/* ===== NAV ===== */
.profile-nav {
    display: flex;
    gap: 20px; /* Уменьшил с 32px */
    margin: 16px 0 16px; /* Уменьшил отступы */
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-nav::-webkit-scrollbar {
    display: none;
}

.profile-nav a {
    padding: 10px 0; /* Уменьшил с 12px 0 */
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    font-size: 0.9rem; /* Уменьшил с 1rem */
    transition: color 0.2s;
    margin-bottom: -1px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .profile-nav {
        gap: 32px;
        margin: 20px 0 20px;
        overflow-x: visible;
    }
    
    .profile-nav a {
        padding: 12px 0;
        font-size: 1rem;
    }
}

.profile-nav a:hover {
    color: var(--text-primary);
}

.profile-nav a.active {
    color: var(--text-primary);
    font-weight: 600;
}

.profile-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

/* ===== VIDEOS SECTION ===== */
.profile-videos {
    margin-top: 16px; /* Уменьшил с 24px */
}

.profile-videos h2 {
    font-size: 1.2rem; /* Уменьшил с 1.5rem */
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== VIDEOS HEADER ===== */
.videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.videos-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ===== СОРТИРОВКА ===== */
.sort-dropdown {
    position: relative;
}

.sort-dropdown .btn {
    all: unset;
    padding: 8px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 130px;
    justify-content: space-between;
    box-sizing: border-box;
    line-height: 1.4;
}

.sort-dropdown .btn:hover {
    background: var(--bg-glass-light);
    border-color: var(--accent);
}

.sort-dropdown .btn i {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.sort-dropdown .btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.dropdown-menu {
    all: unset;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: var(--shadow-glass);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    display: block;
    box-sizing: border-box;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    all: unset;
    display: block;
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    transition: background 0.2s;
    line-height: 1.4;
    white-space: nowrap;
    background: transparent;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-item.active {
    background: var(--accent);
    color: white;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px; /* Уменьшил с 16px */
    margin: 30px 0 16px; /* Уменьшил с 40px 0 20px */
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 18px; /* Уменьшил с 10px 24px */
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.85rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}

.page-link:hover {
    background: var(--bg-glass-light);
    border-color: var(--accent);
}

.current-page {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== NO VIDEOS ===== */
.no-videos {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-glass-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== MODAL ===== */
.bio-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}

@keyframes fadeIn {
    from {
        background: rgba(0, 0, 0, 0);
    }
    to {
        background: rgba(0, 0, 0, 0.85);
    }
}

.modal-box {
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    
    background: var(--bg-glass);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 24px; /* Уменьшил с 28px */
    box-shadow: var(--shadow-glass);
    
    animation: modalAppear 0.2s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 16px 20px; /* Уменьшил с 20px 24px */
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header b {
    font-size: 1.2rem; /* Уменьшил с 1.3rem */
    color: var(--text-primary);
    font-weight: 600;
}

.modal-header span {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-header span:hover {
    background: var(--hover-bg);
}

.modal-content {
    padding: 20px; /* Уменьшил с 24px */
}

.modal-content p {
    margin: 0 0 12px 0;
    line-height: 1.5;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-content hr {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.modal-content a {
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .profile-nav {
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 0;
        white-space: nowrap;
    }
    
    .videos-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sort-dropdown {
        width: 100%;
    }

    .dropdown-menu.show {
        width: 100%;
    }
    
    .sort-dropdown .btn {
        width: 100%;
        min-width: auto;
    }

    
    .pagination {
        gap: 10px;
    }
    
    .btn-edit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
    
    .profile-actions {
        width: 100%;
    }
    
    .btn-subscribe {
        flex: 1;
        text-align: center;
    }
    
    .page-link {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}