/* Profile Styles */
.profile-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 15px;
    position: relative;
    overflow: visible;
    background-color: #222;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--border-color);
}

.avatar-camera-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ff0050, #7928ca);
    border: 2.5px solid #13131a;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    z-index: 10;
    pointer-events: none;
}

.default-avatar:not([style*="url"]) {
    background: radial-gradient(circle at center, #1f142f 0%, #08050e 100%) !important;
    background-image: url('../img/viral-logo.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 2px solid rgba(255, 0, 80, 0.35) !important;
}

.profile-display-name {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-username {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.profile-bio {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 20px;
    white-space: pre-wrap;
    max-width: 80%;
}

.edit-profile-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 20px;
}

.edit-profile-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-content-placeholder {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
}

/* Edit Profile */
.edit-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.photo-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-danger {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-danger:hover {
    background-color: rgba(255, 0, 80, 0.1);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #555;
    margin-top: 10px;
}

.btn-secondary:hover {
    background-color: #333;
}

.form-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #a5d6a7;
}

textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    resize: none;
    font-family: var(--font-family);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Cropper Modal */
#cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cropper-modal.hidden {
    display: none;
}

.cropper-modal-content {
    background-color: #1a1a1a;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.cropper-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.cropper-container-wrapper {
    width: 100%;
    height: 60vh;
    max-height: 400px;
    background-color: #000;
    overflow: hidden;
    margin-bottom: 15px;
}

.cropper-container-wrapper img {
    max-width: 100%;
    display: block;
}

.cropper-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.cropper-footer {
    display: flex;
    justify-content: space-between;
}
/* Profile Videos Grid */
.profile-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 2px;
}
.profile-video-item {
    aspect-ratio: 9/16;
    background-color: #121019;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-video-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: #121019;
    display: block;
    border: none;
    outline: none;
}
.profile-video-cover-img[alt]:after {
    display: none !important;
}
.profile-video-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    z-index: 2;
}
.profile-video-stats-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.35) 75%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.95);
    pointer-events: none;
}
.profile-video-stat-left,
.profile-video-stat-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}
.profile-video-stat-left span.stat-icon {
    font-size: 0.85rem;
}
.profile-video-stat-right span.stat-icon {
    font-size: 0.85rem;
    color: #ff2b54;
}
.profile-video-views {
    display: none;
}

.profile-video-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 0, 80, 0.6);
    color: #ff3366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    opacity: 1 !important;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
    pointer-events: auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.profile-video-item:hover .profile-video-delete-btn {
    transform: scale(1.08);
}

.profile-video-delete-btn:hover,
.profile-video-delete-btn:active {
    opacity: 1;
    transform: scale(1.18);
    background: rgba(255, 0, 80, 0.92);
    border-color: #ff0050;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 0, 80, 0.85);
}

.profile-video-delete-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    pointer-events: none;
}

/* Blocked Video Dim & Warning Overlay */
.profile-video-item.is-blocked {
    border: 1px solid rgba(255, 0, 80, 0.4);
}

.profile-video-item.is-blocked .profile-video-cover-img {
    filter: brightness(0.35) contrast(0.9) grayscale(30%);
    transition: filter 0.2s ease;
}

.profile-video-item.is-blocked:hover .profile-video-cover-img {
    filter: brightness(0.28) contrast(0.9) grayscale(40%);
}

.profile-video-blocked-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 10, 20, 0.4) 0%, rgba(20, 5, 12, 0.88) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.profile-video-blocked-badge {
    background: linear-gradient(135deg, #ff0050, #d90429);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 0, 80, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.profile-video-blocked-msg {
    color: #ffccd5;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    max-width: 90%;
}

@media (max-width: 768px) {
    .profile-video-delete-btn {
        opacity: 0.9;
    }
}

/* Profile Locked State */
.profile-locked-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.profile-locked-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.profile-locked-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.profile-locked-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.45;
}

/* Clickable Stats */
.profile-stat-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    border-radius: 8px;
    padding: 4px 6px;
    user-select: none;
}
.profile-stat-clickable:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}
.profile-stat-clickable:active {
    transform: scale(0.94);
}

/* Relations Modal (With Me & Motivating - Fullscreen) */
.relations-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0918;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(20px);
}
.relations-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.relations-modal-sheet {
    background: #0d0918;
    border: none;
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}
.relations-modal-overlay.active .relations-modal-sheet {
    transform: none;
}
.relations-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}
.relations-sheet-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}
.relations-sheet-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s, transform 0.1s;
}
.relations-sheet-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.relations-sheet-close:active {
    transform: scale(0.92);
}
.relations-sheet-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}
.relations-tab-btn {
    flex: 1;
    padding: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.relations-tab-btn.active {
    color: white;
}
.relations-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, #ff0050, #00f2fe);
    border-radius: 3px;
}
.relations-sheet-list {
    padding: 12px 20px;
    padding-bottom: max(25px, env(safe-area-inset-bottom));
    overflow-y: auto;
    flex: 1;
    height: 100%;
    max-height: none;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}
.relation-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.relation-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}
.relation-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}
.relation-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.relation-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.relation-user-handle {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.relation-user-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}
.relation-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.relation-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* Change Password Modal */
#change-password-modal {
    animation: fadeInModal 0.2s ease-out;
}
#change-password-modal .modal-container {
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
#change-password-modal input:focus {
    border-color: #ff0050 !important;
    box-shadow: 0 0 0 2px rgba(255, 0, 80, 0.2);
}

/* Motivated Orange Color Pill Button (Both side chain made / active motivation) */
.chain-btn.motivated {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.35) 0%, rgba(255, 183, 77, 0.28) 35%, rgba(245, 124, 0, 0.4) 70%, rgba(230, 81, 0, 0.32) 100%) !important;
    background-size: 200% 200% !important;
    animation: orangeWaveShift 4s ease-in-out infinite alternate !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 152, 0, 0.85) !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.35), inset 0 0 12px rgba(255, 183, 77, 0.22) !important;
    font-weight: 800 !important;
    font-size: 0.78rem !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    letter-spacing: 0.4px !important;
    padding: 6px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
}

.chain-btn.motivated:hover {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.48) 0%, rgba(255, 204, 128, 0.38) 35%, rgba(245, 124, 0, 0.52) 70%, rgba(230, 81, 0, 0.42) 100%) !important;
    background-size: 200% 200% !important;
    border-color: rgba(255, 167, 38, 0.95) !important;
    color: #ffffff !important;
    transform: scale(1.05) !important;
    box-shadow: 0 6px 22px rgba(255, 152, 0, 0.5), inset 0 0 16px rgba(255, 183, 77, 0.35) !important;
}

.chain-btn.motivated:active {
    transform: scale(0.94) !important;
}

@keyframes orangeWaveShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Read-only Profile Fields Styling */
.input-readonly,
input[readonly].input-readonly {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: not-allowed !important;
    user-select: text;
    box-shadow: none !important;
}

.input-readonly:focus,
input[readonly].input-readonly:focus {
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: none !important;
    outline: none !important;
}