/* ==========================================================================
   Actorsbase – Text-Analyse Styles
   Skript-, Monolog- & Dialog-Analysewerkzeug für Schauspieler & Regie
   ========================================================================== */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #080808;
  color: #eee;
  margin: 0;
  font-family: inherit;
}

main.wrap {
  flex: 1;
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem 1.25rem;
  box-sizing: border-box;
}

/* Tool Header */
.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tool-header h1 {
  margin: 0;
  color: var(--accent-color, #ff8c42);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.tool-header p {
  color: #999;
  margin: 0.35rem 0 0 0;
  font-size: 0.95rem;
}

/* 2-Spalten Layout: Mehr Platz für den Editor */
.analysis-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
}

.card {
  background: var(--tile-bg, #14151a);
  border: 1px solid #2d2e38;
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

/* Sticky Dashboard auf Desktops */
.dashboard-card {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 #14151a;
}

/* ==========================================================================
   Editor & Toolbar
   ========================================================================== */

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.editor-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.editor-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-tool {
  background: #1c1d25;
  border: 1px solid #353644;
  color: #ccc;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-tool:hover {
  background: #282a38;
  border-color: var(--accent-color, #ff8c42);
  color: #fff;
}

.btn-tool.primary {
  background: rgba(255, 140, 66, 0.15);
  border-color: rgba(255, 140, 66, 0.4);
  color: var(--accent-color, #ff8c42);
}

.btn-tool.primary:hover {
  background: var(--accent-color, #ff8c42);
  color: #000;
}

.btn-tool.danger:hover {
  background: rgba(230, 57, 70, 0.2);
  border-color: #e63946;
  color: #ff6b6b;
}

/* Großes Textfeld */
.editor-textarea {
  width: 100%;
  min-height: 520px;
  background: #0d0e12;
  border: 1px solid #2a2b36;
  border-radius: 10px;
  color: #fff;
  padding: 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-textarea:focus {
  outline: none;
  border-color: var(--accent-color, #ff8c42);
  box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.2);
}

.editor-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: #777;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Metrics Dashboard
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: #0d0e12;
  border: 1px solid #242530;
  border-radius: 10px;
  padding: 0.9rem 0.65rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  border-color: rgba(255, 140, 66, 0.3);
  transform: translateY(-2px);
}

.metric-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #888;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  font-family: monospace;
}

.metric-sub {
  font-size: 0.72rem;
  color: #666;
  margin-top: 0.2rem;
}

/* Dashboard Sections */
.dashboard-section {
  border-top: 1px solid #23242e;
  padding-top: 1.35rem;
  margin-top: 1.35rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.section-head h3 {
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Speaking Times */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.time-box {
  background: #0d0e12;
  border: 1px solid #242530;
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.time-box-title {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.time-box-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-color, #ff8c42);
  font-family: monospace;
}

/* Table: Rollen & Sprechanteile */
.role-table-wrap {
  background: #0d0e12;
  border: 1px solid #242530;
  border-radius: 10px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #1a1b24;
}

.data-table th {
  background: #121319;
  color: #888;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.data-table tr:hover td {
  background: rgba(255, 140, 66, 0.04);
}

.role-bar-container {
  width: 100%;
  height: 5px;
  background: #20212a;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.role-bar-fill {
  height: 100%;
  background: var(--accent-color, #ff8c42);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Role Filter Active Pill */
.role-filter-banner {
  background: rgba(255, 140, 66, 0.12);
  border: 1px solid rgba(255, 140, 66, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #fff;
}

/* Keyword Badges */
.keywords-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.keyword-badge {
  display: inline-flex;
  align-items: center;
  background: #101116;
  border: 1px solid #2b2c38;
  color: #ddd;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.keyword-badge:hover {
  border-color: var(--accent-color, #ff8c42);
  color: #fff;
}

.keyword-count {
  background: var(--accent-color, #ff8c42);
  color: #000;
  font-weight: 800;
  font-size: 0.72rem;
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.45rem;
}

.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #aaa;
  user-select: none;
}

.checkbox-toggle input {
  accent-color: var(--accent-color, #ff8c42);
}

.placeholder-text {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.88rem;
  background: #0d0e12;
  border-radius: 8px;
  border: 1px dashed #262732;
}

/* Privacy Banner */
.privacy-banner {
  background: rgba(138, 201, 38, 0.08);
  border: 1px solid rgba(138, 201, 38, 0.3);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.88rem;
  color: #bbb;
  line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .analysis-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-card {
    position: static;
    max-height: none;
  }
  .editor-textarea {
    min-height: 400px;
  }
}

@media (max-width: 600px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .time-grid {
    grid-template-columns: 1fr;
  }
  .editor-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
