/* ================================================
   DAILERY - Instagram-Style Insights Feed
   ================================================ */

:root {
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --primary-color: #6366f1;
    --primary-color-rgb: 99, 102, 241;
    --ad-card-border: #1e293b;
    --accent-color: #f43f5e;
    --text-main: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --instagram-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --nav-height: 60px;
    --scrollbar-bg: #f1f1f1;
    --scrollbar-thumb: #ccc;
    --search-bg: #f1f5f9;
    --bg-secondary: #f1f5f9;
    --header-bg: #f8fafc;
}

#pwaInstallBtn.pwa-hidden {
    display: none !important;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-main: #131416;
    --card-bg: #1c1e21;
    --primary-color: #0095f6;
    --primary-color-rgb: 0, 149, 246;
    --ad-card-border: #e2e8f0;
    --text-main: #fafafa;
    --text-secondary: #a8a8a8;
    --border-color: #282a2d;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --scrollbar-bg: #1a1c1e;
    --scrollbar-thumb: #35393e;
    --search-bg: #222529;
    --bg-secondary: #1a1c1e;
    --header-bg: #131416;
}

/* Accessibility Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    -webkit-touch-callout: none;
}

*:focus,
*:active {
    outline: none !important;
}

/* Prevent accidental zoom on mobile, especially Safari */
html,
body,
button,
a,
.article-card,
input,
textarea,
select {
    touch-action: manipulation;
}

*:focus {
    outline: none !important;
    /* Removes focus outline */
}

html {
    min-height: 100vh;
    background-color: var(--bg-main);
    /* INSTAGRAM-LIKE SCROLL SNAPPING */
    scroll-snap-type: y proximity;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ⚡ PERFORMANCE: Force font-display swap for FontAwesome (Fixed for CDN) */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-regular-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-brands-400.woff2') format('woff2');
}

/* Page Loader Spinner */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--primary-color), 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Image Skeleton / Shimmer Effect */
.image-skeleton {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-secondary) !important;
}

.image-skeleton::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

[data-theme="light"] .image-skeleton::before {
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 0, 0, 0.03),
            transparent);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Consolidated with line 850+ styles to prevent flicker */

.featured-image-container {
    animation: imagePulse 1.5s infinite ease-in-out;
}

@keyframes imagePulse {
    0% {
        background-color: var(--border-color);
    }

    50% {
        background-color: var(--scrollbar-thumb);
        opacity: 0.5;
    }

    100% {
        background-color: var(--border-color);
    }
}

/* Static Scrollbar to prevent flickering tracks */
::-webkit-scrollbar {
    width: 10px;
    background-color: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}

/* ================================================
   FINAL STABLE HEADER (NO-SHIFT)
   ================================================ */

.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    /* Hardware acceleration to prevent flickering during mobile overscroll */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.navbar {
    width: 100%;
    max-width: 935px;
    margin: 0 auto;
    padding: 0 16px;
    /* Optimized padding for horizontal consistency */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

.logo a {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    text-decoration: none;
}

.logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

.logo svg {
    width: 115px;
    height: 30px;
    flex-shrink: 0;
}

.brand-text {
    background: var(--instagram-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 420px;
    justify-content: flex-end;
    padding-right: 25px;
}

.search-box {
    background: var(--search-bg);
    border-radius: 8px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    width: 250px;
    height: 36px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    padding: 8px 0;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 22px;
    width: 130px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-main);
    font-size: 1.4rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 28px;
    height: 28px;
    justify-content: center;
}

/* Theme Icon Management */
.sun-icon {
    display: none !important;
}

.moon-icon {
    display: block !important;
}

[data-theme="dark"] .sun-icon {
    display: block !important;
}

[data-theme="dark"] .moon-icon {
    display: none !important;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    border-radius: 50%;
    transition: none;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

@media (hover: hover) {
    .theme-toggle:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    [data-theme="dark"] .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.theme-toggle:active {
    transform: none;
    /* Removed scale animation */
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    transition: none;
    /* Removed svg transition */
}

.theme-toggle:hover svg {
    transform: none;
    /* Removed rotation on hover */
}

@media (max-width: 768px) {
    .header {
        height: 60px;
        padding: 0;
        position: fixed;
    }

    .navbar {
        flex-direction: row;
        /* Force row layout */
        gap: 0;
        padding: 0 10px;
        justify-content: space-between;
    }

    .header-right {
        width: auto;
        justify-content: flex-end;
        flex: 1;
        gap: 8px;
    }

    .search-box {
        display: none;
        /* Hide default search box on mobile */
    }

    .logo img {
        width: 44px;
        height: 44px;
    }

    .logo svg {
        width: 110px;
        height: 28px;
    }
}

/* ================================================
   FEED LAYOUT
   ================================================ */

.container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 992px) {
    .container {
        max-width: 1200px;
        /* Increased from 100% to allow controlled centering if needed, or keeping it wide */
        padding: 0 40px;
    }
}

@media (max-width: 991px) and (min-width: 601px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

.main-content {
    padding-top: var(--nav-height);
    /* Pull it up to be right against the header */
    padding-bottom: 20px;
}

@media (max-width: 768px) {

    /* Mobilde header 54px, body zaten padding-top: 54px (index.php). Ekstra nav-height eklenmesin. */
    .main-content {
        padding-top: 0;
        padding-bottom: 20px;
    }
}

.articles-grid {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced gap between cards */
}

/* ================================================
   NEW ARTICLES PILL (FLOATING)
   ================================================ */

#newArticlesPill {
    position: fixed;
    top: calc(75px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    /* Multilayer Ultra-Soft Shadow */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
    user-select: none;
    white-space: nowrap;
    /* Force single line */
    max-width: 90%;
    /* Prevent overflow off screen */
    justify-content: center;
}

@media (max-width: 600px) {
    #newArticlesPill {
        padding: 7px 16px;
        font-size: 0.85rem;
        width: auto;
        min-width: min-content;
    }
}

#newArticlesPill.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#newArticlesPill:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15), 0 15px 35px rgba(0, 0, 0, 0.15);
}

#newArticlesPill i {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceUp 2s infinite;
}

#newArticlesPill .count-badge {
    display: none;
}

@keyframes bounceUp {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(-1.5px);
    }
}

#newArticlesPill:active {
    opacity: 0.9;
}




/* ================================================
   ARTICLE CARD (Insta-Style)
   ================================================ */

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    /* Soft Load Animation Base */
    opacity: 0;
    transform: none;
    transition: opacity 0.3s ease-out;
    will-change: opacity;

    /* SCROLL SNAP ALIGNMENT */
    scroll-snap-align: start;
    scroll-margin-top: 80px;
    /* Header (60px) + Gap (20px) */
}

.article-card.in-view {
    opacity: 1;
}

/* 🎯 COMPACT ADS FOR ARTICLES */
.article-card.ad-article-compact {
    max-width: 600px;
    margin: 15px auto;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}

.article-card.ad-article-compact .article-card-image-container {
    aspect-ratio: 16 / 9 !important;
    min-height: auto !important;
}

.article-card.ad-article-compact .card-header {
    height: 44px;
    padding: 0 12px;
}

.article-card.ad-article-compact .avatar-inner {
    border-radius: 50%;
}

.article-ad-cta {
    background: var(--card-bg);
    transition: background 0.2s;
}

.article-card.ad-text-only {
    background: var(--card-bg);
}

.article-card.ad-text-only .ad-text-content:hover {
    background: var(--search-bg);
}

.article-ad-cta:hover {
    background: var(--search-bg);
}

@media (max-width: 600px) {
    .article-card {
        /* Mobile optimization but keep card look */
        touch-action: pan-y;
        margin-bottom: 0;
        border-radius: 3px;
        border: 1px solid var(--border-color);
    }

    .articles-grid {
        gap: 5px;
        padding-bottom: 20px;
    }

    /* Remove the weird bottom border on grid since we have gaps now */
}

.card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    /* Fixed height to prevent collapse/jump */
    box-sizing: border-box;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Improved Gradient Border (Pixel Perfect) */
    border: 2.5px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        var(--instagram-gradient) border-box;
    box-sizing: border-box;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-main);
    border-radius: 50%;
}

.avatar-inner i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Stable User Info Block */
.user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    min-width: 0;
    flex: 1;
    height: 32px;
}

.user-info .username {
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.separator-dot {
    opacity: 0.3;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
    margin-top: 0;
    vertical-align: middle;
}

/* Premium Genre Badge */
.genre-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: normal;
    white-space: nowrap;
    margin-top: 0;
    vertical-align: middle;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    /* Dynamic Theme-Aware Styling - STANDARDIZED */
    background: rgba(15, 23, 42, 0.85);
    /* Solid dark background for consistency */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    height: 18px;
    /* Fixed height for perfect alignment */
    min-width: 40px;
    /* ⚡ PERFORMANCE: Min-width to reduce tiny shifts when font loads */
}

[data-theme="dark"] .genre-badge {
    background: rgba(255, 255, 255, 0.15);
    /* Slightly lighter on dark mode but same size */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info .location {
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-block;
}

/* Ensure container has no font gaps and masks the bottom edge image */
/* 📚 PREMIUM BOOK MOCKUP SYSTEM */
.book-scene {
    width: 100%;
    aspect-ratio: 16/9;
    background: #0a0a0a;
    /* Static base to prevent flicker */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-scene.loaded.book-cat {
    background-image: url('../img/bookbackground_v2.webp?v=2');
    background-size: cover;
    background-position: center;
    /* Optimization: prevent unnecessary painting */
    contain: paint;
}

.book-object {
    height: 80%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    perspective: 1000px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.book-scene.loaded .book-object {
    opacity: 1;
    transform: scale(1.0) translateZ(0);
    /* Performance Fix: Removed infinite animation that caused scroll jitter */
    /* animation: bookStableFocus 15s infinite alternate ease-in-out; */
    will-change: auto;
}

@keyframes bookStableFocus {
    0% {
        transform: scale(1.0) translateZ(0);
    }

    100% {
        transform: scale(1.05) translateZ(0);
    }
}

@keyframes bookBreathing {
    0% {
        transform: scale(1.0);
    }

    100% {
        transform: scale(1.05);
    }
}

.book-cover-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px 4px 4px 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
}



.book-spine-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.article-card-image-container {
    width: 100%;
    aspect-ratio: 16 / 9 !important;
    min-height: calc(100vw * 9 / 16);
    /* Estimate for mobile width */
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    display: block;
    /* Simpler is more stable here */
    contain: paint layout;
}

.article-card-image-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.article-card-image-placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 600px) {
    .article-card-image-container {
        min-height: 337.5px;
        /* (600px * 9 / 16) matches desktop article grid max width */
    }
}

.article-card-image,
.article-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Faster but soft */
}

.article-card-image.loaded,
.article-image.loaded {
    opacity: 1;
}

/* ⚡ LCP Critical: First 2 cards skip opacity animation entirely */
.article-card-image.lcp-image {
    opacity: 1 !important;
    transition: none !important;
    will-change: auto !important;
}

/* Article detail page: holding space with aspect-ratio, now with soft reveal */
.article-detail-img {
    opacity: 0;
    transition: opacity 0.5s ease-out !important;
    /* Soft entrance */
    will-change: opacity;
}

.article-detail-img.loaded {
    opacity: 1 !important;
}



.card-actions {
    padding: 12px 16px;
    display: flex;
    gap: 16px;
    font-size: 1.5rem;
    position: relative;
    z-index: 20;
    /* Sit ON TOP of the image overlap */
    background: var(--card-bg);
    /* Ensure opacity */
    /* Add a tiny top border of the card color to hide any black bleed if needed, but overlap handles it */
}

.card-actions i {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.card-actions i:hover {
    transform: scale(1.1);
}

.share-icon:hover {
    color: var(--primary-color);
}

/* Big Heart Animation for Double Tap */
.like-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

.big-heart {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
    transform: scale(0);
}

.like-overlay.animate {
    animation: heartFade 1s ease-in-out forwards;
}

.like-overlay.animate .big-heart {
    animation: heartScale 0.8s cubic-bezier(0.17, 0.89, 0.32, 1.49) forwards;
}

@keyframes heartFade {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes heartScale {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Share Toast Notification */
.share-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}

.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .share-toast {
    background: rgba(0, 0, 0, 0.9);
}

.card-body {
    padding: 0 16px 12px;
}

.ad-bottom-card .card-body {
    padding: 12px 14px !important;
    margin: 0 !important;
}

/* Makale kartı: tüm yapı CSS'te (anasayfa + İlginizi çekebilir bire bir aynı, inline yok) */
.article-card .card-header {
    height: 52px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.article-card .card-header .avatar-inner {
    overflow: hidden;
}

.article-card .article-card-image-container {
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-touch-callout: none;
}

.article-card .card-actions {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.article-card .card-actions .like-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.article-card .card-actions .heart-icon {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.article-card .card-actions .likes-display {
    font-weight: 700;
    font-size: 0.9rem;
    display: none;
}

.article-card .card-actions .interaction-share-platter,
.article-card .card-actions .share-icon {
    margin-left: auto;
}

.article-card .card-actions .share-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.article-card .card-body {
    padding: 0 14px 14px;
}

.article-card .card-body .excerpt-container {
    font-size: 0.9rem;
    line-height: 1.5;
    height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    color: var(--text-main);
    margin-bottom: 4px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.article-card .card-body .card-caption+div,
.article-card .card-body>div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
}

.article-card .card-body .card-body-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.likes-display {
    display: inline-flex;
}

/* Makale kartlarındaki \"devamını oku\" — reklam butonuna uygulanmasın
   Tüm kartlarda (anasayfa, kategori, İlginizi Çekebilir) aynı stil:
   Yazı gri/küçük, sadece ok mavi. */
.more-btn:not(.ad-cta-btn) {
    transition: all 0.2s ease;
    padding: 2px 0;
    border: none;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary) !important;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none !important;
}

@media (hover: hover) {
    .more-btn:not(.ad-cta-btn):hover {
        opacity: 0.8;
    }

    .more-btn:not(.ad-cta-btn):hover i {
        transform: translateX(3px);
    }

    .more-btn.ad-cta-btn:hover i,
    .ad-cta-btn:hover i {
        transform: translateX(3px);
    }
}

.more-btn:not(.ad-cta-btn):active {
    transform: scale(0.96);
    opacity: 0.7;
}

.more-btn:not(.ad-cta-btn) i {
    font-size: 0.75rem;
    margin-left: 5px;
    color: #0095f6 !important;
    /* SADECE ok mavi */
    transition: transform 0.2s ease;
    position: relative;
    top: 2px;
}



.card-caption {
    font-size: 14px;
    line-height: 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.card-caption .username {
    font-weight: 600;
    margin-right: 6px;
    display: inline-block;
}

.card-caption .excerpt {
    color: var(--text-main);
    display: block;
    margin-top: 4px;
    /* Fixed px margin */
    min-height: 20px;
    /* Exact match to line-height */
}

/* Title Overlay & Writing Animation */
.title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 60px 18px 20px;
    /* Alttan tam kapalı gölge: 0–5% opak siyah, sonra yukarı gradient */
    background: linear-gradient(to top,
            #000000 0%,
            #000000 5%,
            rgba(0, 0, 0, 0.88) 22%,
            rgba(0, 0, 0, 0.5) 50%,
            transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
    transform: translateZ(0);
    z-index: 10;
}

.featured-image-container.loaded {
    animation: none !important;
    background: transparent !important;
}

.animated-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    padding-left: 6px;
    /* Tüm kart tipleri için standart sol boşluk */
    padding-right: 12px;
    box-sizing: border-box;
    max-width: 100%;
    text-align: left;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.title-overlay .animated-title a {
    color: inherit;
    text-decoration: none;
}

/* Trigger animation only when parent card is in view */
.article-card.in-view .animated-title {
    animation: revealTitle 1s ease-out forwards;
    animation-delay: 0.2s;
}

@keyframes revealTitle {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* ================================================
   AD PLACEHOLDER
   ================================================ */

/* Modern Ad Card Standardization */
.ad-card-item {
    cursor: pointer;
    background: var(--card-bg);
}

.ad-card-item .username {
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

.ad-card-item .card-actions {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

/* ================================================
   MOBILE BOTTOM NAV
   ================================================ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
    height: 50px;
    z-index: 1000;
    /* Prevent movement during overscroll */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

@media (max-width: 768px) {
    .header {
        height: var(--nav-height);
        padding: 0;
    }

    .navbar {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0 10px;
    }

    .logo {
        flex: 0 0 auto;
    }

    .logo h1 {
        font-size: 1.2rem;
        white-space: nowrap;
    }

    .header .search-box {
        display: flex;
        flex: 1;
        width: auto;
        margin-top: 0;
        min-width: 80px;
        padding: 0 8px;
    }

    .header .search-box input {
        padding: 4px 0;
        font-size: 0.8rem;
    }

    .header .nav-links {
        display: flex;
        gap: 10px;
    }

    .header .nav-links a {
        font-size: 1.1rem;
    }

    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .main-content {
        padding-top: calc(var(--nav-height) + 8px);
    }
}

.bottom-nav a {
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
}

/* ================================================
   UI HELPERS
   ================================================ */

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #dbdbdb;
    border-top-color: #8e8e8e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.hidden {
    display: none !important;
}

/* Fix category icon layout shift on article page */
#articleCategory i {
    display: inline-block;
    width: 14px;
    min-width: 14px;
    text-align: center;
}

/* ================================================
   HEADER WEATHER
   ================================================ */

.weather-widget-container {
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 1px solid var(--border-color);
    padding-left: 6px;
    margin-left: 2px;
}

.header-weather {
    cursor: default;
    user-select: none;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    line-height: 1.1;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    transition: none !important;
    transform: none !important;
}

.header-weather:hover {
    opacity: 0.8;
}

.weather-icon {
    font-size: 16px;
    width: 22px !important;
    min-width: 22px !important;
    flex-shrink: 0;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-city {
    white-space: nowrap;
    font-weight: 500;
    height: 12px !important;
    line-height: 12px !important;
}

.weather-temp {
    font-weight: 700;
    color: var(--text-main);
    font-size: 11px;
    height: 13px !important;
    line-height: 13px !important;
}

@media (max-width: 768px) {
    .weather-widget-container {
        padding-left: 4px;
        margin-left: 0;
        border: none;
        /* Remove border on mobile to save space */
    }

    .weather-city {
        display: none;
        /* Hide city name on mobile */
    }

    .header-weather {
        gap: 2px;
    }

    .weather-icon {
        font-size: 14px;
    }
}

/* ================================================
   CATEGORY FILTER (Stories Style)
   ================================================ */

.stories-wrapper {
    width: 100%;
    position: relative;
    /* 🛡️ Balanced pull-up: tight to header but leaves room for labels at the bottom */
    margin-top: -23px;
    /* Reduced by 3px (was -26px) */
    margin-bottom: -10px;
    display: flex;
    align-items: center;
    background: transparent;
    height: 125px;
    /* Reduced from 135px */
    overflow: visible;
}

@media (max-width: 768px) {
    .stories-wrapper {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible;
    }

    .category-filter {
        padding: 7px 16px 5px 16px !important;
        overflow-y: visible;
    }

    .filter-btn {
        gap: 2px;
    }

    .filter-circle {
        margin-top: 0;
    }
}

@media (max-width: 991px) and (min-width: 601px) {
    .stories-wrapper {
        margin-bottom: 4px;
        height: 120px;
    }
}

@media (min-width: 992px) {
    .stories-wrapper {
        margin-bottom: 1px;
    }

    .category-filter {
        padding: 25px 20px 5px 20px !important;
        /* Reduced top padding */
        justify-content: flex-start !important;
    }
}

.category-filter {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    padding: 28px 16px 5px 16px;
    -ms-overflow-style: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    user-select: none;
    -webkit-user-select: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.scroll-btn {
    position: absolute;
    top: 76px;
    /* Lowered by 4px as requested */
    height: 32px;
    width: 32px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--text-secondary);
    box-shadow: none;
    opacity: 0;
    transition: color 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    transform: translateY(-50%);
}

.scroll-btn:hover {
    color: var(--primary-color);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

@media (max-width: 768px) {
    .scroll-btn {
        display: none !important;
    }
}

.filter-btn {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Category button scale removed as per user request */

.filter-circle {
    width: 62px;
    height: 62px;
    min-width: 62px;
    min-height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    box-sizing: border-box;
}

.filter-circle::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    padding: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
    background: var(--active-gradient, var(--instagram-gradient));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Neutral border for 'All' removed to match other categories */

.filter-btn.active .filter-circle {
    background-color: var(--card-bg);
    box-shadow: 0 0 15px var(--glow-color, rgba(168, 85, 247, 0.3));
    /* Border color remains as fallback behind the gradient overlay */
}

.filter-btn.active .filter-circle::after {
    opacity: 1;
}

.btn-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    color: var(--text-main);
    z-index: 2;
    transition: opacity 0.2s ease;
    border-radius: 50%;
}

.filter-btn.active .btn-inner {
    border: 2px solid transparent;
    /* Placeholder to keep layout stable if needed */
}

.filter-btn span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    white-space: nowrap;
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1;
}

.filter-btn.active span {
    color: var(--text-main);
}

/* ================================================
   RELATED INSIGHTS SECTION — anasayfa grid ile bire bir aynı genişlik/padding
   ================================================ */

.related-insights-section {
    max-width: 600px;
    margin: 40px auto 80px;
    margin-top: 50px;
    padding: 0;
    width: 100%;
}

.related-insights-section--hidden {
    display: none;
}

.related-insights-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 auto 20px;
    padding: 0 16px 0 12px;
    /* solda hafif boşluk */
    max-width: 600px;
}

.related-insights-back-wrap {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 60px;
}

.related-insights-back-wrap .load-more-btn {
    text-decoration: none;
}

/* Anasayfadaki .articles-grid ile aynı: aynı gap, aynı max-width */
.related-insights-section .articles-grid {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* İlginizi çekebilir: SADECE makale kartları (reklam kartlarına dokunma — reklamlar tek blokta) */
#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .excerpt-container,
#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .excerpt-text {
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .card-body-meta {
    color: var(--text-secondary) !important;
    font-size: 0.65rem !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .more-btn {
    /* Ana karttan farklı: yazı gri/küçük, ok mavi */
    text-decoration: none !important;
    color: var(--text-secondary) !important;
    /* yazı rengi */
    font-size: 0.75rem !important;
    /* yazı boyutu */
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .more-btn i {
    font-size: 0.75rem !important;
    margin-left: 5px !important;
    color: #0095f6 !important;
    /* sadece ok mavi */
}

@media (hover: hover) {
    #relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .more-btn:hover {
        opacity: 0.8 !important;
    }

    #relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-body .more-btn:hover i {
        transform: translateX(3px);
    }
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-actions .share-icon {
    color: var(--primary-color) !important;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .title-overlay {
    padding: 60px 18px 20px;
    bottom: 0;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .animated-title {
    padding-left: 6px;
    padding-right: 12px;
    box-sizing: border-box;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .article-card-image-container {
    margin-bottom: 0;
}

#relatedInsightsGrid .article-card:not(.ad-feed-card):not(.ad-card-item) .card-actions {
    margin-top: 0;
}

@media (max-width: 768px) {
    .related-insights-section {
        margin: 30px auto 60px;
        padding: 0;
    }

    .related-insights-title {
        padding: 0 16px 0 12px;
        /* mobilde de aynı sol boşluk */
        font-size: 1.3rem;
    }
}

/* Load More Button */
.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 149, 246, 0.3);
}

.load-more-btn:hover {
    background: #0081d6;
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.4);
}

.load-more-btn:active {
    opacity: 0.8;
}

.load-more-btn:hover svg {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .load-more-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

.excerpt-container {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.excerpt-container.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

/* Bottom Navigation - HIDDEN (Navigation moved to header) */
.bottom-nav {
    display: none !important;
}

/* Weather Location Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.82);
    /* Slightly darker for better focus */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    /* Use display: none for true hidden state */
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    /* Higher than any header or nav */
    padding: 20px;
    padding-top: 100px;
    /* Position modal higher on screen */
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    /* Show as flex when active */
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 24px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

#citySearchResults div:last-child {
    border-bottom: none;
}

#citySearchResults::-webkit-scrollbar {
    width: 6px;
}

#citySearchResults::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ================================================
   CARDS & BADGES (Consistent across all sections)
   ================================================ */
.card-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}

.custom-badge {
    background: rgba(0, 0, 0, 0.85);
    /* Premium dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 0.2s ease;
}

.imdb-badge-style {
    color: #f5c518 !important;
    border-color: rgba(245, 197, 24, 0.5) !important;
}

.flag-badge-style {
    padding: 4px 6px !important;
}

.flag-badge-style img {
    height: 12px;
    width: 16px;
    object-fit: cover;
    vertical-align: middle;
    border-radius: 2px;
    display: inline-block;
}

/* Fix for weather icon animation if needed */
.header-weather:active {
    transform: none;
}

/* ================================================
   WORD GAME - Premium Styles
   ================================================ */
.word-game-container {
    background: var(--search-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .word-game-container {
    background: rgba(30, 30, 30, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.word-game-container.solved {
    border-color: #4ade80;
    box-shadow: 0 8px 32px rgba(74, 222, 128, 0.15);
}

.letter-node {
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent !important;
}

.letter-node:hover {
    border-color: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.word-display div {
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* WORD GAME - Compact Letter Grid (7 Cols) */
#letterSourceGridBox {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 0 12px 0 !important;
    /* Add spacing below letter grid */
}

.letter-source-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    padding: 0 !important;
    width: auto !important;
    max-width: 330px !important;
    /* Max 7 tiles: 7*40 + 6*5 = 310px + padding */
    margin: 0 auto !important;
    justify-content: center !important;
}

.source-tile {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
}

.source-tile:active {
    transform: scale(0.92);
}

.source-tile.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: transparent !important;
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Input preview spacing */
.v6-input-preview {
    margin-top: 8px !important;
    /* Reduce top spacing */
    margin-bottom: 10px !important;
}

/* Action buttons spacing */
.game-actions-modern {
    margin-top: 0 !important;
    /* Remove extra top margin since gridBox has bottom margin */
}

/* ================================================
   AD SPECIFIC STYLES (Format & Types)
   ================================================ */
/* Reklam kartı dış çerçevesi — tema moduna göre (açık/koyu) */
.ad-card-item {
    border: 1px solid var(--ad-card-border) !important;
}

.ad-type-app .username,
.ad-type-sponsored .username {
    color: var(--text-main) !important;
}

/* Article top reklam (kompakt bar) — tema renkleri */
.ad-top-bar .ad-top-title {
    color: var(--text-main) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.ad-top-bar .ad-top-btn {
    color: var(--primary-color) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

.ad-top-bar .ad-top-btn i {
    font-size: 0.6rem !important;
    margin-left: 4px !important;
}

.app-rating {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ==========================================================================
   REKLAM KARTI TEK STANDART — anasayfa, makale, İlginizi çekebilir, article bottom
   Aynı yapı, aynı stil, çakışan kural yok. Sadece article_top farklı (kompakt).
   ========================================================================== */

/* Kök: her yerde aynı kutu (açık mod siyah, koyu mod beyaz çerçeve) */
.ad-feed-card,
.ad-bottom-card {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--ad-card-border) !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
}

/* Header: tema renkleri (açık/koyu uyumlu) */
.ad-feed-card .card-header,
.ad-bottom-card .card-header {
    height: 52px !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
}

.ad-feed-card .card-header .username,
.ad-bottom-card .card-header .username {
    color: var(--text-main) !important;
    font-weight: 800 !important;
}

.ad-feed-card .card-header .genre-badge,
.ad-bottom-card .card-header .genre-badge {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.ad-feed-card .avatar-inner .ad-icon-fallback,
.ad-bottom-card .avatar-inner .ad-icon-fallback {
    color: var(--primary-color) !important;
}

/* Reklam ikonu: dış renkli çerçeve yok */
.ad-feed-card .user-avatar,
.ad-bottom-card .user-avatar,
.ad-card-item .user-avatar {
    border: none !important;
    background: var(--card-bg) !important;
    box-shadow: none !important;
    border-radius: 10px !important;
}

/* Reklam ikonu tam görünsün: yuvarlatılmış kare (köşeler kesilmesin) */
.ad-feed-card .avatar-inner.ad-avatar-inner,
.ad-bottom-card .avatar-inner.ad-avatar-inner,
.ad-card-item .avatar-inner.ad-avatar-inner {
    overflow: hidden !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.ad-feed-card .avatar-inner.ad-avatar-inner img,
.ad-bottom-card .avatar-inner.ad-avatar-inner img,
.ad-card-item .avatar-inner.ad-avatar-inner img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 6px !important;
}

.ad-feed-card .avatar-inner.ad-avatar-inner .ad-icon-fallback,
.ad-bottom-card .avatar-inner.ad-avatar-inner .ad-icon-fallback,
.ad-card-item .avatar-inner.ad-avatar-inner .ad-icon-fallback {
    font-size: 0.75rem !important;
}

/* Reklam detay sayfası: tür rozeti reklam kartı ile aynı (solid primary, beyaz yazı) */
.ad-article-detail-header .genre-badge.ad-detail-genre-badge,
.ad-detail-header-like-card .genre-badge {
    background: var(--primary-color, #6366f1) !important;
    color: #fff !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    box-shadow: none !important;
}

/* Reklam Explore/Keşfet butonu — TEK STIL: anasayfa, article, ilginizi çekebilir, hepsi aynı */
.more-btn.ad-cta-btn,
.ad-cta-btn.more-btn {
    background: var(--primary-color) !important;
    color: #fff !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    width: auto !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    border: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    opacity: 1 !important;
    transition: opacity 0.2s ease !important;
}

.more-btn.ad-cta-btn:hover,
.ad-cta-btn.more-btn:hover {
    opacity: 0.92 !important;
}

.more-btn.ad-cta-btn *,
.more-btn.ad-cta-btn i,
.ad-cta-btn.more-btn *,
.ad-cta-btn.more-btn i {
    color: #fff !important;
    font-size: inherit !important;
}

.more-btn.ad-cta-btn i,
.ad-cta-btn.more-btn i {
    font-size: 0.65rem !important;
    margin-left: 6px !important;
}

/* Görsel alanı — tek standart (anasayfa, ilginizi çekebilir, article bottom); altında açıklık/çizgi yok */
.ad-feed-card .ad-feed-image-wrap,
.ad-bottom-card .ad-feed-image-wrap {
    position: relative !important;
    overflow: hidden !important;
    background: #000 !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
    display: block !important;
    border: none !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.ad-bottom-card .ad-feed-image-wrap {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.ad-feed-card .ad-feed-img,
.ad-bottom-card .ad-feed-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.ad-feed-card .ad-feed-title-overlay,
.ad-bottom-card .ad-feed-title-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    padding: 60px 18px 20px !important;
    /* yatayda 18px; animated-title 6px iç padding ile hizalı */
    margin: 0 !important;
    /* Makale kartlarındaki gibi yumuşak gölge efekti */
    background: linear-gradient(to top,
            #000000 0%,
            #000000 5%,
            rgba(0, 0, 0, 0.88) 22%,
            rgba(0, 0, 0, 0.5) 50%,
            transparent 100%) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    border: none !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.ad-feed-card .ad-feed-overlay-title,
.ad-bottom-card .ad-feed-overlay-title {
    color: #fff !important;
    font-size: 1.125rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    padding: 0 12px 0 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

/* Kart gövdesi — feed (görsel ile arasında çizgi/açıklık yok) */
.ad-feed-card .ad-feed-card-body {
    padding: 0 14px 14px !important;
    border-top: none !important;
    margin-top: 0 !important;
}

/* Uzun açıklama: daha fazla satır, sabit yükseklik yok (kesik görünüm olmasın) */
.ad-feed-card .ad-feed-excerpt,
.ad-feed-card .ad-feed-long-desc-wrap {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    color: var(--text-secondary) !important;
    margin-bottom: 2px !important;
}

.ad-feed-card .ad-feed-excerpt .excerpt-text,
.ad-feed-card .ad-feed-long-desc-wrap .excerpt-text {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.ad-feed-card .ad-feed-footer-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 4px !important;
    min-height: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
}

.ad-feed-card .ad-feed-footer-row .more-btn.ad-cta-btn {
    flex-shrink: 0 !important;
    align-self: center !important;
}

.ad-feed-card .ad-feed-genre {
    font-size: 0.65rem !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

/* Kısa açıklama: Keşfet'in solunda, bottom reklamdaki gibi 2 satır */
.ad-feed-card .ad-feed-footer-desc {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: var(--text-main) !important;
    flex: 1 !important;
    min-width: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    text-transform: none !important;
    word-break: break-word !important;
    padding: 0 !important;
    margin: 0 !important;
    align-self: flex-start !important;
}

/* Kart gövdesi — article bottom (tek satır + Keşfet) */
.ad-bottom-card .ad-bottom-footer {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    border: none !important;
    border-top: none !important;
    background: var(--card-bg) !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
}

.ad-bottom-card .ad-feed-image-wrap+.ad-bottom-footer {
    margin-top: 0 !important;
    padding-top: 12px !important;
}

.ad-bottom-card .ad-bottom-desc {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: var(--text-main) !important;
    flex: 1 !important;
    min-width: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
}

#relatedInsightsGrid .ad-card-item {
    scroll-snap-align: none;
    margin-bottom: 0;
}

#relatedInsightsGrid .ad-feed-card .ad-feed-image-wrap,
#relatedInsightsGrid .ad-bottom-card .ad-feed-image-wrap {
    border: none !important;
}

#relatedInsightsGrid .ad-feed-card .ad-feed-card-body,
#relatedInsightsGrid .ad-feed-card .ad-feed-title-overlay {
    border-top: none !important;
}