/* ============================= */
/* MODERN MINIMAL TOPBAR */
/* ============================= */

.topbar {
    width: 100%;
    height: 86px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Josefin Sans', sans-serif;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.topbarWrapper {
    width: min(86%, 1500px);
    height: 64px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

/* LOGO */

.topbarLogo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.topbarLogo a {
    color: #111827;
    text-decoration: none;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.3px;
    line-height: 1;
}

.topbarLogo span {
    color: #ff5b00;
}

/* CENTER NAV */

.topbarNav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
}

.topbarNav a {
    position: relative;
    color: #17181f;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 22px 0;
    transition: color 0.2s ease;
}

.topbarNav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 10px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: #ff5b00;
    transform: translateX(-50%);
    transition: width 0.22s ease;
}

.topbarNav a:hover {
    color: #ff5b00;
}

.topbarNav a:hover::after,
.topbarNav a.active::after {
    width: 100%;
}

.topbarNav a.active {
    color: #ff5b00;
}

/* RIGHT ACTIONS */

.topbarActions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    position: relative;
}

/* SEARCH */

.searchEngine {
    width: 46px;
    height: 46px;
    position: relative; /* Bu çok önemli! Dropdown bunun içinde sabit duracak */
    display: flex;
    align-items: center;
    transition: width 0.28s ease;
}

.searchEngine.active {
    width: 250px;
}

.searchEngine input {
    width: 100%;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    outline: none;
    background: #f7f7f7;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    padding: 0 54px 0 18px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.searchEngine.active input {
    opacity: 1;
    pointer-events: auto;
}

.searchEngine input:focus {
    background: #fff;
    border-color: rgba(255, 91, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(255, 91, 0, 0.10);
}

.searchEngine button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #f4f4f4;
    color: #111827;
    position: absolute;
    right: 0;
    top: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.22s ease;
}

.searchEngine button:hover {
    background: #ff5b00;
    color: #fff;
    box-shadow: 0 12px 24px rgba(255, 91, 0, 0.25);
}

/* LOGIN BUTTON */

.loginButton {
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff !important; /* SADECE BU SATIRA !important EKLEDİK */
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.22s ease;
}

.loginButton:hover {
    background: #ff5b00;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255, 91, 0, 0.22);
}

/* PROFILE */

.profileMenu {
    position: relative;
    flex-shrink: 0;
}

.profileButton {
    height: 48px;
    padding: 4px 10px 4px 10px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: 0.22s ease;
}

.profileButton:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 91, 0, 0.35);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}

.profileButton img {
    width: 40px;
    height: 40px;
    border-radius: 45%;
    object-fit: cover;
}

.profileButton i {
    font-size: 11px;
    color: #6b7280;
    transition: 0.22s ease;
}

.profileMenu:has(.profileDropdown.active) .profileButton i {
    transform: rotate(180deg);
    color: #ff5b00;
}

/* DROPDOWN */

.profileDropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 205px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 24px 65px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transition: 0.22s ease;
}

.profileDropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.profileDropdown::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 26px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.96);
    transform: rotate(45deg);
    border-left: 1px solid rgba(17, 24, 39, 0.05);
    border-top: 1px solid rgba(17, 24, 39, 0.05);
}

.profileDropdown a {
    height: 44px;
    padding: 0 13px;
    border-radius: 14px;
    color: #111827;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 800;
    transition: 0.2s ease;
}

.profileDropdown a i {
    width: 18px;
    color: #ff5b00;
    font-size: 15px;
}

.profileDropdown a:hover {
    background: rgba(255, 91, 0, 0.09);
    color: #ff5b00;
}

.profileDropdown a.logout {
    color: #dc2626;
}

.profileDropdown a.logout i {
    color: #dc2626;
}

.profileDropdown a.logout:hover {
    background: rgba(220, 38, 38, 0.09);
}

/* OPEN ANIMATION */

.topbarWrapper {
    opacity: 0;
    transform: translateY(-10px);
    animation: topbarFade 0.45s ease forwards;
}

@keyframes topbarFade {
    to {
        opacity: 1;
        transform: none;
    }
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .topbarWrapper {
        width: 92%;
        gap: 14px;
    }

    .topbarNav {
        gap: 22px;
    }

    .topbarNav a {
        font-size: 14px;
    }

    .searchEngine.active {
        width: 210px;
    }
}

/* ============================= */
/* MOBİL MENÜ (HAMBURGER) — 960px ve altı */
/* ============================= */

/* Masaüstünde gizli olan mobil parçalar */
.navToggle,
.mobileThemeButton,
.topbarNav .mobileOnlyLink,
.navBackdrop {
    display: none;
}

.navToggle {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.navToggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #111827;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

body.navOpen .navToggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.navOpen .navToggle span:nth-child(2) { opacity: 0; }
body.navOpen .navToggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

:root {
    --topbar-h: 64px;
}

@media (max-width: 600px) {
    :root {
        --topbar-h: 56px;
    }
}

@media (max-width: 960px) {
    .topbar {
        height: var(--topbar-h);
        padding: 0;
    }

    .topbarWrapper {
        width: 100%;
        height: var(--topbar-h);
        padding: 0 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: relative;
    }

    .topbarLogo a {
        font-size: 23px;
    }

    .topbarActions {
        gap: 8px;
        position: static;
    }

    .navToggle {
        display: flex;
    }

    /* Açılır menü paneli */
    .topbarNav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: auto;
        max-height: calc(100vh - var(--topbar-h));
        max-height: calc(100dvh - var(--topbar-h));
        overflow-y: auto;
        overscroll-behavior: contain;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 12px 14px 18px;
        background: #ffffff;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
        z-index: 1001;
    }

    body.navOpen .topbarNav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .topbarNav a,
    .topbarNav .mobileThemeButton {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 50px;
        padding: 0 14px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 800;
    }

    .topbarNav a::after {
        display: none;
    }

    .topbarNav a:hover,
    .topbarNav a.active {
        background: rgba(255, 91, 0, 0.08);
    }

    .topbarNav .mobileOnlyLink {
        display: flex;
    }

    .mobileThemeButton {
        width: 100%;
        margin-top: 6px;
        border: 1px solid rgba(17, 24, 39, 0.08);
        background: #f7f7f7;
        color: #111827;
        font-family: inherit;
        cursor: pointer;
        text-align: left;
    }

    .mobileThemeButton i {
        width: 18px;
        color: #ff5b00;
    }

    /* "Yeni!" rozeti menüde yazının yanında durur, üstüne binmez */
    .topbarNav .nav-item-relative {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    .topbarNav .new-breathing-badge {
        position: static;
        animation: none;
        transform: rotate(-4deg);
    }

    .topbarNav a .announcementBadge {
        position: static;
        margin-left: 2px;
    }

    .navBackdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s;
        z-index: 998;
    }

    body.navOpen .navBackdrop {
        opacity: 1;
        visibility: visible;
    }

    body.navOpen {
        overflow: hidden;
    }

    /* Tema anahtarı mobilde menünün içine taşınır */
    .topbarActions .theme-switch-wrapper {
        display: none;
    }

    .topbarNav .mobileThemeButton {
        display: flex;
    }

    /* Arama: ikon olarak durur, açılınca tüm üst barı kaplar */
    .searchEngine {
        width: 44px;
        height: 44px;
        position: relative;
    }

    .searchEngine button {
        width: 44px;
        height: 44px;
    }

    .searchEngine.active {
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc((var(--topbar-h) - 44px) / 2);
        width: auto;
        z-index: 5;
    }

    .searchEngine input {
        height: 44px;
        font-size: 16px; /* iOS'ta odaklanınca sayfa yakınlaşmasın */
    }

    .searchResultsDropdown {
        left: 0;
        right: 0;
        width: auto;
        top: 52px;
        max-height: min(420px, calc(100dvh - 90px));
    }

    .topbarChatIcon {
        width: 44px;
        height: 44px;
        margin: 0;
        font-size: 21px;
        position: relative;
    }

    /* Profil butonu: sadece fotoğraf */
    .profileButton {
        height: 44px;
        padding: 3px;
        border-radius: 14px;
        gap: 0;
    }

    .profileButton .profileFirstName,
    .profileButton > i {
        display: none;
    }

    .profileButton img {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .profileDropdown {
        position: fixed;
        top: calc(var(--topbar-h) + 6px);
        right: 12px;
        width: min(260px, calc(100vw - 24px));
        max-height: calc(100dvh - var(--topbar-h) - 20px);
        overflow-y: auto;
    }

    .profileDropdown::before {
        right: 18px;
    }

    .profileDropdown a {
        height: 48px;
    }

    .loginButton {
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .topbarWrapper {
        padding: 0 10px;
        gap: 6px;
    }

    .topbarLogo a {
        font-size: 20px;
    }

    .topbarActions {
        gap: 6px;
    }

    .loginButton {
        padding: 0 12px;
        font-size: 13px;
    }
}

/* Hareket azaltma tercihine saygı */
@media (prefers-reduced-motion: reduce) {
    .topbarWrapper { animation: none; opacity: 1; transform: none; }
    .new-breathing-badge { animation: none; }
    .topbarNav, .navBackdrop, .navToggle span { transition: none; }
}

/* Karanlık mod: mobil menü */
body.dark-mode .navToggle {
    background: #1e1e1e;
    border-color: #333;
}

body.dark-mode .navToggle span {
    background: #f1f1f1;
}

@media (max-width: 960px) {
    body.dark-mode .topbarNav {
        background: #1a1a1a;
        border-color: #2a2a2a;
        box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
    }

    body.dark-mode .mobileThemeButton {
        background: #242424;
        border-color: #333;
        color: #e5e5e5;
    }

    body.dark-mode .navBackdrop {
        background: rgba(0, 0, 0, 0.55);
    }
}

/* ============================= */
/* VERIFY NOTICE */
/* ============================= */

.verifyNotice {
    width: 100%;
    display: none;
    background: rgba(22, 163, 74, 0.10);
    border-bottom: 1px solid rgba(22, 163, 74, 0.18);
    font-family: 'Josefin Sans', sans-serif;
}

.verifyNotice.show {
    display: block;
}

.verifyNoticeInner {
    width: min(86%, 1500px);
    min-height: 38px;
    margin: 0 auto;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: 14px;
    font-weight: 800;
}

.verifyNoticeInner span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.verifyNoticeInner i {
    color: #16a34a;
}

.verifyNoticeInner button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #15803d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.18s ease;
}

.verifyNoticeInner button:hover {
    background: rgba(22, 163, 74, 0.12);
}

@media (max-width: 600px) {
    .verifyNoticeInner {
        width: 92%;
        min-height: 44px;
        font-size: 13px;
    }
}

.profileFirstName {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    max-width: 90px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}







/* ============================= */
/* SIMPLE ADMIN DROPDOWN LINK */
/* ============================= */

.profileDropdown .adminSimpleLink {
    height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255, 91, 0, 0.08);
    color: #ff5b00;
    border: 1px solid rgba(255, 91, 0, 0.14);
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 7px;
    transition: 0.2s ease;
}

.profileDropdown .adminSimpleLink i {
    color: #ff5b00;
    font-size: 15px;
}

.profileDropdown .adminSimpleLink:hover {
    background: #ff5b00;
    color: #fff;
    border-color: #ff5b00;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 91, 0, 0.20);
}

.profileDropdown .adminSimpleLink:hover i {
    color: #fff;
}

.dropdownDivider {
    width: 100%;
    height: 1px;
    background: rgba(17, 24, 39, 0.08);
    margin: 8px 0;
}


/* ============================= */
/* ARAMA SONUÇLARI DROPDOWN      */
/* ============================= */

/* Sonuçların Listelendiği Dropdown Kutusu */
.searchResultsDropdown {
    position: absolute;
    top: 55px; /* Arama çubuğunun hemen altında */
    right: 0;
    width: 250px; /* Genişleyen arama çubuğu ile aynı boyutta */
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    padding: 12px;
    display: none; /* JS ile açılacak */
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    animation: dropDownAnim 0.2s ease forwards;
}

@keyframes dropDownAnim {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdown Scrollbar */
.searchResultsDropdown::-webkit-scrollbar { width: 6px; }
.searchResultsDropdown::-webkit-scrollbar-thumb { background: rgba(255, 91, 0, 0.3); border-radius: 10px; }

/* Kategori Başlıkları (Kullanıcılar / Yazılar) */
.searchSectionTitle {
    font-size: 11px;
    font-weight: 900;
    color: #ff5b00;
    text-transform: uppercase;
    margin: 12px 10px 6px;
    letter-spacing: 0.5px;
}
.searchSectionTitle:first-child { margin-top: 5px; }

/* Sonuç Satırı (Tıklanabilir Linkler) */
.searchResultItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    text-decoration: none;
    transition: 0.2s ease;
}

.searchResultItem:hover {
    background: rgba(255, 91, 0, 0.08);
}

.searchResultItem img {
    flex-shrink: 0;
    object-fit: cover;
}

/* Kullanıcı Yuvarlak, Yazı Kare Resim */
.searchAvatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255, 91, 0, 0.2);
}

.searchPostImg {
    width: 50px;
    height: 42px;
    border-radius: 10px;
}

/* İçerik Metinleri */
.searchResultItem div {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Taşan yazılar için kritik */
}

.searchResultItem strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.searchResultItem span {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
}

.searchEmpty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
}

.topbarChatIcon {
    color: #1f2937;
    font-size: 22px;
    margin: 0 15px; /* Arama butonu ve tema butonu ile arasını açar */
    transition: 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .topbarChatIcon:hover {
    color: #ff5b00;
    transform: scale(1.1);
  }

  /* Karanlık tema (Dark Mode) uyumu */
  body.dark-mode .topbarChatIcon {
    color: #f3f4f6;
  }
  
  body.dark-mode .topbarChatIcon:hover {
    color: #ff5b00;
  }

  .chatBadge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444; /* Dikkat çekici kırmızı */
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
    border: 2px solid #ffffff; /* Beyaz temada buton dış çizgisi */
    pointer-events: none;
  }

  body.dark-mode .chatBadge {
    border-color: #1f2937; /* Karanlık temada buton dış çizgisi */
  }




/* ========================================= */
/* TOPBAR "YENİ!" NEFES ALAN ÇAPRAZ ROZET    */
/* ========================================= */

.nav-item-relative {
    position: relative; 
    display: inline-flex;
    align-items: center;
}

.new-breathing-badge {
    position: absolute;
    /* YERLEŞİM AYARLARI */
    top: 6px;  /* + alt - üst */
    left: -21px;  /* '- sal + sağ */
    
    background-color: #78c83d;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    pointer-events: none; 
    
    animation: breatheBadge 2s infinite ease-in-out;
}

/* Nefes Alma ve Çapraz Duruş (Rotate) Animasyonu */
@keyframes breatheBadge {
    0% {
        /* rotate(-8deg) ile rozeti hafif sola yatırarak çapraz bir görünüm kazandırıyoruz */
        transform: scale(0.95) rotate(-8deg);
        background-color: #8ee04e; 
        box-shadow: 0 0 0 rgba(142, 224, 78, 0.4);
    }
    50% {
        transform: scale(1.1) rotate(-8deg);
        background-color: #5ea828; 
        box-shadow: 0 0 10px rgba(94, 168, 40, 0.6); 
    }
    100% {
        transform: scale(0.95) rotate(-8deg);
        background-color: #8ee04e;
        box-shadow: 0 0 0 rgba(142, 224, 78, 0.4);
    }
}

/* ========================================= */
/* DUYURULAR MENÜSÜ BİLDİRİM ROZETİ          */
/* ========================================= */
.topbarNav a .announcementBadge {
    position: absolute; 
    top: 6px; /* 12px'den 6px'e düşürdük: Rozeti yukarı (çapraza) çeker */
    right: -12px; /* -18px'den -8px'e çektik: Rozeti 'r' harfine yapıştırır */
    
    background: #ef4444; 
    color: #ffffff;
    font-size: 10px; 
    font-weight: 900;
    padding: 3px 6px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    pointer-events: none;
}

/* Karanlık temada parlamayı dengeler */
body.dark-mode .topbarNav a .announcementBadge {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}