/* =========================================================
 * === FEED.CSS (CLEANED FINAL VERSION) ====================
 * ========================================================= */

/* --- 1. TEMEL AYARLAR & RESET --- */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

/* Scroll Fix: Sadece taşmayı engelle */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* 3D Hardware Acceleration & Perspective */
.pro-card, .minimal-badge-card, .modal-content, .sticky-comment-bar, .modal-dialog, .detail-badge-card {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
}

.feed-container {
    max-width: 650px;
    margin: 0 auto;
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .feed-container {
        padding-left: 0px;
        padding-right: 0px;
    }
}

/* --- 2. KART YAPILARI (.pro-card & .minimal-badge-card) --- */
.pro-card, .minimal-badge-card {
    background-color: var(--bg-card);
    border: none;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    /* Varsayılan mobil görünüm (sonradan medya sorguları ile ezilir) */
    border-radius: 0;
    margin-bottom: 1px; 
}

/* Mobil için özel son kural (v13 ve genel) */
@media (max-width: 991.98px) {
    .pro-card, .minimal-badge-card, .feed-v13 .pro-card {
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        border-top: none;
        margin-bottom: 10px !important;
        box-shadow: none;
        border-bottom: 1px solid var(--border-color);
    }
    .pro-hero-wrapper {
        padding-top: 0;
    }
}

/* Desktop görünüm */
@media (min-width: 768px) {
    .pro-card, .minimal-badge-card {
        border: 1px solid var(--border-color);
        border-radius: 12px !important;
        margin-bottom: 0px !important;
    }
}

/* --- 3. KART HEADER & META --- */
.pro-card-header {
    padding: 12px 15px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.pro-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-grow: 1;
    min-width: 0;
}

.pro-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.pro-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.pro-meta h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    text-align: left;
}

.pro-meta span.time-subtext {
    font-size: 0.8rem;
    color: var(--text-muted1);
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.header-team-name {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
}

.header-repost-icon {
    color: #2ecc71;
    font-size: 0.9rem;
    margin: 0 4px;
}

.header-user-name {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted1);
}

.pro-options {
    color: var(--text-muted1);
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 0 10px;
}

.dropdown-menu {
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-feed-follow {
    background: none;
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 10px;
    margin-left: 8px;
    transition: all 0.2s;
}

.btn-feed-follow.following {
    border-color: var(--border-color);
    color: var(--text-muted1);
}

/* --- 4. İÇERİK & MEDYA --- */
.pro-card-content {
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 4px 15px 12px 15px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.pro-card-media {
    width: 100%;
    display: block;
    position: relative;
    background-color: var(--bg-card-secondary);
    margin-bottom: 0;
}

.pro-card-media img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
    touch-action: manipulation;
    cursor: default;
}

.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 0;
}

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

.lightbox-trigger {
    cursor: zoom-in;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: 0.3s;
}

/* --- 5. AKSİYONLAR & FOOTER --- */
.pro-card-actions {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-item {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: var(--text-muted1);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    cursor: pointer;
}

.action-item span {
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.action-item.liked {
    color: #e74c3c;
}

.action-item.btn-save {
    margin-left: auto;
}

.pro-card-footer {
    color: var(--text-label);
    padding: 0 15px 12px 15px;
    font-size: 0.7rem !important;
    text-align: right;
    border-top: 1px solid var(--border-color-subtle, #27272a);
}

.btn-goto-post {
    color: var(--text-muted1);
    opacity: 0.5;
    font-size: 0.9rem;
    padding: 0 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-goto-post:hover {
    color: var(--brand-blue);
    opacity: 1;
    transform: translateX(3px);
}

/* --- 6. ROZET (BADGE) KARTI - MİNİMAL --- */
.minimal-badge-card {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.08), var(--bg-card) 40%);
    border-left: 4px solid var(--accent-primary, #FFD700) !important;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
}

.badge-bg-watermark {
    position: absolute;
    top: -10px;
    right: -15px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(15deg);
    pointer-events: none;
    z-index: 0;
    color: var(--text-main);
}

@media (max-width: 767px) {
    .minimal-badge-card {
        border-left-width: 3px !important;
        padding: 8px 12px;
    }
    .badge-bg-watermark {
        font-size: 4rem;
        top: -5px;
        right: -10px;
    }
}

.badge-pos-Kaleci { border-left-color: #FFD700 !important; }
.badge-pos-Defans { border-left-color: #3498db !important; }
.badge-pos-Orta\.Saha { border-left-color: #2ecc71 !important; }
.badge-pos-Forvet { border-left-color: #e74c3c !important; }

.badge-slim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.badge-slim-user {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.badge-slim-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.badge-slim-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge-slim-time {
    font-size: 0.65rem;
    color: var(--text-muted1);
    opacity: 0.7;
}

.badge-center-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
    z-index: 1;
    text-align: center;
}

.hero-icon {
    font-size: 1.4rem;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.hero-title {
    font-size: clamp(1rem, 4vw, 1.3rem);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.badge-slim-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dotted var(--border-color-subtle);
    padding-top: 4px;
    z-index: 1;
}

.slim-desc {
    font-size: 0.65rem;
    color: var(--text-muted1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.slim-like-btn {
    background: none;
    border: none;
    padding: 0 5px;
    color: var(--text-muted1);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.slim-like-btn.liked {
    color: #e74c3c;
}

/* --- 6.1. DETAYLI ROZET KARTI (SCREENSHOT'TAKI YAPI) --- */
.detail-badge-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 11px;
    /* Varsayılan mobil uyumu */
    border-radius: 0; 
}
@media (min-width: 768px) {
    .detail-badge-card {
        border-radius: 16px;
    }
}
@media (max-width: 991.98px) {
    .detail-badge-card {
        border-left: none;
        border-right: none;
    }
}

.badge-glow-effect {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 120%; height: 120%;
    background: radial-gradient(circle at center, rgba(var(--accent-rgb, 255, 215, 0), 0.15), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.detail-badge-icon-bg {
    font-size: 5rem;
    opacity: 0.08;
    position: absolute;
    top: -10px;
    right: -10px;
    transform: rotate(20deg);
    color: var(--text-main);
    pointer-events: none;
    z-index: 0;
}

.detail-badge-main-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    line-height: 1;
}

.detail-badge-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.detail-badge-desc {
    font-size: 0.95rem;
    color: var(--text-muted1);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    max-width: 90%;
}

.badge-player-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card-secondary);
    padding: 6px 16px 6px 8px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    transition: transform 0.2s, background 0.2s;
}

.badge-player-chip:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
}

.badge-player-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- 6.2. ROZET OLUŞTURMA (CREATE SCREEN) --- */
.badge-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.badge-item {
    flex: 0 0 auto;
    width: 70px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.badge-item:hover {
    transform: translateY(-3px);
}

.badge-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
}

.badge-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: #333;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.badge-item:hover::after {
    content: attr(data-desc);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: normal;
    width: max-content;
    max-width: 200px;
    z-index: 100;
    margin-bottom: 8px;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.badge-stack-count {
    position: absolute;
    top: -5px;
    right: 5px;
    background-color: var(--accent-primary);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 800;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* --- 7. YORUMLAR (COMMENTS) --- */
.inline-comments-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 15px;
    margin-top: -7px;
    margin-bottom: 100px;
}

@media (max-width: 767px) {
    .inline-comments-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: -9px;
    }
}

.comment-item {
    border-bottom: 1px solid var(--border-color-subtle);
    padding-bottom: 15px;
    margin-bottom: -10px;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-body {
    background: var(--bg-card-secondary);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    width: 100%;
}

.comment-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.comment-flex-container {
    display: flex;
    gap: 10px;
    width: 100%;
}

.comment-content-area {
    flex-grow: 1;
}

.comment-actions-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 40px;
    border-left: 1px solid var(--border-color-subtle);
    padding-left: 5px;
    margin-left: 5px;
}

.btn-like-comment {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 2px;
    color: var(--text-muted1);
    border: none;
    background: none;
}

.btn-like-comment.text-danger {
    color: #dc3545 !important;
}

.btn-delete-comment {
    font-size: 0.7rem;
    color: var(--text-muted1);
    border: none;
    background: none;
}

.sticky-comment-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 15px;
    z-index: 9999 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.sticky-inner {
    width: 100%;
    max-width: 650px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- 8. MODALLAR GENEL & DESKTOP --- */
.modal-content {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
}

.share-option-btn:hover {
    background: var(--bg-hover-dark);
}

.share-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

#messageShareArea {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
    background: var(--bg-card-secondary);
    padding: 15px;
    border-radius: 12px;
}

/* Masaüstünde sürükleme çubuğunu gizle */
@media (min-width: 768px) {
    .modal-drag-handle {
        display: none;
    }
}

/* --- 9. MOBİL MODALLAR (ANTI-FLICKER V2 - FINAL) --- */
@media (max-width: 767px) {

    #commentModal, #shareModal {
        padding: 0 !important;
        z-index: 1055 !important;
    }

    #commentModal .modal-dialog,
    #shareModal .modal-dialog {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        width: 100% !important;

        /* Yükseklik animasyonu */
        height: 50% !important;

        transform: translate3d(0, 100%, 0) !important;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
        will-change: transform, height;
    }

    #commentModal.show .modal-dialog,
    #shareModal.show .modal-dialog {
        transform: translate3d(0, 0, 0) !important;
    }

    /* GENİŞLEME EFEKTİ */
    #commentModal.modal-expanded .modal-dialog {
        height: 95% !important;
        /* Transform tekrar tetiklenmesin, sadece height değişsin */
        transition: height 0.3s ease-in-out !important;
    }

    #commentModal .modal-content,
    #shareModal .modal-content {
        border-radius: 24px 24px 0 0 !important;
        border: none !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--bg-card) !important;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2) !important;
        contain: content;
    }

    #commentModal .modal-body {
        overflow-y: auto !important;
        flex-grow: 1 !important;
        padding-bottom: 80px !important;
        -webkit-overflow-scrolling: touch;
    }

    #commentModal .modal-footer {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: var(--bg-card) !important;
        z-index: 10 !important;
        border-top: 1px solid var(--border-color) !important;
        padding: 10px 15px !important;
        padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    }

    .modal-drag-handle {
        width: 100%;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background-color: var(--bg-card);
        border-radius: 24px 24px 0 0;
        flex-shrink: 0;
    }

    .modal-drag-handle::after {
        content: '';
        width: 50px;
        height: 5px;
        background-color: #e0e0e0;
        border-radius: 10px;
    }

    [data-theme="dark"] .modal-drag-handle::after {
        background-color: #444;
    }
}

/* --- 10. CREATE POST & INPUTS --- */
.post-create-card {
    padding: 15px 20px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.post-input-fake {
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    border: none;
    width: 100%;
    padding: 10px 0;
}

.post-input-fake:focus {
    outline: none;
}

.post-input-fake::placeholder {
    color: var(--text-muted1);
    opacity: 0.7;
}

.btn-media-upload {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
    background: rgba(59, 130, 246, 0.1);
    transition: 0.2s;
    cursor: pointer;
}

.btn-media-upload:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

/* --- 11. MOBIL HEADER --- */
/* Sonuncu ve en kapsamlı tanımlama birleştirildi */
.page-header-mobile {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(var(--bg-card-rgb), 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header-mobile img {
    height: 24px;
}

.btn-back {
    font-size: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
}

.header-title-mobile {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 12. ANIMASYONLAR --- */
.double-tap-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #fff;
    font-size: 4rem;
    pointer-events: none;
    z-index: 99;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    animation: pop-heart 0.8s ease-out forwards;
}

@keyframes pop-heart {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2) rotate(10deg); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1) rotate(-10deg); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(0) rotate(0deg); opacity: 0; }
}