/* Feed + Landing - index.php */

/* --- Logged-in feed --- */
    body {
        background: linear-gradient(135deg, #1e3a5f 0%, #2d5a7b 100%);
        background-attachment: fixed;
        min-height: 100vh;
    }
    
    .feed-container {
        max-width: 680px;
        margin: 30px auto;
        padding: 0 15px;
        /* Hardware acceleration pentru smooth scroll */
        will-change: transform;
        transform: translateZ(0);
    }
    
    .feed-header {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 20px 24px;
        margin-bottom: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .feed-header h1 {
        margin: 0;
        font-size: 24px;
        color: #1e293b;
        font-weight: 600;
    }
    
    .feed-header p {
        margin: 8px 0 0 0;
        color: #64748b;
        font-size: 14px;
    }
    
    /* Feed Tabs */
    .feed-tabs {
        display: flex;
        gap: 8px;
        margin-top: 16px;
        background: #f1f5f9;
        border-radius: 12px;
        padding: 4px;
    }
    
    .feed-tab {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        border: none;
        background: transparent;
        border-radius: 10px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        color: #64748b;
        transition: all 0.2s;
    }
    
    .feed-tab:hover {
        background: rgba(255, 255, 255, 0.5);
        color: #1e293b;
    }
    
    .feed-tab.active {
        background: white;
        color: #0891b2;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .feed-tab .tab-icon {
        width: 20px;
        height: 20px;
        object-fit: contain;
        flex-shrink: 0;
    }
    
    .feed-tab-content {
        min-height: 200px;
    }
    
    /* Trending badge for popular posts */
    .trending-badge {
        background: linear-gradient(135deg, #f97316, #ef4444);
        color: white;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    /* Feed header actions container */
    .feed-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }
    
    /* Quick follow button - pill style */
    .feed-follow-btn {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        border: none;
        border-radius: 20px;
        padding: 6px 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        font-size: 13px;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    
    .feed-follow-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    
    .feed-follow-btn:active {
        transform: scale(0.98);
    }
    
    .feed-follow-btn.following {
        background: #e2e8f0;
        color: #64748b;
        box-shadow: none;
    }
    
    .feed-follow-btn.following .follow-text {
        display: none;
    }
    
    .feed-follow-btn.following::after {
        content: '✓ Following';
        font-size: 12px;
    }
    
    .feed-item {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        margin-bottom: 16px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s, box-shadow 0.2s;
        /* Hardware acceleration pentru smooth scroll pe mobil */
        will-change: transform;
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .feed-item:hover {
        transform: translateY(-2px) translateZ(0);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }
    
    .feed-user-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .feed-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #06b6d4, #0891b2);
        overflow: visible;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .feed-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .feed-avatar-level-badge {
        position: absolute;
        top: -3px;
        left: -3px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 2px 6px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4), 0 0 10px rgba(102, 126, 234, 0.2);
        z-index: 10;
        border: 1px solid rgba(255, 255, 255, 0.3);
        pointer-events: none;
    }
    .feed-avatar-level-badge .level-diamond {
        font-size: 10px;
        line-height: 1;
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
    }
    .feed-avatar-level-badge .level-diamond img {
        width: 10px;
        height: 10px;
        display: block;
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
    }
    .feed-avatar-level-badge .avatar-level-num {
        color: #fff;
        font-weight: 700;
        font-size: 10px;
        line-height: 1;
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    }
    
    /* Desktop: iconița level prea mare pe web – redimensionată ca pe telefon */
    @media (min-width: 769px) {
        .feed-avatar-level-badge {
            padding: 2px 5px;
            gap: 2px;
            top: -2px;
            left: -2px;
        }
        .feed-avatar-level-badge .level-diamond,
        .feed-avatar-level-badge .level-diamond img {
            width: 8px;
            height: 8px;
        }
        .feed-avatar-level-badge .avatar-level-num {
            font-size: 9px;
        }
    }
    
    .feed-avatar-initial {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 700;
        color: white;
        background: linear-gradient(135deg, #06b6d4, #0891b2);
    }
    
    .feed-user-info {
        flex: 1;
        min-width: 0;
    }
    
    .feed-user-name {
        font-weight: 600;
        color: #1e293b;
        font-size: 15px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    
    .feed-user-name:hover {
        color: #0891b2;
    }
    
    .feed-user-name .verified-badge {
        width: 16px;
        height: 16px;
        object-fit: contain;
        flex-shrink: 0;
        vertical-align: middle;
    }
    .feed-level-badge {
        display: inline-flex; align-items: center; justify-content: center;
        min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
        font-size: 11px; font-weight: 700; color: #fff; margin-left: 6px;
        vertical-align: middle;
    }
    .feed-level-badge.level-rookie { background: linear-gradient(135deg, #9CA3AF, #6B7280); }
    .feed-level-badge.level-conversationalist { background: linear-gradient(135deg, #10B981, #059669); }
    .feed-level-badge.level-influencer { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
    .feed-level-badge.level-expert { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
    .feed-level-badge.level-maestro { background: linear-gradient(135deg, #F97316, #EA580C); }
    .feed-level-badge.level-legend { background: linear-gradient(90deg, #ef4444, #f97316, #22c55e, #3b82f6, #8b5cf6); background-size: 200% 100%; animation: feed-level-rainbow 3s linear infinite; }
    @keyframes feed-level-rainbow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
    
    .feed-time {
        font-size: 12px;
        color: #94a3b8;
        margin-top: 2px;
    }
    
    .feed-question {
        padding: 16px 20px 12px;
        background: #f8fafc;
    }
    
    .feed-question-label {
        font-size: 12px;
        color: #64748b;
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .feed-question-text {
        font-size: 15px;
        color: #334155;
        line-height: 1.5;
        font-weight: 500;
    }
    
    .feed-answer {
        padding: 16px 20px;
    }
    
    .feed-answer-text {
        font-size: 15px;
        color: #1e293b;
        line-height: 1.6;
    }
    
    .feed-answer-media {
        margin-top: 12px;
    }
    
    .feed-answer-media img,
    .feed-answer-media video {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .feed-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 12px 20px;
        border-top: 1px solid #e2e8f0;
        background: #f8fafc;
    }
    
    .feed-like-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: white;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        color: #64748b;
        font-size: 13px;
        font-weight: 500;
        padding: 8px 14px;
        border-radius: 20px;
        transition: all 0.2s;
    }
    
    .feed-like-btn:hover {
        background: #fef2f2;
        border-color: #fecaca;
        color: #ef4444;
    }
    
    .feed-like-btn.liked {
        background: #fef2f2;
        border-color: #fecaca;
        color: #ef4444;
    }
    
    .feed-like-btn .heart-icon {
        display: inline-flex;
        align-items: center;
        transition: transform 0.2s;
    }
    
    .feed-like-btn .heart-icon .heartlike-img {
        width: 14px;
        height: 14px;
        object-fit: contain;
        display: block;
    }
    
    .feed-like-btn:hover .heart-icon {
        transform: scale(1.15);
    }
    
    .feed-view-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: white;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        color: #64748b;
        font-size: 13px;
        font-weight: 500;
        padding: 8px 14px;
        border-radius: 20px;
        transition: all 0.2s;
        text-decoration: none;
        margin-left: auto;
    }
    
    .feed-view-btn:hover {
        background: #ecfeff;
        border-color: #a5f3fc;
        color: #0891b2;
    }
    
    .feed-share-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: white;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        color: #64748b;
        font-size: 13px;
        font-weight: 500;
        padding: 8px 14px;
        border-radius: 20px;
        transition: all 0.2s;
    }
    
    .feed-share-btn:hover {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #3b82f6;
    }
    
    .feed-empty {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 60px 30px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .feed-empty-icon {
        font-size: 60px;
        margin-bottom: 20px;
        opacity: 0.5;
    }
    
    .feed-empty h2 {
        color: #1e293b;
        font-size: 22px;
        margin: 0 0 10px 0;
    }
    
    .feed-empty p {
        color: #64748b;
        font-size: 15px;
        margin: 0 0 24px 0;
    }
    
    .feed-empty-btn {
        display: inline-block;
        background: linear-gradient(135deg, #06b6d4, #0891b2);
        color: white;
        padding: 12px 28px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.2s;
    }
    
    .feed-empty-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(8, 145, 178, 0.4);
    }
    
    /* Responsive */
    @media (max-width: 600px) {
        .feed-container {
            margin: 15px auto;
            padding: 0 10px;
        }
        
        .feed-header {
            padding: 16px 18px;
            border-radius: 12px;
        }
        
        .feed-header h1 {
            font-size: 20px;
        }
        
        .feed-tabs {
            margin-top: 12px;
        }
        
        .feed-tab {
            padding: 10px 12px;
            font-size: 13px;
            gap: 6px;
        }
        
        .feed-tab .tab-icon {
            width: 18px;
            height: 18px;
        }
        
        .trending-badge {
            font-size: 11px;
            padding: 3px 8px;
        }
        
        .feed-follow-btn {
            padding: 5px 12px;
            font-size: 12px;
        }
        
        .feed-header-actions {
            gap: 6px;
        }
        
        .feed-item {
            border-radius: 12px;
            margin-bottom: 12px;
        }
        
        .feed-user-header {
            padding: 14px 16px;
        }
        
        .feed-avatar {
            width: 42px;
            height: 42px;
        }
        
        .feed-avatar-initial {
            font-size: 16px;
        }
        
        .feed-question,
        .feed-answer {
            padding: 14px 16px;
        }
        
        .feed-actions {
            padding: 10px 14px;
            gap: 6px;
        }
        
        .feed-like-btn,
        .feed-share-btn,
        .feed-view-btn {
            font-size: 12px;
            padding: 6px 12px;
            border-radius: 16px;
        }
        
        .feed-share-btn span:last-child,
        .feed-view-btn span:last-child {
            display: none;
        }
        
        .feed-like-btn .heart-icon {
            font-size: 13px;
        }
        
        .feed-empty {
            padding: 40px 20px;
        }
    }


/* --- Landing guest --- */
    /* Accessibility: Visually hidden but available to screen readers */
    .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body {
        background: #0891b2;
        background: linear-gradient(135deg, #06b6d4 0%, #0e7490 50%, #155e75 100%);
        min-height: 100vh;
    }
    
    .hero {
        text-align: center;
        padding: 100px 20px 120px 20px;
        color: white;
        min-height: calc(100vh - 200px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .hero-content {
        margin-bottom: 60px;
    }
    
    .hero h1 {
        font-size: 72px;
        margin-bottom: 40px;
        font-weight: 300;
        color: white;
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
        letter-spacing: -1px;
    }
    
    .hero .join-btn {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        padding: 18px 50px;
        font-size: 16px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        transition: all 0.2s;
        text-decoration: none;
        display: inline-block;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .hero .join-btn:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
    }
    
    .featured-section {
        margin-top: 80px;
        width: 100%;
        max-width: 1100px;
    }
    
    .featured-users-container {
        display: flex;
        align-items: center;
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .featured-users h2 {
        color: white;
        margin: 0;
        font-size: 16px;
        font-weight: 400;
        white-space: nowrap;
    }
    
    .app-buttons {
        display: flex;
        gap: 12px;
        align-items: center;
        margin-left: auto;
    }
    
    .app-btn {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
        padding: 8px 16px;
        color: white;
        text-decoration: none;
        font-size: 13px;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .app-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }
    
    .app-btn-download {
        background: rgba(34, 197, 94, 0.4);
        border-color: rgba(34, 197, 94, 0.6);
    }
    .app-btn-download:hover {
        background: rgba(34, 197, 94, 0.55);
    }
    
    .app-icon {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }
    
    .user-grid {
        display: flex;
        gap: 6px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .user-card {
        background: transparent;
        text-align: center;
        text-decoration: none;
        color: white;
        transition: transform 0.2s;
        padding: 0;
    }
    
    .user-card:hover {
        transform: scale(1.05);
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin: 0;
        border: 2px solid rgba(255, 255, 255, 0.4);
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
    }
    
    .user-avatar-initial {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        border-radius: 50%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        text-shadow: 0 1px 2px rgba(0,0,0,0.2);
        border: 2px solid rgba(255,255,255,0.3);
        box-sizing: border-box;
    }
    
    .user-card .username {
        display: none;
    }
    
    /* Responsive Design */
    @media (max-width: 768px) {
        .hero {
            padding: 60px 15px 80px 15px;
            min-height: calc(100vh - 150px);
        }
        
        .hero h1 {
            font-size: 48px;
            margin-bottom: 30px;
        }
        
        .hero .join-btn {
            padding: 16px 40px;
            font-size: 15px;
        }
        
        .featured-section {
            margin-top: 50px;
        }
        
        .featured-users-container {
            flex-direction: column;
            align-items: center;
            gap: 15px;
        }
        
        .featured-users h2 {
            font-size: 15px;
        }
        
        .app-buttons {
            margin-left: 0;
            justify-content: center;
        }
        
        .app-btn {
            padding: 7px 14px;
            font-size: 12px;
        }
        
        .app-btn-img img {
            height: 36px;
        }
        
        .user-grid {
            gap: 5px;
        }
        
        .user-avatar {
            width: 35px;
            height: 35px;
        }
        
        .user-avatar-initial {
            width: 35px;
            height: 35px;
            font-size: 13px;
            border-width: 2px;
        }
    }
    
    @media (max-width: 480px) {
        .hero {
            padding: 40px 12px 60px 12px;
        }
        
        .hero h1 {
            font-size: 36px;
            margin-bottom: 25px;
            letter-spacing: 0;
        }
        
        .hero .join-btn {
            padding: 14px 35px;
            font-size: 14px;
        }
        
        .featured-section {
            margin-top: 40px;
        }
        
        .featured-users h2 {
            font-size: 14px;
        }
        
        .app-buttons {
            flex-direction: column;
            width: 100%;
        }
        
        .app-btn {
            width: 100%;
            justify-content: center;
            padding: 8px 16px;
        }
        
        .app-btn-img img {
            height: 38px;
        }
        
        .user-avatar {
            width: 32px;
            height: 32px;
        }
        
        .user-avatar-initial {
            width: 32px;
            height: 32px;
            font-size: 11px;
            border-width: 1px;
        }
    }

/* YouTube embed în răspunsuri – play direct pe platformă */
    .feed-answer-text .youtube-embed-wrapper,
    .youtube-embed-wrapper {
        margin: 12px 0;
        border-radius: 12px;
        overflow: hidden;
        max-width: 100%;
        position: relative;
    }
    .feed-answer-text .youtube-embed-wrapper iframe,
    .youtube-embed-wrapper iframe {
        display: block;
        width: 100%;
        max-width: 560px;
        height: 315px;
        border: none;
    }
    .feed-answer-text .mention-link,
    .mention-link {
        color: #0891b2;
        text-decoration: none;
        font-weight: 600;
    }
    .feed-answer-text .mention-link:hover,
    .mention-link:hover {
        color: #0e7490;
        text-decoration: underline;
    }
    .youtube-embed-fallback {
        display: inline-block;
        margin-top: 8px;
        font-size: 13px;
        color: #64748b;
        text-decoration: none;
    }
    .youtube-embed-fallback:hover {
        color: #0891b2;
        text-decoration: underline;
    }
