@import "colors.css";

/* Card wrapper for centered, narrow tables */
.table-card {
  max-width: 42rem;
  margin: 1rem auto;
  padding: 0.5rem;
  background: var(--ct-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.04);
}

/* Generic table container */
.table-container {
  overflow: hidden; /* clip inner shadows */
  overflow-x: auto; /* allow horizontal scrolling when needed */
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  padding: 0.25rem;
}

/* Contact table (used on index.php) */
.contact-table {
  background: linear-gradient(180deg, var(--ct-color), var(--header-color));
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08), inset 0 0 0 6px rgba(34,83,35,0.08);
  background-clip: padding-box;
  text-align: left;
  font-size: 1.4rem;
  border-spacing: 0;
  border-collapse: separate; /* allow rounded corners on cells */
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.contact-table thead th,
.contact-table th {
  background: var(--green50-color);
  color: var(--blk-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow:
    inset 0 6px 14px -8px rgba(67,160,71,0.18),
    inset 6px 0 14px -8px rgba(67,160,71,0.14),
    inset -6px 0 14px -8px rgba(67,160,71,0.14),
    inset 0 0 0 6px rgba(34,83,35,0.10);
}

.contact-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--grey300-color);
  color: var(--blk-color);
  vertical-align: middle;
  background: var(--grey50-color);
}

/* Team page specific container width */
.team-page .table-container {
  max-width: 60rem;
}

/* Team table: compact, rounded rows, left accent */
.team-table {
  width: 100%;
  border-collapse: separate; /* enable rounded rows */
  border-spacing: 0 0.6rem; /* vertical gap between rows */
  margin: 1rem auto;
  font-size: 1rem;
  text-align: left;
}

.team-table th, .team-table td {
  padding: 12px 14px;
  vertical-align: middle;
  border: none; /* backgrounds live on cells to allow rounded corners */
}

/* Alternating cell backgrounds */
.team-table tbody tr:nth-child(odd) td {
  background: var(--grey50-color);
  box-shadow: 0 6px 14px rgba(16,24,40,0.03);
}

.team-table tbody tr:nth-child(even) td {
  background: var(--green50-color);
  box-shadow: 0 6px 14px rgba(16,24,40,0.03);
}

/* Rounded corners on the left/right ends of each row */
.team-table tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
.team-table tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Left accent bar via shadow on the first cell */
.team-table tbody tr td:first-child {
  box-shadow: inset 6px 0 0 var(--green600-color), 0 6px 14px rgba(16,24,40,0.03);
}
.team-table tbody tr:hover td:first-child {
  box-shadow: inset 10px 0 0 var(--green600-color), 0 12px 24px rgba(16,24,40,0.06);
}

/* Hover: lift the row slightly */
.team-table tbody tr:hover td {
  transform: translateY(-6px);
  transition: transform 220ms ease;
}

/* Name emphasis and portrait sizing */
.team-table td:nth-child(2) {
  font-weight: 700;
  color: var(--blk-color);
}

.mini-portrait {
  height: 3.5rem;
  width: auto;
  border-radius: 4px;
}

.team-photo {
  width: 100%;
  max-width: 55rem;
  height: auto;
  margin: 0 auto 2rem auto;
  display: block;
  border-radius: 8px;
}

/* Accessibility: ensure transform doesn't clip */
.team-table td {
  will-change: transform;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .team-table tbody tr td:first-child {
    box-shadow: inset 4px 0 0 var(--green600-color), 0 4px 10px rgba(16,24,40,0.02);
  }
  .team-table th, .team-table td {
    padding: 10px 12px;
  }
  .team-table {
    border-spacing: 0 0.4rem;
  }
}

/* Backwards compatible styled-table (keeps previous modern look) */
.styled-table {
  background-color: #ffffff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.06), inset 0 0 0 6px rgba(34,83,35,0.10);
  border-collapse: separate; /* allow rounded corners on cells */
  border-spacing: 0;
  margin: 1rem 0;
  font-size: 16px;
  width: 100%;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.styled-table thead th,
.styled-table th {
  background-color: #f7fafc;
  color: var(--blk-color);
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.98rem;
  border-bottom: 1px solid #eef2f2;
  box-shadow: inset 0 0 0 6px rgba(34,83,35,0.08);
}

.styled-table th, .styled-table td {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f1f3f4;
  text-align: left;
  color: var(--blk-color);
}

.styled-table tbody tr:hover {
  background-color: #fbfdfb;
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(16,24,40,0.06);
}

/* Specific modern table for Schulstunden (keeps styling consistent with .styled-table) */
.stunden-table {
  background-color: #ffffff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(34,83,35,0.06);
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0;
  font-size: 16px;
  width: 100%;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.stunden-table thead th,
.stunden-table th {
  background: var(--green400-color); /* einheitliche, flache Farbe */
  color: #fff;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.96rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.stunden-table th, .stunden-table td {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f1f3f4;
  text-align: left;
  color: var(--blk-color);
}

.stunden-table tr:last-child td {
  border-bottom: none;
}

.stunden-table tbody tr:nth-child(odd) td {
  background: var(--alt-div-color); /* grey100 */
}
.stunden-table tbody tr:nth-child(even) td {
  background: var(--grey200-color); /* grey200 */
}

.stunden-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.7rem 1rem;
  color: #ffffff;
  display: block;
  background: linear-gradient(90deg, var(--green400-color), var(--green600-color));
  border-radius: 12px 12px 0 0;
  margin-bottom: 0.35rem;
}

.stunden-table thead th:first-child { border-top-left-radius: 12px; }
.stunden-table thead th:last-child { border-top-right-radius: 12px; }
