/* tasarim1 — panel prototipi (mesajlaşma dashboard’undan uyarlanmış SEO / AI Makale kabuğu) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700&display=swap");

:root {
  color-scheme: dark;
  --bg-deep: #121214;
  --bg-panel: #1a1a1d;
  --bg-elevated: #222226;
  --bg-hover: #2a2a2f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.18);
  --accent-glow: rgba(139, 92, 246, 0.35);
  --success: #22c55e;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 268px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

body.app-panel.browser-frame-active {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-deep);
}

.browser-shell a {
  color: inherit;
  text-decoration: none;
}

.browser-shell button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.panel-app {
  display: flex;
  min-height: 100vh;
}

/* --- Sol geniş menü --- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: 20px 14px 16px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--accent-glow);
  text-decoration: none;
}

.sidebar__logo--has-img {
  width: auto;
  max-width: 160px;
  min-width: 44px;
  height: 44px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__logo-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sidebar__brand-text {
  min-width: 0;
}

.sidebar__brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.sidebar__brand-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

button.sidebar__link {
  cursor: pointer;
}

.sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar__link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sidebar__section-title {
  margin: 0 0 10px 12px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar__sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__sublink {
  display: block;
  padding: 8px 12px 8px 40px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.sidebar__sublink:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar__sublink.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.sidebar__spacer {
  flex: 1;
  min-height: 16px;
}

.sidebar__link--ghost {
  margin-top: auto;
}

/* --- Ana alan --- */
.panel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-deep);
}

.panel-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 26, 29, 0.85);
  backdrop-filter: blur(12px);
}

.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search input::placeholder {
  color: var(--text-muted);
}

.panel-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.user-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, var(--accent));
}

.user-chip__meta {
  text-align: left;
}

.user-chip__name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-chip__role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.main__body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Sohbet başlığı (detay sayfası) */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.chat-header__status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-header__status .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
}

.chat-header__status .dot.is-off {
  background: var(--text-muted);
}

/* Mesaj / içerik balonları */
.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.msg {
  max-width: 85%;
}

.msg--in {
  align-self: flex-start;
}

.msg--out {
  align-self: flex-end;
}

.msg__bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.msg--in .msg__bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.msg--out .msg__bubble {
  background: linear-gradient(135deg, #7c3aed, var(--accent));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.msg__time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 0 4px;
}

.msg--out .msg__time {
  text-align: right;
  color: rgba(255, 255, 255, 0.65);
}

.link-card {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  max-width: 320px;
}

.link-card__img {
  height: 120px;
  background: linear-gradient(145deg, var(--bg-elevated), #2d2640);
}

.link-card__body {
  padding: 12px;
}

.link-card__title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.link-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.link-card__url {
  font-size: 0.7rem;
  color: var(--accent);
}

/* Özet kartları (index) */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-card__hint {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
}

.section-title a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}

/* Araçlar grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.tool-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--accent);
}

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.tool-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tool-card__link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* Araç detay — orta sütunda kartlar: daha geniş his, modern çerçeve (container--blog) */
.main__body .container.container--blog > .card {
  position: relative;
  border-radius: 18px;
  padding: 2rem 2rem 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    165deg,
    rgba(39, 39, 42, 0.92) 0%,
    rgba(24, 24, 27, 0.88) 45%,
    rgba(24, 24, 27, 0.94) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(139, 92, 246, 0.14);
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.main__body .container.container--blog > .card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #7c3aed, #6366f1, #22d3ee);
  opacity: 0.95;
  pointer-events: none;
}

.main__body .container.container--blog > .card:hover {
  border-color: rgba(167, 139, 250, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 22px 56px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.22);
}

@media (max-width: 640px) {
  .main__body .container.container--blog > .card {
    padding: 1.35rem 1.2rem 1.45rem;
    border-radius: 16px;
  }
}

/* Form alanı (arac-detay) */
.form-panel {
  max-width: 640px;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-primary {
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, var(--accent));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.output-preview {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Tarayıcı tam sayfa kabuğu --- */
html.browser-frame-root,
html.browser-frame-root body.browser-frame-active {
  height: 100%;
}

body.browser-frame-active {
  background: #252526;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  display: block;
}

.browser-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.browser-chrome {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: #323232;
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 14px 0 12px;
  flex-shrink: 0;
  background: #252526;
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
}

.browser-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.browser-toolbar .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.browser-toolbar .user-chip {
  padding: 4px 10px 4px 4px;
  max-width: min(220px, 50vw);
}

.browser-toolbar .user-chip__meta {
  min-width: 0;
}

.browser-toolbar .user-chip__name,
.browser-toolbar .user-chip__role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9rem;
}

.browser-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.browser-menu__link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #b4b4b8;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.browser-menu__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}

.browser-menu__link.is-active {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.22);
}

.browser-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  overflow: hidden;
}

.browser-viewport .panel-app {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
}

.browser-viewport .sidebar {
  min-height: 0;
  max-height: 100%;
  height: 100%;
  align-self: stretch;
}

.browser-viewport .panel-main {
  min-height: 0;
  overflow: hidden;
}

.browser-viewport .main__body {
  min-height: 0;
}

@media (max-width: 900px) {
  .panel-app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: unset;
    max-height: none;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px;
    gap: 6px;
  }

  .sidebar__brand {
    width: 100%;
    padding-bottom: 12px;
    margin-bottom: 0;
  }

  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
  }

  .sidebar__link {
    padding: 8px 12px;
  }

  .sidebar__section {
    width: 100%;
    margin-top: 4px;
    padding-top: 12px;
  }

  .sidebar__spacer {
    display: none;
  }

  .sidebar__link--ghost {
    margin-top: 0;
  }

  body.browser-frame-active {
    min-height: 100dvh;
  }

  .browser-shell {
    min-height: 100dvh;
    height: auto;
  }

  .browser-menu {
    flex-wrap: wrap;
    gap: 2px;
    max-width: 100%;
  }

  .browser-menu__link {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .browser-toolbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 10px;
  }

  .browser-toolbar__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .browser-viewport .panel-app {
    overflow: visible;
    max-height: none;
  }

  .browser-viewport .sidebar {
    height: auto;
  }

  .browser-viewport .panel-main {
    overflow: visible;
  }

  /* Panel mobil: tek kaydırma (gövde); iç içe scroll kapat */
  html.browser-frame-root {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.app.app-panel.browser-frame-active.layout-panel {
    display: block;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
  }

  body.app.app-panel.browser-frame-active.layout-panel .browser-shell {
    flex: none;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  body.app.app-panel.browser-frame-active.layout-panel .main__body {
    overflow: visible;
  }
}

/* app.css ile uyum: panel içi genişlik */
body.app-panel.layout-panel .panel-main .container {
  max-width: min(1040px, 95vw);
}

/*
 * Masaüstü: tek kaydırma — footer ile birlikte 100vh taşmasın;
 * yalnızca .main__body içeriği kayar (çift scrollbar önlenir).
 * (Mobil kuralları yukarıdaki @media (max-width: 900px) içinde.)
 */
@media (min-width: 901px) {
  html.browser-frame-root {
    height: 100%;
    overflow: hidden;
  }

  body.app.app-panel.browser-frame-active.layout-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  @supports (height: 100dvh) {
    html.browser-frame-root {
      height: 100dvh;
      max-height: 100dvh;
    }

    body.app.app-panel.browser-frame-active.layout-panel {
      height: 100dvh;
      max-height: 100dvh;
    }
  }

  body.app.app-panel.browser-frame-active.layout-panel .browser-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  body.app.app-panel.browser-frame-active.layout-panel > .footer {
    flex-shrink: 0;
  }
}
