/* Floating Upload Progress - Instagram Style */
.floating-upload-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    padding: 10px 16px;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.upload-progress-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.upload-thumb-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.upload-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.upload-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: uploadSpin 0.8s linear infinite;
}

@keyframes uploadSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.upload-info span {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.upload-progress-bar-container {
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.floating-upload-progress.success {
    background: linear-gradient(135deg, #4CAF50 0%, #66bb6a 100%);
}

.floating-upload-progress.error {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
}

.activity-feed-page.ig-style {
    min-height: 100vh;
    overflow-x: hidden;
    background: #fff;
    padding-bottom: 80px;
}

.fab-new-post {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

.fab-new-post:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
    color: #fff;
}

.fab-new-post:active {
    transform: scale(0.95);
}

.fab-new-post svg {
    width: 20px;
    height: 20px;
    stroke: #fff !important;
}

.feed-search-bar {
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #efefef;
}

.feed-search-form {
    margin: 0;
}

.feed-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafa;
    border: 1px solid #efefef;
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.2s;
}

.feed-search-input-wrap:focus-within {
    border-color: #22c55e;
    background: #ffffff;
}

.feed-search-icon {
    color: #8e8e8e;
    flex-shrink: 0;
}

.feed-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 11px 0;
    font-size: 0.9rem;
    color: #262626;
    font-family: inherit;
    outline: none;
}

.feed-search-input::placeholder {
    color: #b0b0b0;
}

.feed-tabs-ig {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 99;
}

.feed-tab-ig {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: #8e8e8e;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.feed-tab-ig.active {
    color: #22c55e;
    border-bottom-color: #22c55e;
}

.feed-tab-ig:hover {
    color: #555;
}

.feed-container {
    background: #fff;
}

/* Legacy hero styles - hidden for IG style */
.ig-style .feed-hero { display: none; }

/* Legacy Feed Tabs */
.feed-tabs {
    display: none;
}

.feed-tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.feed-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.feed-tab.active {
    background: #ffffff;
    color: #333333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Spotlight Section - Just Posted */
.spotlight-section {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(139, 195, 74, 0.1) 100%);
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: 16px;
    padding: 12px;
    animation: spotlight-glow 2s ease-in-out infinite;
}

@keyframes spotlight-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.2); }
    50% { box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0.3); }
}

.spotlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
}

.spotlight-badge {
    font-weight: 700;
    font-size: 0.9rem;
    color: #2e7d32;
    background: rgba(76, 175, 80, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.spotlight-dismiss {
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.spotlight-dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.spotlight-card {
    border: 2px solid rgba(76, 175, 80, 0.3) !important;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15) !important;
}

.fab-button {
    position: fixed;
    /* Posisi di atas navigasi bawah, hormati safe-area iPhone (home indicator). */
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff4757 100%);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6), 0 8px 32px rgba(255, 71, 87, 0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fab-pulse 2s infinite;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.fab-button span {
    color: #ffffff !important;
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.fab-button:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.7), 0 12px 40px rgba(255, 71, 87, 0.4);
    color: #ffffff !important;
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .fab-button {
        animation: none;
    }
}

/* Feed Timeline */
.feed-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Feed Card */
.feed-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    isolation: isolate;
}

.feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.feed-sport-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.85);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 5;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.feed-main-bareng-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(103, 126, 234, 0.5);
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(103, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 2px 16px rgba(103, 126, 234, 0.8);
    }
}

/* Photo count badge - shows when multiple photos exist */
.feed-photo-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.75);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
}

/* Photo Carousel Styles */
.feed-photo-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot.active {
    background: #ffffff;
    transform: scale(1.2);
}

.feed-card-media {
    position: relative;
    overflow: hidden;
}

.feed-card-media.has-photo {
    /* Let photo determine height with max limit */
    max-height: 400px;
}

.feed-card-media.no-photo {
    /* Fixed height for sport hero placeholder */
    height: 90px;
}

.feed-card-photo {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    background: #f5f5f5;
}

/* Sport-specific hero images */
.feed-card-sport-hero {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.feed-card-sport-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
}

.feed-hero-badminton {
    background-image: url('/static/images/hero/badminton-hero.jpg');
}

.feed-hero-tennis {
    background-image: url('/static/images/hero/tennis-hero.jpg');
}

.feed-hero-padel {
    background-image: url('/static/images/hero/padel-hero.jpg');
}

.feed-hero-pickleball {
    background-image: url('/static/images/hero/pickleball-hero.jpg');
}

.feed-hero-general {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* News Card Styles */
.news-card {
    border-left: 4px solid #3b82f6;
}

.feed-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.video-badge {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
}

.tiktok-badge {
    background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
    color: white;
}

.youtube-card {
    border-left: 4px solid #ff0000;
}

.tiktok-card {
    border-left: 4px solid #00f2ea;
}

.rss-video-card {
    border-left: 4px solid #6c5ce7;
}

.tiktok-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,242,234,0.3) 0%, rgba(255,0,80,0.3) 100%);
    z-index: 4;
    pointer-events: none;
}

.tiktok-play-overlay .play-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.youtube-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    z-index: 4;
    pointer-events: auto;
    cursor: pointer;
}

.youtube-play-overlay .play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,0,0,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.feed-source-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.news-source-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.news-source-icon svg {
    width: 20px;
    height: 20px;
}

.save-btn, .share-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1.1rem;
}

.save-btn:hover, .share-btn:hover {
    background: #f5f5f5;
}

.save-btn.saved .save-icon {
    color: #667eea;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    color: #666;
}

.feed-card-content {
    padding: 16px;
}

.feed-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.feed-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
}

.feed-card-meta {
    display: flex;
    flex-direction: column;
}

.feed-player-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.feed-time {
    font-size: 0.75rem;
    color: #999;
}

.feed-card-text-container {
    margin-bottom: 8px;
}

.feed-card-title {
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    font-size: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card-desc {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card-desc.news-full-desc {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.feed-read-more {
    display: inline-block;
    color: #667eea;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 12px;
}

.feed-read-more:hover {
    text-decoration: underline;
    color: #764ba2;
}

.feed-card-actions {
    display: flex;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.like-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.like-btn:hover {
    background: #f5f5f5;
}

.like-btn.liked .like-icon {
    animation: heartBeat 0.3s ease;
}

.like-count, .comment-count {
    font-size: 0.875rem;
    color: #666;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* YouTube Modal Styles - Full Screen Player */
.youtube-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
}

.youtube-modal.active {
    display: block;
}

.youtube-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Close button - floating top right */
.youtube-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.youtube-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Title overlay at bottom - pointer-events none to allow video control access */
.youtube-modal-title {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9998;
    pointer-events: none;
    text-align: center;
    max-height: 80px;
    overflow: hidden;
}

/* Modal content - full screen */
.youtube-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Player container - full viewport */
.youtube-player-container {
    width: 100vw;
    height: 100vh;
}

.youtube-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* AI Summary styling - show full summary without truncation */
.feed-card-desc.ai-summary {
    color: #555;
    font-style: normal;
    border-left: 3px solid #667eea;
    padding-left: 10px;
    margin-left: 0;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    overflow: visible !important;
    max-height: none !important;
    text-overflow: unset !important;
}

.feed-card-desc.ai-summary::before {
    content: "Rangkuman: ";
    font-weight: 600;
    color: #667eea;
}

/* Extra specificity for YouTube cards */
.youtube-card .feed-card-desc.ai-summary,
.news-card .feed-card-desc.ai-summary,
.feed-card .feed-card-desc.ai-summary {
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    box-orient: unset !important;
    overflow: visible !important;
    max-height: none !important;
    text-overflow: unset !important;
    white-space: normal !important;
}

/* Threads-style Feed Cards */
.feed-card-threads {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px 0;
    cursor: pointer;
}

.repost-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 8px 46px;
    font-size: 0.78rem;
    color: #8e8e8e;
    font-weight: 600;
    cursor: pointer;
}

.repost-header:hover span {
    text-decoration: underline;
}

.repost-btn.reposted .repost-icon {
    stroke: #22c55e;
}

.quote-embed-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0 4px;
    background: #fafafa;
    cursor: pointer;
    transition: background 0.15s;
}

.quote-embed-card:hover {
    background: #f0f0f0;
}

.quote-embed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.quote-embed-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.quote-embed-avatar-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.quote-embed-username {
    font-weight: 600;
    font-size: 0.82rem;
    color: #262626;
}

.quote-embed-time {
    font-size: 0.75rem;
    color: #8e8e8e;
    margin-left: auto;
}

.quote-embed-text {
    font-size: 0.85rem;
    color: #262626;
    line-height: 1.4;
    margin-bottom: 4px;
}

.quote-embed-media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
    max-height: 200px;
}

.quote-embed-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.quote-embed-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.repost-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.repost-sheet-overlay.show {
    display: flex;
}

.repost-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    padding: 8px 0 24px;
    animation: sheetSlideUp 0.25s ease-out;
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.repost-sheet-handle {
    width: 36px;
    height: 4px;
    background: #d1d1d1;
    border-radius: 2px;
    margin: 4px auto 12px;
}

.repost-sheet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #262626;
    cursor: pointer;
    transition: background 0.15s;
}

.repost-sheet-option:hover {
    background: #f5f5f5;
}

.quote-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    animation: sheetSlideUp 0.25s ease-out;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.quote-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #efefef;
}

.quote-modal-close {
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #8e8e8e;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.quote-modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #262626;
}

.quote-modal-submit {
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.quote-modal-submit:hover {
    background: #1ea84e;
}

.quote-modal-body {
    padding: 16px 20px 24px;
}

.quote-modal-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    color: #262626;
    background: transparent;
    line-height: 1.5;
}

.quote-modal-input::placeholder {
    color: #b0b0b0;
}

.threads-layout {
    display: flex;
    gap: 10px;
}

.threads-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.threads-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.threads-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.threads-line {
    width: 2px;
    flex: 1;
    background: #e0e0e0;
    margin: 6px 0 0;
    border-radius: 1px;
    min-height: 12px;
}

.threads-content-col {
    flex: 1;
    min-width: 0;
    padding-bottom: 12px;
}

.threads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.threads-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.threads-username {
    font-weight: 700;
    font-size: 0.9rem;
    color: #000;
    cursor: pointer;
}

.threads-elo {
    display: inline-block;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

.threads-time {
    font-size: 0.8rem;
    color: #999;
}

.threads-text {
    color: #000;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
}

.feed-bracket-wrap {
    margin: 8px 0;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}
.feed-bracket-container {
    overflow-x: auto;
    padding: 10px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.feed-bracket-container::-webkit-scrollbar { display: none; }
.feed-bracket-tree {
    display: flex;
    align-items: stretch;
    min-width: max-content;
}
.feed-bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    max-width: 120px;
}
.feed-bracket-round-title {
    font-size: 0.58rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
    padding: 0 0 6px;
    white-space: nowrap;
}
.feed-bracket-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 4px;
    padding: 0 3px;
}
.feed-bracket-match-wrap { position: relative; }
.feed-bracket-match {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.feed-bracket-match.completed { border-color: #bbf7d0; }
.feed-bracket-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    font-size: 0.62rem;
    color: #666;
}
.feed-bracket-player:first-child { border-bottom: 0.5px solid #f5f5f5; }
.feed-bracket-player.winner { color: #22c55e; font-weight: 700; }
.feed-bracket-player.tbd { color: #ccc; }
.feed-bracket-score { font-weight: 700; font-size: 0.62rem; }
.feed-bracket-winner-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0 4px;
}
.feed-bracket-winner-name {
    font-size: 0.62rem;
    font-weight: 800;
    color: #22c55e;
    text-align: center;
    white-space: nowrap;
}
.feed-bracket-round:not(:first-child) .feed-bracket-matches .feed-bracket-match-wrap::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    width: 3px;
    height: 1.5px;
    background: #e0e0e0;
}
.feed-bracket-round:not(:first-child) .feed-bracket-matches .feed-bracket-match-wrap.completed-path::before {
    background: #bbf7d0;
}

.threads-media {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.threads-media .video-container-ig {
    border-radius: 10px;
    overflow: hidden;
}

.threads-media .photo-carousel-ig {
    border-radius: 10px;
    overflow: hidden;
}

.threads-media .photo-ig {
    border-radius: 0;
}

.threads-follow-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid #22c55e;
    color: #22c55e;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    margin-left: 6px;
}

.threads-follow-btn:hover,
.threads-follow-btn.following {
    background: #22c55e;
    color: #fff;
}

.threads-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0 2px;
}

.threads-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #999;
    transition: transform 0.15s;
}

.threads-action-btn:hover {
    transform: scale(1.1);
}

.threads-action-btn.liked .like-icon {
    fill: #ff4757;
    color: #ff4757;
    animation: heartPop 0.3s ease;
}

.threads-action-btn.saved .save-icon {
    fill: #262626;
    color: #262626;
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Legacy IG classes kept for compatibility */
.feed-card-ig { display: none; }

.avatar-ig {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.avatar-placeholder-ig {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.news-avatar-ig {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.news-icon-yt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff0000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.news-icon-globe {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.feed-type-badge-ig {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    z-index: 5;
}

.feed-type-badge-ig.video {
    background: #ff0000;
}

.feed-type-badge-ig.news {
    background: #3b82f6;
}

.header-info-ig {
    flex: 1;
}

.username-ig {
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
}

.elo-badge-ig {
    display: inline-block;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.time-ig {
    font-size: 0.8rem;
    color: #8e8e8e;
}

.card-media-ig {
    position: relative;
    background: #111;
    min-height: 200px;
}

.video-container-ig {
    position: relative;
    width: 100%;
    background: #000;
    touch-action: pan-y;
}

.video-container-ig.portrait {
    aspect-ratio: 4/5;
    max-height: 65vh;
    overflow: hidden;
}

.video-container-ig.landscape {
    aspect-ratio: 4/5;
}

/* Blur background for portrait videos - Instagram/TikTok style */
.video-blur-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: 0;
    opacity: 0.7;
}

.video-thumb-ig, .video-player-ig {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-player-ig {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s;
    touch-action: pan-y;
}

/* Portrait video specific - ensure content above blur */
.video-container-ig.portrait .video-thumb-ig {
    position: relative;
    z-index: 2;
    background: transparent;
}

.video-container-ig.portrait .video-player-ig {
    z-index: 2;
    background: transparent;
}

.video-container-ig.portrait .video-play-overlay-ig,
.video-container-ig.portrait .video-mute-btn-ig,
.video-container-ig.portrait .video-duration-ig {
    z-index: 3;
}

.video-container-ig.playing .video-player-ig {
    opacity: 1;
}

.video-container-ig.playing .video-thumb-ig {
    opacity: 0;
}

.video-play-overlay-ig {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s;
}

.video-container-ig.playing .video-play-overlay-ig {
    opacity: 0;
    pointer-events: none;
}

.play-btn-ig {
    font-size: 2rem;
    color: #fff;
    margin-left: 4px;
}

.video-mute-btn-ig {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 6;
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.1s;
}

.video-mute-btn-ig:active {
    transform: scale(0.9);
}

.video-mute-btn-ig svg {
    width: 16px;
    height: 16px;
}

.video-duration-ig {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-container-ig.youtube {
    cursor: pointer;
}

.video-container-ig.youtube.landscape {
    aspect-ratio: 16/9 !important;
}

.video-container-ig.youtube.portrait {
    aspect-ratio: 9/16 !important;
    max-height: 80vh;
}

.video-container-ig.youtube .video-thumb-ig {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.feed-card-threads .video-container-ig.youtube.landscape {
    aspect-ratio: 4/5 !important;
}

.feed-card-threads .video-container-ig.youtube.portrait {
    aspect-ratio: 9/16 !important;
    max-height: 85vh;
}

.play-btn-ig.yt-icon {
    background: #ff0000;
    color: white;
}

.youtube-play-overlay-ig {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255,0,0,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-play-btn-ig {
    font-size: 2rem;
    color: #fff;
    margin-left: 4px;
}

.photo-carousel-ig {
    position: relative;
    width: 100%;
    overflow: hidden;
    max-height: 65vh;
}

.carousel-track-ig {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track-ig::-webkit-scrollbar {
    display: none;
}

.carousel-slide-ig {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
}

.photo-ig {
    width: 100%;
    aspect-ratio: 4/5;
    max-height: 65vh;
    object-fit: cover;
}

.carousel-dots-ig {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.carousel-dot-ig {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
}

.carousel-dot-ig.active {
    background: #fff;
}

.photo-counter-ig {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.no-media-placeholder-ig {
    width: 100%;
    aspect-ratio: 4/5;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sport-hero-fallback-ig {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #1a472a;
}

.placeholder-icon-ig {
    font-size: 4rem;
    opacity: 0.4;
    color: #8e8e8e;
}

/* Legacy card-actions/content kept for news cards */
.card-actions-ig {
    display: flex;
    padding: 8px 16px;
    gap: 16px;
}

.action-btn-ig {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-content-ig {
    padding: 8px 16px 12px;
}

.caption-ig {
    color: #262626;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.caption-text-ig {
    font-weight: 400;
}

.view-comments-ig {
    color: #8e8e8e;
    font-size: 0.85rem;
    text-decoration: none;
}

/* Feed Timeline IG style */
.ig-style .feed-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Product Link Card in Feed */
.feed-product-card {
    margin-top: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.feed-product-gallery {
    position: relative;
    overflow: hidden;
}

.feed-product-gallery-track {
    display: flex;
    transition: transform 0.3s ease;
    touch-action: pan-y;
}

.feed-product-slide {
    min-width: 100%;
    aspect-ratio: 1/1;
}

.feed-product-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
}

.feed-product-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    z-index: 2;
    color: #333;
}

.feed-product-nav.prev { left: 8px; }
.feed-product-nav.next { right: 8px; }

.feed-product-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.feed-product-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    background: #fff;
}

.feed-product-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.2s;
}

.feed-product-dot.active {
    background: #22c55e;
}

.feed-product-info {
    padding: 12px 14px 14px;
}

.feed-product-platform {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.feed-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #262626;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-product-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.feed-product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #262626;
}

.feed-product-original {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
}

.feed-product-discount {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ff4757;
    background: #fff0f0;
    padding: 1px 5px;
    border-radius: 4px;
}

.feed-product-shop-row {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.feed-product-rating {
    color: #ffa500;
    margin-left: 4px;
}

.feed-product-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s;
}

.feed-product-buy-btn:hover {
    opacity: 0.9;
    color: white;
    text-decoration: none;
}

.fmt-list-item {
    display: block;
    padding-left: 20px;
    text-indent: -8px;
    margin: 1px 0;
}
.fmt-numbered { padding-left: 22px; text-indent: -14px; }
.fmt-bullet { padding-left: 20px; text-indent: -10px; }
.fmt-lettered { padding-left: 22px; text-indent: -14px; }

.fmt-heading {
    display: block;
    font-weight: 700;
    color: #1a1a1a;
    margin: 4px 0 2px;
}
.fmt-h1 { font-size: 1.05rem; }
.fmt-h2 { font-size: 0.95rem; }
.fmt-h3 { font-size: 0.88rem; }

.math-inline {
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}
.math-block {
    display: block;
    text-align: center;
    margin: 8px 0;
    overflow-x: auto;
}
.fmt-table-wrap {
    overflow-x: auto;
    margin: 8px 0;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #efefef;
}
.fmt-table {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
    font-size: 0.82rem;
    line-height: 1.5;
}
.fmt-table th,
.fmt-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #efefef;
    text-align: left;
    vertical-align: top;
}
.fmt-table th {
    background: #f5f5f5;
    font-weight: 700;
    color: #262626;
    font-size: 0.78rem;
    white-space: nowrap;
    border-bottom: 2px solid #e0e0e0;
}
.fmt-table td {
    color: #333;
}
.fmt-table tbody tr:nth-child(even) {
    background: #fafafa;
}
.fmt-table tbody tr:last-child td {
    border-bottom: none;
}

@media (min-width: 768px) {
    .activity-feed-page.ig-style {
        max-width: 470px;
        margin: 0 auto;
        border-left: 1px solid #efefef;
        border-right: 1px solid #efefef;
    }

    .feed-search-bar {
        max-width: 470px;
        margin-left: auto;
        margin-right: auto;
    }

    .feed-tabs-ig {
        max-width: 470px;
        margin-left: auto;
        margin-right: auto;
    }

    .fab-new-post {
        right: calc(50% - 235px + 16px);
    }
}

/* Quill rich text content rendering */
.quill-content { line-height: 1.6; color: #262626; word-break: break-word; }
.quill-content p { margin: 0 0 0.35em; }
.quill-content p:last-child { margin-bottom: 0; }
.quill-content strong, .quill-content b { font-weight: 700; }
.quill-content em, .quill-content i { font-style: italic; }
.quill-content u { text-decoration: underline; }
.quill-content ol, .quill-content ul { padding-left: 1.5em; margin: 0.35em 0; }
.quill-content li { margin: 0.1em 0; }
.quill-content h1 { font-size: 1.15em; font-weight: 700; margin: 0.4em 0 0.2em; }
.quill-content h2 { font-size: 1.05em; font-weight: 700; margin: 0.3em 0 0.15em; }
.quill-content .ql-align-center { text-align: center; }
.quill-content .ql-align-right { text-align: right; }
.quill-content .ql-align-justify { text-align: justify; }
.quill-content table { border-collapse: collapse; width: 100%; margin: 0.5em 0; font-size: 0.88em; }
.quill-content table td, .quill-content table th { border: 1px solid #e0e0e0; padding: 5px 8px; text-align: left; }
.quill-content table th { background: #f5f5f5; font-weight: 600; }
/* Feed card preview — clamp ke ~6 baris dengan ellipsis.
   Pakai -webkit-line-clamp supaya caption pendek tidak tertindih
   overlay putih (yang bikin teks terlihat pudar). */
.quill-preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Fallback bila browser tidak mendukung line-clamp:
       batasi tinggi dengan kelipatan line-height (1.6 × 6 baris = 9.6em). */
    max-height: 9.6em;
}
