/* ═══════════════════════════════════════════════
   Social App — Design System
   Modern koyu tema, Inter font, responsive
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Renkler (OLED Dark Theme - User Spec) */
  --bg-primary: #000000;
  --bg-secondary: #121212;
  --bg-card: #121212;
  --bg-card-hover: #262626;
  --bg-input: #262626;
  --bg-modal: rgba(0, 0, 0, 0.85);

  --border: #262626;
  --border-focus: #0095F6;

  --text-primary: #F5F5F5;
  --text-secondary: #A8A8A8;
  --text-muted: #A8A8A8;
  --text-link: #0095F6;

  --accent: #0095F6;
  --accent-hover: #007bb5;
  --accent-glow: rgba(0, 149, 246, 0.3);

  --danger: #FF3040;
  --danger-hover: #d92532;
  --success: #10b981;
  --warning: #f59e0b;

  --like-color: #FF3040;
  --like-active: #d92532;

  /* Gradient */
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  --gradient-card: linear-gradient(145deg, #121212 0%, #000000 100%);

  /* Tipografi */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.8125rem;
  --font-base: 0.9375rem;
  --font-md: 1.0625rem;
  --font-lg: 1.25rem;
  --font-xl: 1.5rem;
  --font-2xl: 2rem;
  --font-3xl: 2.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 15px var(--accent-glow);

  /* Transition */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Layout */
  --max-width: 680px;
  --header-h: 64px;
}


/* ── Reset + Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-wrap: break-word;
  word-break: break-word;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ── Utility ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 960px;
}

.header-logo {
  font-size: var(--font-lg);
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-nav a,
.header-nav button {
  font-size: var(--font-sm);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: var(--font-xs);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-google {
  background: #fff;
  color: #333;
  font-weight: 500;
  border: 1px solid #ddd;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-google img {
  width: 18px;
  height: 18px;
}

/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-base);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

select.form-input {
  cursor: pointer;
}

.form-error {
  color: var(--danger);
  font-size: var(--font-xs);
  margin-top: var(--space-xs);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-focus);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Avatar ── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-secondary);
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
}

/* ── Post Card ── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: border-color var(--transition);
  animation: fadeInUp 0.3s ease;
}

.post-card:hover {
  border-color: rgba(124, 92, 252, 0.3);
}

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.post-user-info {
  flex: 1;
}

.post-name {
  font-weight: 600;
  font-size: var(--font-base);
  color: var(--text-primary);
}

.post-username {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.post-time {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.post-content {
  font-size: var(--font-base);
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Truncated post content */
.post-content-wrap {
  position: relative;
}

.post-content-wrap .post-content {
  max-height: 10em;
  /* ~6 satır */
  overflow: hidden;
  margin-bottom: 0;
}

.post-content-wrap.expanded .post-content {
  max-height: none;
}

.post-content-wrap .read-more-fade {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3em;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
}

.post-content-wrap.has-overflow .read-more-fade {
  display: block;
}

.post-content-wrap.expanded .read-more-fade {
  display: none;
}

.read-more-btn {
  display: inline-block;
  margin-top: var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: var(--font-sm);
  color: var(--text-link);
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-family);
}

.read-more-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.post-actions {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.post-action {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: var(--font-family);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.post-action:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.post-action.liked {
  color: var(--like-color);
}

.post-action.liked:hover {
  color: var(--like-active);
}

.post-score {
  margin-left: auto;
  font-size: var(--font-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Comment ── */
.comment {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
}

.comment:first-child {
  border-top: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.comment-name {
  font-weight: 600;
  font-size: var(--font-sm);
}

.comment-time {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.comment-content {
  font-size: var(--font-sm);
  color: var(--text-primary);
  line-height: 1.5;
  margin-left: calc(32px + var(--space-sm));
}

.comment-actions {
  margin-left: calc(32px + var(--space-sm));
  margin-top: var(--space-xs);
}

.comment-replies {
  margin-left: calc(32px + var(--space-sm));
  padding-left: var(--space-lg);
  border-left: 2px solid var(--border);
  margin-top: var(--space-sm);
}

/* ── Post Compose ── */
.compose-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.compose-box .compose-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.compose-box textarea {
  flex: 1;
  min-height: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-base);
  resize: none;
  outline: none;
  transition: border-color var(--transition);
}

.compose-box textarea:focus {
  border-color: var(--accent);
}

.compose-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

/* ── Profile Header ── */
.profile-header {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.profile-name {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-top: var(--space-md);
}

.profile-username {
  font-size: var(--font-base);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.profile-bio {
  font-size: var(--font-base);
  color: var(--text-secondary);
  margin-top: var(--space-md);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.profile-meta {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-md);
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
}

/* ── Auth Page ── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}

.auth-title {
  text-align: center;
  font-size: var(--font-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  text-align: center;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xl);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

.modal-title {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.modal-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-xl);
  color: var(--text-primary);
  font-size: var(--font-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideInRight 0.3s ease;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.empty-state-text {
  font-size: var(--font-base);
}

/* ── Dropdown ── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) 0;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  display: block;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/* ── Scroll ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Main Content ── */
.main-content {
  padding-top: calc(var(--header-h) + var(--space-xl));
  min-height: 100vh;
}

/* ── Notification Badge ── */
.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.notif-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: scaleIn 0.2s ease;
}

/* ── Notification Page ── */
.notif-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.notif-page-header h1 {
  font-size: var(--font-xl);
  font-weight: 700;
}

/* ── Notification Card ── */
.notif-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-card);
  transition: all var(--transition);
  cursor: pointer;
  animation: fadeInUp 0.3s ease;
}

.notif-card:hover {
  border-color: rgba(124, 92, 252, 0.3);
  background: var(--bg-card-hover);
}

.notif-card.unread {
  border-left: 3px solid var(--accent);
  background: rgba(124, 92, 252, 0.04);
}

.notif-card .notif-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
}

.notif-card .notif-body {
  flex: 1;
  min-width: 0;
}

.notif-card .notif-message {
  font-size: var(--font-base);
  color: var(--text-primary);
  line-height: 1.5;
}

.notif-card .notif-message strong {
  font-weight: 600;
  color: var(--accent-hover);
}

.notif-card .notif-time {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.notif-card .notif-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.notif-card .notif-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  opacity: 0;
}

.notif-card:hover .notif-delete-btn {
  opacity: 1;
}

.notif-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  :root {
    --space-xl: 1rem;
    --space-2xl: 1.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .auth-card {
    padding: var(--space-xl);
  }

  .post-card {
    padding: var(--space-lg);
  }

  .header-logo {
    font-size: var(--font-base);
  }

  .notif-card .notif-delete-btn {
    opacity: 1;
  }
}