/* ============================================
   Hubs App – Complete Stylesheet
   Font: 'Be Vietnam Pro', sans-serif
   ============================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/playfair-display-v40-latin-700italic.woff2') format('woff2');
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background-color: #f5f5f5;
  color: #333333;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- App Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.header-back {
  display: flex;
  align-items: center;
  color: #666666;
  cursor: pointer;
  z-index: 1;
}

.header-back:hover {
  color: #4a90d9;
}

.header-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333333;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
}

.header-user {
  font-size: 0.85rem;
  color: #666666;
}

.header-logout {
  display: flex;
  align-items: center;
  color: #666666;
}

.header-logout:hover {
  color: #e74c3c;
}

/* --- Layout --- */
main {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.container {
  padding: 0 1rem;
}

/* --- Login --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: #ffffff;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  text-align: center;
  color: #4a90d9;
}

.login-subtitle {
  text-align: center;
  color: #666666;
  margin: 0 0 2rem;
  font-size: 0.875rem;
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.login-form .form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-group--checkbox input {
  width: auto !important;
}

/* --- Dashboard Tiles --- */
.tiles,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem 0;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: #ffffff;
  min-height: 140px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.tile:active {
  transform: translateY(0);
}

.tile-icon svg {
  width: 36px;
  height: 36px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
}

.tile-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  text-align: center;
}

.tile-admin-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.7;
}

.tile-admin-badge svg {
  width: 16px;
  height: 16px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
}

/* Tile color variants */
.tile-blue {
  background: linear-gradient(135deg, #4a90d9, #3a7bc8);
}

.tile-green {
  background: linear-gradient(135deg, #5aba47, #4aa83d);
}

.tile-purple {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.tile-teal {
  background: linear-gradient(135deg, #20c997, #1bb389);
}

.tile-orange {
  background: linear-gradient(135deg, #f5a623, #e6971a);
}

.tile-red {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* --- Cards & Content --- */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-image {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  max-height: 200px;
  margin-bottom: 0.75rem;
}

.card-date {
  font-size: 0.75rem;
  color: #999999;
  display: inline-block;
  margin-bottom: 0.2rem;
}

.card-title,
.ora-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #333333;
  margin: 0.25rem 0 0.5rem;
}

.card-text {
  font-size: 0.9rem;
  color: #666666;
  line-height: 1.6;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 1rem;
}

.page-intro {
  font-size: 0.95rem;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  gap: 0.4rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: #4a90d9;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #3a7bc8;
}

.btn-secondary {
  background-color: #e8e8e8;
  color: #333333;
}

.btn-secondary:hover {
  background-color: #dddddd;
}

.btn-danger {
  background-color: #e74c3c;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block,
.btn--full {
  width: 100%;
}

.btn--primary {
  background-color: #4a90d9;
  color: #ffffff;
}

.btn--primary:hover:not(:disabled) {
  background-color: #3a7bc8;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-download {
  background-color: #4a90d9;
  color: #ffffff;
  gap: 0.5rem;
}

.btn-download:hover {
  background-color: #3a7bc8;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label,
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #444444;
}

.form-control,
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
  color: #333333;
}

.form-control:focus,
.form-input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.form-control::placeholder,
.form-input::placeholder {
  color: #b0b0b0;
}

textarea.form-control,
.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

select.form-control,
select.form-input {
  appearance: auto;
  cursor: pointer;
}

.form-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.form-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 1.25rem;
}

.form-actions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* --- Image Preview (Forms) --- */
.image-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* --- Checkbox --- */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check input[type="checkbox"] {
  accent-color: #4a90d9;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check label {
  cursor: pointer;
  font-size: 0.9rem;
}

/* --- Intro Card --- */
.intro-card {
  background: #f0f6fd;
  border: none;
  border-radius: 14px;
}

.intro-text {
  font-size: 0.95rem;
  color: #555555;
  line-height: 1.7;
}

/* --- Card Actions --- */
.card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.card-actions .inline-form {
  display: inline;
}

.btn-outline {
  background: #e8e8e8;
  color: #333333;
  border: none;
}

.btn-outline:hover {
  background: #dddddd;
}

.btn-danger-outline {
  background: none;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.btn-danger-outline:hover {
  background: #e74c3c;
  color: #ffffff;
}

/* --- Alerts --- */
.alert {
  padding: 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error,
.alert--error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert--error {
  margin-top: 1.5rem;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-neu {
  background-color: #cce5ff;
  color: #004085;
}

.badge-in-bearbeitung {
  background-color: #fff3cd;
  color: #856404;
}

.badge-beantwortet {
  background-color: #d4edda;
  color: #155724;
}

/* --- Category Sections (O.R.A.) --- */
.category-section {
  margin-bottom: 2rem;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0e0e0;
}

/* --- Big Story Chapters --- */
.chapter-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chapter-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  line-height: 0;
  font-weight: 700;
  font-style: italic;
  color: #4a90d9;
  border: 2px solid #4a90d9;
  border-radius: 4px;
  text-indent: 0;
  padding: 0;
}

.chapter-number span {
  display: block;
  transform: translateY(-4px);
}

.chapter-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #333333;
  line-height: 1.3;
}

.chapter-image {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.chapter-image img {
  width: 100%;
  display: block;
}

.chapter-text {
  font-size: 0.95rem;
  color: #555555;
  line-height: 1.75;
}

/* --- Event Date Badge (Service) --- */
.event-date-badge {
  width: 52px;
  text-align: center;
  flex-shrink: 0;
}

.event-date-day {
  font-size: 1.4rem;
  font-weight: 700;
  color: #4a90d9;
  line-height: 1.1;
}

.event-date-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #999999;
}

.event-time {
  font-size: 0.8rem;
  color: #999999;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #999999;
}

/* --- Actions & Header Row --- */
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* --- Image Preview (Forms) --- */
.image-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

/* --- Location --- */
.location {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #666666;
}

.location svg {
  width: 14px;
  height: 14px;
  color: #4a90d9;
  stroke: #4a90d9;
  fill: none;
}

/* --- Table (Admin) --- */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 2px solid #eeeeee;
  font-size: 0.8rem;
  color: #888888;
  text-transform: uppercase;
  font-weight: 600;
}

td {
  padding: 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

tr:hover td {
  background-color: #fafafa;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .tiles,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tile {
    padding: 1.5rem 0.75rem;
    min-height: 120px;
  }

  .tile-icon svg {
    width: 30px;
    height: 30px;
  }

  .tile-title {
    font-size: 0.85rem;
  }

  /* Card-based table layout on mobile */
  .table-responsive table,
  .table-responsive thead,
  .table-responsive tbody,
  .table-responsive th,
  .table-responsive td,
  .table-responsive tr {
    display: block;
  }

  .table-responsive thead {
    display: none;
  }

  .table-responsive tr {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 0.75rem;
    padding: 0.5rem;
  }

  .table-responsive td {
    border-bottom: none;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: #888888;
    text-transform: uppercase;
    margin-right: 0.5rem;
  }
}
