/* Стили для страницы профиля */

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.profile-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(18, 20, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 1.25rem;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-head-main {
    flex: 1;
    min-width: 0;
}

.profile-actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

body.profile-page .profile-actions-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 1.25rem;
    box-sizing: border-box;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-tab-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.profile-tab-btn.active {
    border-color: rgba(168, 85, 247, 0.6);
    background: rgba(168, 85, 247, 0.2);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: grid;
    gap: 1rem;
}

body.profile-page {
    position: relative;
}

body.profile-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(11, 11, 18, 0.78), rgba(11, 11, 18, 0.88)), url('../Fons/seitFon.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

.profile-header {
    background: linear-gradient(180deg, rgba(30, 32, 48, 0.86), rgba(20, 22, 34, 0.92));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.2rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.profile-avatar-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.profile-avatar.role-special {
    width: 120px;
    height: 120px;
}

.achievement-badge {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.avatar-change-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-change-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.profile-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.profile-email {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.9rem;
    margin-top: 2rem;
}

.stat-card {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-section {
    background: rgba(18, 20, 32, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-color);
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.favorites-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.favorites-preview-wrapper {
    position: relative;
    margin-top: 1rem;
}

.favorites-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 80px);
    grid-template-rows: repeat(2, auto);
    gap: 1rem;
    overflow: hidden;
    max-height: calc(2 * (80px * 1.5 + 1rem + 20px));
    width: calc(5 * 80px + 4 * 1rem);
    margin: 0 auto;
}

.favorites-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 
                0 2px 4px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.favorites-scroll-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 1), rgba(139, 92, 246, 1));
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6), 
                0 4px 8px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.favorites-scroll-btn:active {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4), 
                0 1px 2px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.favorites-scroll-btn:disabled,
.favorites-scroll-btn[style*="display: none"] {
    opacity: 0;
    pointer-events: none;
}

.favorites-scroll-left {
    left: -60px;
}

.favorites-scroll-right {
    right: -60px;
}

.favorites-scroll-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.favorites-scroll-btn:hover svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.favorite-mini-card {
    cursor: pointer;
    transition: transform 0.3s;
    text-align: center;
    flex-shrink: 0;
    width: 80px;
}

.favorite-mini-card:hover {
    transform: translateY(-5px);
}

.favorite-mini-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.favorite-mini-year {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    color: white;
    font-weight: 500;
}

.favorite-mini-title {
    font-size: 0.75rem;
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.anime-card-small {
    cursor: pointer;
    transition: transform 0.3s;
}

.anime-card-small:hover {
    transform: translateY(-5px);
}

.anime-poster-small {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.anime-year-small {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
}

.anime-info-small {
    text-align: center;
}

.anime-title-small {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-input {
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.empty-favorites {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Стили для истории просмотров */
.watch-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.watch-history-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.watch-history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.watch-history-poster {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.watch-history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.watch-history-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.watch-history-episode {
    font-size: 0.85rem;
    color: var(--primary-color);
}

.watch-history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Стили для настроек */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-modal-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.settings-modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

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

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
    margin-left: 1rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.avatar-picker {
    display: none;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.avatar-option {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    background-color: rgba(255, 255, 255, 0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.avatar-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Настройки */
.settings-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    transition: all 0.3s;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 85, 247, 0.4);
}

.settings-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
}

.settings-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.settings-label input[type="checkbox"]:checked {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.settings-label select {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.settings-label select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

@media (max-width: 768px) {
    .profile-top {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    .profile-actions-row {
        width: 100%;
        justify-content: center;
    }
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .profile-stats {
        gap: 1.5rem;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
}

/* Заголовок секции */
.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Плитки избранного */
.favorites-tiles-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.favorites-tiles-row::-webkit-scrollbar {
    height: 4px;
}

.favorites-tiles-row::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 2px;
}

.favorites-count-label {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* VIP карточки */
.vip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.vip-card {
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.vip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.vip-card-ai {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.08));
    border-color: rgba(168, 85, 247, 0.25);
}

.vip-card-watch {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.08));
    border-color: rgba(59, 130, 246, 0.25);
}

.vip-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.vip-card-ai .vip-card-icon {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.vip-card-watch .vip-card-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.vip-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.vip-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.4;
}

.vip-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vip-card-btn {
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.vip-active-label {
    color: #34d399 !important;
    font-weight: 600;
    font-size: 1rem;
}

.vip-card-expires {
    color: rgba(200, 180, 230, 0.7);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Инфо друзей */
.friends-count-info {
    padding: .5rem 0 .75rem;
    color: var(--text-secondary);
    font-size: .9rem;
}

/* Плитки друзей */
.profile-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: .6rem;
}
.profile-friend-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .5rem .25rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background .2s, transform .2s;
}
.profile-friend-tile:hover {
    background: rgba(255,255,255,.06);
    transform: translateY(-2px);
}
.profile-friend-tile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.1);
}
.profile-friend-tile-name {
    font-size: .78rem;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}

/* VIP бейджи рядом с именем */
.profile-vip-badge {
    display: inline-block;
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    vertical-align: middle;
    margin-left: .35rem;
}

.profile-creator-badge {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 6px;
    vertical-align: middle;
    margin-left: .35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Сетка постов на профиле */
.profile-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border-radius: 12px;
    overflow: hidden;
}

.profile-post-tile {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.profile-post-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s, opacity 0.25s;
}

.profile-post-tile:hover img {
    transform: scale(1.05);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .vip-cards-grid {
        grid-template-columns: 1fr;
    }
    .favorites-tiles-row {
        gap: 0.5rem;
    }
    .profile-friends-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    }
    .profile-friend-tile-avatar {
        width: 44px;
        height: 44px;
    }
    .profile-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
}
