/* User Profile Page - TikTok Style */

.user-profile-page {
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

/* Author Page Scroll Fixes */
/* Re-enable scrolling and allow content to extend beyond viewport on author pages */
body.author {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto !important;
}

.content.content--scroll {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}

/* Ensure content isn't hidden behind fixed footer menu */
.user-profile-page {
    padding-bottom: 80px; /* space for footer menu */
}

/* Profile Header */
.profile-header {
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,1) 100%);
}

.profile-info {
    max-width: 600px;
    margin: 0 auto;
}

.profile-avatar {
    margin-bottom: 20px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fd0131;
    transition: transform 0.3s ease;
}

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

.profile-username {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #fff;
}

.profile-display-name {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 20px 0;
    color: #ccc;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-top: 2px;
}

/* Profile Bio */
.profile-bio {
    margin: 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.profile-bio p {
    font-size: 16px;
    line-height: 1.5;
    color: #ccc;
    margin: 0;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.social-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
}

.social-link.reddit {
    background: #ff4500;
    border-color: transparent;
}

.social-link.onlyfans {
    background: #00aeef;
    border-color: transparent;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* Profile Actions */
.profile-actions {
    margin: 25px 0;
}

.follow-btn {
    background: #fd0131;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.follow-btn:hover {
    background: #e00028;
    transform: translateY(-2px);
}

.follow-btn.following {
    background: #333;
    color: #ccc;
}

.follow-btn.following:hover {
    background: #fd0131;
    color: #fff;
}

/* Profile Tabs */
.profile-tabs {
    background: #000;
    min-height: 50vh;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #333;
    padding: 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: #666;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #ccc;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #fd0131;
}

.tab-btn svg {
    width: 20px;
    height: 20px;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
}

.video-item {
    position: relative;
    aspect-ratio: 9/16;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: scale(1.02);
}

.video-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-stats {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 12px;
}

.video-likes svg {
    width: 12px;
    height: 12px;
    color: #fd0131;
}

/* No Videos Message */
.no-videos {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-videos p {
    font-size: 18px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-header {
        padding: 30px 15px;
    }
    
    .profile-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .profile-username {
        font-size: 20px;
    }
    
    .profile-display-name {
        font-size: 16px;
    }
    
    .profile-stats {
        gap: 25px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .social-links {
        gap: 10px;
    }
    
    .social-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1px;
        padding: 10px;
    }
    
    .tab-content {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .tab-buttons {
        padding: 0 10px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 5px;
    }
}

/* Loading Animation */
.loading-animation {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #333;
    border-radius: 50%;
    border-top-color: #fd0131;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Profile Navigation */
.profile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    min-height: 60px;
    box-sizing: border-box;
}

.back-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

/* Profile Actions Header */
.profile-actions-header {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 201;
    margin-left: auto;
}

.edit-profile-btn,
.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.edit-profile-btn:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.logout-btn {
    background: rgba(255, 75, 75, 0.2);
    border: 1px solid rgba(255, 75, 75, 0.4);
}

.logout-btn:hover {
    background: rgba(255, 75, 75, 0.3);
}

.profile-header {
    padding-top: 80px; /* Account for fixed nav */
}

/* Ensure navigation stays on top */
.user-profile-page .profile-nav {
    position: fixed !important;
    top: 0 !important;
    z-index: 200 !important;
}

/* Ensure footer doesn't interfere with nav */
.user-profile-page footer {
    z-index: 50;
}

/* Profile Edit Page */
.profile-edit-page {
    background: #000;
    color: #fff;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
}

.edit-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.back-btn:active {
    transform: scale(0.98);
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(253, 1, 49, 0.15);
    color: #fd0131;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(253, 1, 49, 0.2);
}

.home-btn:hover {
    background: rgba(253, 1, 49, 0.25);
    color: #fd0131;
    transform: scale(1.05);
}

.home-btn:active {
    transform: scale(0.98);
}

.edit-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.save-btn {
    background: #fd0131;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #e00028;
    transform: translateY(-1px);
}

/* Edit Content */
.edit-content {
    padding: 80px 20px 100px; /* Account for fixed nav and bottom spacing */
    max-width: 600px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}

/* Messages */
.message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    background: rgba(17, 17, 17, 0.8);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    backdrop-filter: blur(10px);
}

.form-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* Avatar Upload Section */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-avatar-display {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.current-avatar-display:hover .avatar-overlay {
    opacity: 1;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 12px 15px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #fd0131;
    box-shadow: 0 0 0 3px rgba(253, 1, 49, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Character Count */
.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.char-count.over-limit {
    color: #ef4444;
}

/* Buttons */
.btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: #444;
    transform: translateY(-1px);
}

.btn.secondary {
    background: #fd0131;
}

.btn.secondary:hover {
    background: #e00028;
}

.btn.danger {
    background: #ef4444;
}

.btn.danger:hover {
    background: #dc2626;
}

/* Setting Items */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}

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

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-title {
    font-weight: 500;
    color: #fff;
}

.setting-desc {
    font-size: 14px;
    color: #666;
}

.setting-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-nav,
    .edit-nav {
        padding: 12px 15px;
    }
    
    .edit-title {
        font-size: 16px;
    }
    
    .save-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .edit-content {
        padding: 70px 15px 80px;
        min-height: calc(100vh - 70px);
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .form-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .avatar-upload-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .current-avatar-display {
        width: 60px;
        height: 60px;
    }
    
    .avatar-actions {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }
}

@media (max-width: 480px) {
    .profile-nav,
    .edit-nav {
        padding: 10px 12px;
    }
    
    .back-home-btn,
    .back-btn {
        width: 36px;
        height: 36px;
    }
    
    .profile-actions-header {
        gap: 6px;
        margin-left: auto;
    }
    
    .edit-profile-btn,
    .logout-btn {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Ensure nav stays fixed on mobile */
    .user-profile-page .profile-nav {
        position: fixed !important;
        top: 0 !important;
        z-index: 200 !important;
        min-height: 50px;
    }
    
    .edit-content {
        padding: 60px 12px 60px;
        min-height: calc(100vh - 60px);
    }
    
    .form-section {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .form-section h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .current-avatar-display {
        width: 50px;
        height: 50px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .setting-item {
        padding: 10px 0;
    }
    
    .setting-title {
        font-size: 14px;
    }
    
    .setting-desc {
        font-size: 12px;
    }
    
    .char-count {
        font-size: 11px;
    }
}

/* Profile Page Specific Body */
body.author {
    background: #000;
    overflow-x: hidden;
}

body.author header,
body.author footer {
    display: none;
}

/* Profile Edit Page Scrolling Fix */
body.page-template-page-profile-edit {
    background: #000 !important;
    overflow: visible !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Fix for main.css body overflow hidden override */
html {
    overflow-y: auto !important;
    height: auto !important;
}

/* Ensure scrolling works properly */
.profile-edit-page {
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
}

/* Hide default header and footer on profile edit page */
body.page-template-page-profile-edit header,
body.page-template-page-profile-edit footer,
body.page-template-page-profile-edit .footer-menu {
    display: none !important;
}

/* Fix for navigation bar positioning during scroll */
body.page-template-page-profile-edit .edit-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    width: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
}

/* Completely remove any footer interference */
body.page-template-page-profile-edit footer,
body.page-template-page-profile-edit .footer-menu,
body.page-template-page-profile-edit footer * {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Prevent body scroll issues on mobile */
@media (max-width: 768px) {
    body.page-template-page-profile-edit {
        position: relative !important;
        height: auto !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    body.page-template-page-profile-edit .edit-nav {
        position: fixed !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }
    
    .back-btn {
        width: 40px;
        height: 40px;
    }
    
    .home-btn {
        width: 34px;
        height: 34px;
    }
    
    .nav-left {
        gap: 10px;
    }
}
