/* Profile.css - Mobile-optimized with sticky header */

:root {
    --primary-accent: #ffd700;
    --secondary-accent: #a78bfa;
    --tertiary-accent: #4ade80;
    --bg-primary: #0f0a06;
    --bg-secondary: #1a1410;
    --bg-tertiary: #221a12;
    --border-color: #3d2f24;
    --border-light: #52413a;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --primary-gold: #d4a574;
    --light-gold: #e8c4a0;
    --warm-cream: #d1f4e8;
    --card-dark: #161b22;
    --card-brown: #1a1f26;
    --border-brown: #30363d;
    --purple: #a78bfa;
    --light-purple: #c4b5fd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Manakahthey', 'Noto Sans Hebrew';
    background: var(--bg-primary);
    color: #f0f4f8;
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================================
   STICKY PROFILE HEADER
   ============================================================ */

.sticky-profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 20, 16, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.sticky-profile-header.visible {
    transform: translateY(0);
}

.sticky-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.sticky-info {
    flex: 1;
    min-width: 0;
}

.sticky-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sticky-stats strong {
    color: var(--primary-gold);
}

/* ============================================================
   OLD NAV BAR (removed - using community-nav.css)
   ============================================================ */

/* Styles moved to community-nav.css */

/* ============================================================
   JUDEAN QUOTE
   ============================================================ */

.judean-quote-section {
    margin-top: 0.5rem;
    text-align: center;
    position: relative;
}

.judean-quote {
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    font-size: 1.1rem;
    color: var(--warm-cream);
    opacity: 0.9;
    direction: rtl;
    margin: 0;
    min-height: 1.4em;
}

.btn-edit-quote {
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0.2rem;
}

.btn-edit-quote:hover {
    opacity: 1;
}

.quote-edit {
    margin-top: 0.5rem;
}

.quote-edit input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: var(--card-dark);
    border: 1px solid var(--border-brown);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Manakahthey', 'Noto Sans Hebrew', serif;
    font-size: 1rem;
    text-align: center;
    direction: rtl;
}

.quote-edit .edit-buttons {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.4rem;
}

.quote-edit button {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
}

/* ============================================================
   MOBILE STATS BAR (Supporters only)
   ============================================================ */

.mobile-stats {
    display: none;
    background: var(--card-brown);
    border: 1px solid var(--border-brown);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mobile-stat {
    text-align: center;
    min-width: 50px;
}

.mobile-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-purple);
}

.mobile-stat-label {
    font-size: 0.65rem;
    color: var(--warm-cream);
    opacity: 0.7;
    text-transform: uppercase;
}

.mobile-stat.positive .mobile-stat-value {
    color: var(--success);
}

.mobile-stat.negative .mobile-stat-value {
    color: var(--error);
}

/* ============================================================
   STATE CONTAINERS (Loading, Login Required, Not Found)
   ============================================================ */

.state-container {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-primary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.state-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.state-text {
    color: var(--warm-cream);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--purple);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

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

.profile-header {
    background: linear-gradient(135deg, var(--card-brown) 0%, var(--card-dark) 100%);
    padding: 1.5rem 1rem;
    border-bottom: 2px solid var(--border-brown);
}

.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

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

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    background-size: cover;
    background-position: center;
}

.btn-edit-avatar {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--light-purple);
    border: 2px solid var(--card-brown);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

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

.name-badges-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.profile-name {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
}

/* Badges */
#badgeContainer {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-elder {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-trusted {
    background: rgba(138, 79, 255, 0.15);
    color: var(--light-purple);
    border: 1px solid rgba(138, 79, 255, 0.3);
}

.badge-new {
    background: rgba(100, 200, 100, 0.1);
    color: #7FD17F;
    border: 1px solid rgba(100, 200, 100, 0.3);
}

.badge-supporter {
    background: rgba(138, 79, 255, 0.2);
    color: #B794F6;
    border: 1px solid rgba(138, 79, 255, 0.4);
}

/* Bio */
.profile-bio {
    color: var(--warm-cream);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0;
    opacity: 0.9;
}

.btn-edit-bio {
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border-brown);
    border-radius: 6px;
    color: var(--warm-cream);
    cursor: pointer;
    font-size: 0.75rem;
}

#bioEdit textarea {
    width: 100%;
    min-height: 70px;
    padding: 0.6rem;
    background: var(--card-dark);
    border: 1px solid var(--border-brown);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

#bioEdit .edit-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#bioEdit button {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-save {
    background: var(--purple);
    border: none;
    color: white;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-brown);
    color: var(--warm-cream);
}

/* Reputation Row */
.reputation-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    width: fit-content;
}

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

.reputation-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-gold);
    line-height: 1;
}

.reputation-value.approval {
    color: var(--light-purple);
}

.reputation-label {
    font-size: 0.7rem;
    color: var(--warm-cream);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

.reputation-divider {
    width: 1px;
    height: 35px;
    background: var(--border-brown);
}

.join-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

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

.stats-card {
    background: var(--card-brown);
    border: 1px solid var(--border-brown);
    border-radius: 10px;
    padding: 1rem;
}

.stats-card h3 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-brown);
}

.positive-card h3 {
    color: var(--success);
}

.negative-card h3 {
    color: var(--error);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.stat-row-label {
    color: var(--warm-cream);
    opacity: 0.8;
}

.stat-row-value {
    color: var(--text-primary);
    font-weight: 600;
}

.stat-row-value.positive {
    color: var(--success);
}

.stat-row-value.negative {
    color: var(--error);
}

/* ============================================================
   FEED & TABS
   ============================================================ */

.feed {
    min-width: 0;
}

.profile-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-brown);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.profile-tab-btn {
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--warm-cream);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    opacity: 0.7;
    transition: all 0.2s;
}

.profile-tab-btn:hover {
    opacity: 1;
}

.profile-tab-btn.active {
    color: var(--light-purple);
    border-bottom-color: var(--light-purple);
    opacity: 1;
}

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

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

.tab-description {
    color: var(--warm-cream);
    opacity: 0.7;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-brown);
}

/* ============================================================
   NEW POST FORM
   ============================================================ */

.new-post-form {
    background: var(--card-brown);
    border: 1px solid var(--border-brown);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.new-post-form h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
}

.new-post-form textarea {
    width: 100%;
    min-height: 70px;
    padding: 0.6rem;
    background: var(--card-dark);
    border: 1px solid var(--border-brown);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.new-post-form input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    background: var(--card-dark);
    border: 1px solid var(--border-brown);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.new-post-form .form-hint {
    font-size: 0.75rem;
    color: var(--warm-cream);
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.new-post-form button {
    padding: 0.5rem 1.25rem;
    background: var(--purple);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ============================================================
   POST CARD
   ============================================================ */

.post-card {
    background: var(--card-brown);
    border: 1px solid var(--border-brown);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.post-author-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.post-date {
    font-size: 0.75rem;
    color: var(--warm-cream);
    opacity: 0.5;
}

.post-delete-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.4;
    padding: 0.25rem;
}

.post-delete-btn:hover {
    opacity: 1;
}

.post-text {
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.post-link {
    color: var(--light-purple);
    word-break: break-all;
    font-size: 0.85rem;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 0.75rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Comments */
.post-comments-section {
    border-top: 1px solid var(--border-brown);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.comment {
    padding: 0.5rem;
    background: rgba(138, 79, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}

.comment-author-link {
    color: var(--light-purple);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
}

.comment-date {
    font-size: 0.7rem;
    color: var(--warm-cream);
    opacity: 0.5;
}

.comment-text {
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.no-comments {
    color: var(--warm-cream);
    opacity: 0.5;
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem;
}

.comment-form {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.comment-input {
    flex: 1;
    padding: 0.5rem 0.6rem;
    background: var(--card-dark);
    border: 1px solid var(--border-brown);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.comment-submit-btn {
    padding: 0.5rem 0.8rem;
    background: var(--light-purple);
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ============================================================
   TOPIC/VERSE/COMMENTARY CARDS
   ============================================================ */

.topic-card,
.verse-card,
.commentary-card {
    background: var(--card-brown);
    border: 1px solid var(--border-brown);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.topic-title,
.verse-topic-link {
    color: var(--light-purple);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.topic-meta {
    font-size: 0.8rem;
    color: var(--warm-cream);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.verse-reference {
    color: var(--primary-gold);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.verse-translation {
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0.75rem;
    background: rgba(220, 150, 50, 0.06);
    border-radius: 6px;
    margin: 0.75rem 0;
    font-style: italic;
    font-size: 0.9rem;
}

.verse-rating-buttons {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.rate-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border-brown);
    background: transparent;
    color: var(--warm-cream);
}

.rate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rate-btn.active {
    background: rgba(138, 79, 255, 0.2);
    border-color: var(--purple);
    color: var(--light-purple);
}

.commentary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.commentary-topic {
    color: var(--light-purple);
    font-weight: 600;
    font-size: 0.95rem;
}

.commentary-verse {
    color: var(--warm-cream);
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.2rem;
}

.commentary-approval {
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.commentary-approval.good {
    background: rgba(100, 200, 100, 0.1);
    color: #7FD17F;
}

.commentary-approval.ok {
    background: rgba(255, 200, 100, 0.1);
    color: #FFC864;
}

.commentary-approval.low {
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
}

.commentary-text {
    color: var(--text-primary);
    line-height: 1.5;
    font-style: italic;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.commentary-reactions {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.commentary-reactions .positive { color: var(--success); }
.commentary-reactions .neutral { color: var(--warning); }
.commentary-reactions .negative { color: var(--error); }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--warm-cream);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.empty-state p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--warm-cream);
    opacity: 0.6;
    border-top: 1px solid var(--border-brown);
    margin-top: 2rem;
    font-size: 0.85rem;
}

footer a {
    color: var(--light-purple);
    text-decoration: none;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    /* Show mobile stats for supporters */
    .mobile-stats {
        display: flex;
    }
}

@media (max-width: 600px) {
    /* Header stacks vertically */
    .profile-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 1.75rem;
    }
    
    .profile-name {
        font-size: 1.3rem;
    }
    
    .name-badges-row {
        justify-content: center;
    }
    
    /* Reputation centered */
    .reputation-row {
        justify-content: center;
        width: 100%;
        max-width: 240px;
        margin: 0.75rem auto 0;
        padding: 0.6rem 0.75rem;
    }
    
    .reputation-value {
        font-size: 1.4rem;
    }
    
    .reputation-label {
        font-size: 0.65rem;
    }
    
    /* Nav compact */
    .nav-logo img {
        width: 30px;
        height: 30px;
    }
    
    .nav-profile-name {
        font-size: 0.95rem;
    }
    
    /* Tabs scroll */
    .profile-tabs {
        gap: 0;
    }
    
    .profile-tab-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Posts full width */
    .post-card,
    .topic-card,
    .verse-card,
    .commentary-card {
        padding: 0.85rem;
    }
    
    /* Sticky header compact */
    .sticky-profile-header {
        padding: 0.5rem 0.75rem;
    }
    
    .sticky-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .sticky-name {
        font-size: 0.85rem;
    }
    
    .sticky-stats {
        font-size: 0.7rem;
    }
    
    /* Judean quote smaller */
    .judean-quote {
        font-size: 0.95rem;
    }
    
    /* Mobile stats compact */
    .mobile-stats {
        padding: 0.6rem;
    }
    
    .mobile-stat-value {
        font-size: 1rem;
    }
    
    /* Free user profile - clean look */
    .profile-header.free-user .reputation-row {
        display: none;
    }
}

/* ============================================================
   END OF STYLES
   ============================================================ */
