/* === AUTH BUTTONS & HEADER USER === */
/* Butonların yüklenirken titremesini önlemek için */
.auth-buttons {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* JS yüklendiğinde bu sınıfı ekleyeceğiz */
.auth-buttons.loaded {
    opacity: 1;
}

/* === AUTH BUTTONS (PILL STYLE) === */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Giriş yapmamış kullanıcı butonları */
.auth-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  transition: var(--transition);
  white-space: nowrap; /* Metnin taşmasını engelle */
}

.auth-btn.login {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.auth-btn.signup:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: transparent;
}

.auth-btn.login:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* === AUTH GROUP BUTTON (GİRİŞ / KAYIT) === */
.auth-pill-button {
  display: flex;
  align-items: center;
  background-color: var(--theme-surface-card); /* Biraz daha koyu zemin */
  border: 1px solid var(--color-border);
  border-radius: 8px; /* Standart buton köşesi */
  overflow: hidden;
  transition: all 0.3s ease;
}

.auth-btn-part {
  padding: 10px 12px; /* Dikey dolgu 6'dan 10'a çıkarıldı */
  font-size: 11px; 
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-transform: uppercase; 
}

.auth-btn-part i {
  font-size: 13px;
  opacity: 0.8;
}

/* Giriş Yap Kısmı - Mavi Hover */
.login-part:hover {
  background-color: #2980b9;
  color: #fff;
}

/* Kayıt Ol Kısmı - Kırmızı Hover */
.signup-part:hover {
  background-color: #c0392b;
  color: #fff;
}

.auth-divider {
  width: 1px;
  height: 20px;
  background-color: var(--color-border); /* Daha silik bir ayırıcı */
}

.auth-pill-button:hover {
  border-color: var(--color-accent);
  box-shadow: var(--theme-shadow-soft);
}

/* === LOGGED IN USER (Profil Menüsü) === */
.user-profile-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background-color: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  border: 2px solid var(--theme-surface-card);
}

.user-name {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  max-width: 120px; /* Uzun isimleri kes */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1101px) {
  .auth-buttons {
    flex: 0 0 auto;
    gap: 10px;
  }

  .user-profile-container {
    gap: 8px;
    max-width: 112px;
  }

  .user-name {
    max-width: 72px;
  }
}

@media (min-width: 1451px) {
  .user-name {
    max-width: 90px;
  }
}

/* Profil Dropdown Menüsü (Modernize Edildi - Performans Odaklı) */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--theme-surface-card); /* Blur yerine solid renk */
  border: 1px solid var(--theme-border-soft);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--theme-shadow-strong);
  z-index: 1002;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.profile-dropdown.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-dropdown button {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.profile-dropdown button:hover {
  background-color: var(--theme-overlay-soft);
  color: var(--color-text);
  padding-left: 18px; /* Hafif sağa kayma efekti */
}

/* Özel Renkli Butonlar */
#adminNewsBtn:hover {
  background-color: rgba(227, 10, 23, 0.08) !important;
  color: #E30A17 !important;
}

#mySubsBtn:hover {
  background-color: rgba(52, 152, 219, 0.08) !important;
  color: #3498db !important;
}

#logoutBtn {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-radius: 0 0 10px 10px;
  color: #ef4444 !important;
}

#logoutBtn:hover {
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
}

/* Bot Doğrulaması (Turnstile) Mobil Fix */
#turnstile-widget-container, 
#login-turnstile-container, 
#forgot-turnstile-container {
    min-height: 70px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 10001;
    touch-action: manipulation; /* Dokunmatik etkileşimi iyileştir */
}

.auth-modal__dialog {
    transform: translateZ(0); /* Hardware acceleration ve dokunma iyileştirmesi */
    backface-visibility: hidden;
}

/* === RESPONSIVE (MOBİL) === */
@media (max-width: 900px) {
  .header {
    padding: 10px 20px !important;
  }

  .auth-buttons {
    display: flex !important;
    align-items: center;
    padding: 0 !important;
    border: 0 !important;
    width: auto !important;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .auth-btn-part {
    padding: 6px 8px; /* Padding küçültüldü */
    font-size: 9px; /* Font küçültüldü */
    gap: 4px;
  }
  .auth-pill-button {
    border-radius: 6px; /* Köşe yuvarlaklığı küçültüldü */
  }
  .auth-divider {
    height: 14px; /* Ayırıcı boyutu küçültüldü */
  }
}

@media (max-width: 380px) {
  .auth-btn-part {
    padding: 5px 6px;
    font-size: 7.5px;
  }

  .auth-divider {
    height: 12px;
  }
}

/* === AYARLAR YAN PANELİ (SIDEBAR) === */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8); /* Blur yerine düz koyu renk */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    will-change: opacity; /* GPU Hint */
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90%;
    height: 100vh;
    background: var(--theme-surface-card);
    border-left: 1px solid var(--theme-border-soft);
    z-index: 9999;
    transform: translateX(100%); /* Right yerine Transform kullan (GPU) */
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    will-change: transform; /* GPU Hint */
}

.settings-sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.settings-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--theme-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--theme-surface-inset);
}

.settings-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-close-btn {
    background: var(--theme-overlay-soft);
    border: none;
    color: var(--color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.settings-close-btn:hover {
    background: var(--theme-border-soft);
    color: var(--color-text);
    transform: rotate(90deg);
}

/* Sidebar Content */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* Tabs in Sidebar */
.settings-tabs {
    display: flex;
    background: var(--theme-overlay-soft);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.settings-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-tab-btn.active {
    background: var(--theme-surface-card);
    color: var(--color-text);
    box-shadow: var(--theme-shadow-soft);
}

.settings-tab-btn:hover:not(.active) {
    color: var(--color-text);
}

/* Notifications */
.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-on-accent, #fff);
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--theme-surface-card);
}
.notif-badge[hidden],
.dropdown-notif-count[hidden] {
    display: none !important;
}
.dropdown-notif-count {
    min-width: 18px;
    height: 18px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #E30A17;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.notifications-dialog {
    max-width: 560px !important;
}
.notifications-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-right: 34px;
}
.notifications-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notifications-title i {
    color: var(--color-accent, #E30A17);
}
.notifications-subtitle {
    margin: 5px 0 0;
    color: var(--color-text-muted, #888);
    font-size: 0.9rem;
}
.notifications-unread-pill {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(227, 10, 23, 0.28);
    border-radius: 999px;
    background: rgba(227, 10, 23, 0.1);
    color: var(--color-accent, #E30A17);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
.notifications-unread-pill.is-clear {
    border-color: var(--color-border, rgba(255,255,255,0.1));
    background: rgba(46, 204, 113, 0.08);
    color: #2ecc71;
}
.notifications-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}
.notifications-loading,
.notifications-empty {
    margin: 0;
    padding: 24px 16px;
    color: var(--color-text-muted, #888);
    text-align: center;
}
.notifications-footer {
    margin-top: 14px;
    text-align: right;
}
.mark-all-read-btn {
    background: var(--theme-surface-float, rgba(255,255,255,0.05));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--color-accent, #E30A17);
    cursor: pointer;
    padding: 9px 12px;
    font-size: 0.86rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.mark-all-read-btn:hover:not(:disabled) {
    border-color: var(--color-accent, #E30A17);
    background: rgba(227, 10, 23, 0.08);
}
.mark-all-read-btn:disabled {
    cursor: default;
    opacity: 0.5;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-left-width: 4px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.notif-item.unread {
    background: var(--theme-surface-card-alt, rgba(255,255,255,0.06));
    border-left-color: var(--color-accent, #E30A17);
    opacity: 1;
}
.notif-item.unread:hover {
    transform: translateY(-1px);
    border-color: rgba(227, 10, 23, 0.32);
}
.notif-item.read {
    background: rgba(255,255,255,0.025);
    border-left-color: rgba(46, 204, 113, 0.42);
    opacity: 0.74;
}
.notif-item__status {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(227, 10, 23, 0.12);
    color: var(--color-accent, #E30A17);
}
.notif-item.read .notif-item__status {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}
.notif-item__body {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.notif-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.notif-item__header strong {
    color: var(--color-text, #fff);
    overflow-wrap: anywhere;
}
.notif-item__state {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(227, 10, 23, 0.12);
    color: var(--color-accent, #E30A17);
    font-size: 0.72rem;
    font-weight: 800;
}
.notif-item.read .notif-item__state {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}
.notif-item__body p {
    margin: 0;
    color: var(--color-text-muted, #aaa);
    font-size: 0.95rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.notif-item__date {
    display: block;
    margin-top: 7px;
    color: var(--color-text-muted, #888);
    font-size: 0.78rem;
}
.notif-action-btn {
    border: 1px solid rgba(227, 10, 23, 0.24);
    border-radius: 999px;
    background: rgba(227, 10, 23, 0.08);
    color: var(--color-accent, #E30A17);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.notif-action-btn:hover:not(:disabled) {
    background: var(--color-accent, #E30A17);
    color: #fff;
}
.notif-action-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}
.notif-read-icon {
    color: #2ecc71;
    font-size: 1rem;
    padding: 7px 9px;
}
@media (max-width: 560px) {
    .notifications-head {
        flex-direction: column;
        padding-right: 30px;
    }
    .notif-item {
        gap: 10px;
        padding: 12px;
    }
    .notif-action-btn span {
        display: none;
    }
}
