﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #0A66C2;
    --blue-dark: #084f98;
    --black: #111111;
    --gray: #f5f7fa;
    --border: #e2e8f0;
    --text-light: #666666;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: white;
    color: var(--black);
    line-height: 1.6;
}

header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
}

header a {
    display: inline-block;
}

header svg {
    display: block;
    width: min(420px, 90vw);
    height: auto;
}

nav {
    background: var(--black);
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

nav a:hover {
    background: var(--blue);
}

main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

form {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--gray);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

label {
    font-weight: 600;
}

input[type="search"],
input[type="email"],
input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
}

input[type="search"]:focus,
input[type="email"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}

button {
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

button:hover {
    background: var(--blue-dark);
}

main > a {
    text-decoration: none;
    color: inherit;
    display: block;
}

article {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

article:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.10);
}

article h2 {
    color: var(--black);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

article p {
    color: var(--text-light);
}

footer {
    margin-top: 60px;
    padding: 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 25px;
    background: var(--gray);
}

footer a {
    text-decoration: none;
    color: var(--black);
    font-weight: 600;
}

footer a:hover {
    color: var(--blue);
}

@media (max-width: 700px) {
    header {
        text-align: center;
    }

    header svg {
        margin: 0 auto;
    }

    nav {
        gap: 8px;
    }

    nav a {
        padding: 10px 14px;
    }

    main {
        margin: 28px auto;
    }

    form {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="search"],
    button {
        width: 100%;
    }

    article {
        padding: 18px;
    }

    article h2 {
        font-size: 1.2rem;
    }

    footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* =========================
   Detailseite Arbeitsblatt
========================= */

main h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--black);
}

main > p {
    max-width: 720px;
    margin-bottom: 28px;
    color: var(--text-light);
    font-size: 1.05rem;
}

main > div {
    margin-bottom: 14px;
}

main > div a {
    display: block;
    max-width: 520px;
    padding: 16px 20px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--border);
    background: white;
    color: var(--black);
    transition: all 0.2s ease;
}

main > div a:hover {
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.10);
}

/* Erster Button stärker hervorheben */
main > div a {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

main > div a:hover {
    background: var(--blue-dark);
    color: white;
}

/* Mobilgeräte */
@media (max-width: 700px) {
    main h2 {
        font-size: 1.55rem;
    }

    main > div a {
        max-width: none;
        width: 100%;
    }
}

/* =========================
   Sitzungen erstellen
========================= */

main form[action^="setsession.php"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    max-width: 900px;
    background: var(--gray);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    margin-top: 24px;
}

main form[action^="setsession.php"] br {
    display: none;
}

main form[action^="setsession.php"] input[type="text"] {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: white;
}

main form[action^="setsession.php"] input[type="text"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}

main form[action^="setsession.php"] button {
    grid-column: 1 / -1;
    margin-top: 8px;
    justify-self: start;
    min-width: 260px;
}

/* =========================
   Sitzungsübersicht
========================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.04);
}

th,
td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--black);
    color: white;
    font-weight: 700;
}

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

td a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

td a:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

tr:hover td {
    background: var(--gray);
}

/* Logout-Link unter Tabellen */
table + div {
    margin-top: 24px;
}

table + div a {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--black);
    color: white;
    text-decoration: none;
    font-weight: 700;
}

table + div a:hover {
    background: var(--blue);
}

/* Mobile Tabellen */
@media (max-width: 700px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        padding: 12px 14px;
    }
}

/* =========================
   Einzelne Sitzung / QR-Übersicht
========================= */

/* Tabelle nur so breit wie nötig */
main table {
    width: auto;
    max-width: 100%;
    table-layout: auto;
}

/* Zellen kompakter machen */
main table th,
main table td {
    padding: 12px 14px;
    white-space: nowrap;
}

/* Alle Spalten zentrieren */
main table th,
main table td {
    text-align: center;
}

/* Erste Spalte linksbündig */
main table th:first-child,
main table td:first-child {
    text-align: left;
}

/* QR-Spalten besonders kompakt */
main table th:nth-child(n+4),
main table td:nth-child(n+4) {
    width: 1%;
    min-width: 48px;
    padding-left: 10px;
    padding-right: 10px;
}

/* PDF-Spalten kompakt */
main table th:nth-child(2),
main table th:nth-child(3),
main table td:nth-child(2),
main table td:nth-child(3) {
    width: 1%;
}

/* Statuspunkte schöner darstellen, auch wenn sie noch inline gestylt sind */
main table span {
    vertical-align: middle;
}

/* =========================
   Login
========================= */

main form input[type="email"] {
    min-width: 320px;
}

@media (max-width: 700px) {
    main form input[type="email"] {
        min-width: 0;
        width: 100%;
    }
}

/* =========================
   Deaktivierte Aktionen
========================= */

.disabled-action {
    max-width: 520px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #f8f9fb;
    color: #888;
    font-weight: 700;
    margin-bottom: 14px;
}

.disabled-action span {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
}

/* =========================
   Account-Aktionen
========================= */

.account-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.account-actions a {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}

/* Logout */
.account-actions a:first-child {
    background: var(--black);
    color: white;
}

.account-actions a:first-child:hover {
    background: var(--blue);
}

/* Account löschen */
.secondary-action {
    background: #f1f3f5;
    color: #666;
    border: 1px solid var(--border);
}

.secondary-action:hover {
    background: #e9ecef;
    color: var(--black);
}

.delete-account {
    background: #d32f2f;
    color: white !important;
    border: 1px solid #d32f2f;
}

.delete-account:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    color: white !important;
}

/* =========================
   Startseite
========================= */

.hero-info {
    text-align: center;
	margin-top: -15px;
    margin-bottom: 20px;
}

.hero-info h1 {
    font-size: 1.8rem;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--black);
}

.hero-info p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .hero-info {
        margin-bottom: 18px;
    }

    .hero-info h1 {
        font-size: 1.4rem;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .hero-info p {
        font-size: 0.95rem;
        line-height: 1.4;
    }
}