:root {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --accent-color: #ff5252;
    --accent-hover: #ff7b7b;
    --border-color: #404040;
    --input-bg: #3d3d3d;
}
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem 1rem;
    line-height: 1.6;
}
h1,
h2 {
    color: var(--accent-color);
    text-align: center;
}
.container {
    background-color: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 0 auto 2rem auto;
    max-width: 900px;
    transition: max-width 0.3s ease;
}

.container.wide-layout {
    max-width: 100%;
}
.card {
    background-color: var(--input-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
}
input {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}
input:focus {
    border-color: var(--accent-color);
}

/* Accessibility & Keyboard Navigation */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

[role="button"]:focus {
    outline: none;
}

[role="button"]:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}
button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    transition:
        background-color 0.2s,
        transform 0.1s;
}
button:hover {
    background-color: var(--accent-hover);
}
button:active {
    transform: scale(0.98);
}
button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}
.flex {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.justify-center {
    justify-content: center;
}
.items-center {
    align-items: center;
}
ul {
    list-style: none;
    padding: 0;
}
li {
    margin-bottom: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}
.status-msg {
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
}
.timer-display {
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(255, 82, 82, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Expandable Section */
.expand-btn {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    margin-bottom: 0.5rem;
}
.expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}
.expand-content {
    display: none;
    margin-top: 1rem;
}
.expand-content.open {
    display: block;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th,
td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
th {
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.text-nowrap {
    white-space: nowrap;
}

/* State Tags */
.state-tag {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.state-tag.running {
    background-color: #2196f3;
    color: white;
}
.state-tag.done {
    background-color: #4caf50;
    color: white;
}
.state-tag.deleted {
    background-color: #f44336;
    color: white;
}
.state-tag.canceled {
    background-color: #ff9800;
    color: white;
}

/* Login & Auth */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.header-flex h1 {
    margin: 0;
}
.logout-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background-color: var(--border-color);
}
.logout-btn:hover {
    background-color: var(--accent-color);
}
.user-display {
    font-size: 0.85rem;
    color: #888;
    font-weight: bold;
}
.login-form {
    max-width: 400px;
    margin: 0 auto;
}
.flex-col {
    display: flex;
    flex-direction: column;
}
.items-end {
    align-items: flex-end;
}
.gap-2 {
    gap: 0.5rem;
}
.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.auth-switch a {
    color: var(--accent-color);
    text-decoration: none;
}
.auth-switch a:hover {
    text-decoration: underline;
}
.hint {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin-top: 1rem;
}

/* Filters */
.filters-container {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--border-color);
}

.filter-search {
    flex: 1;
    min-width: 150px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.wrap {
    flex-wrap: wrap;
}

.mb-1 {
    margin-bottom: 1rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.nav-btn {
    background-color: transparent;
    border: 1px solid transparent;
    color: #888;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
}

.filter-preset-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    background-color: var(--border-color);
    border: 1px solid transparent;
    color: var(--text-color);
    border-radius: 4px;
}

.filter-preset-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #888;
    border: 1px solid var(--border-color);
    align-items: center;
}

.stats-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.stats-value {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1rem;
}

.stats-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: #666;
}

/* Stats View Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stats-card {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stats-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.stats-card.full-width {
    grid-column: 1 / -1;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-desc-label {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.stats-list-scroll {
    max-height: 200px;
    overflow-y: auto;
}

/* Timeline/Bar Chart */
.stats-timeline {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding-top: 20px;
    overflow-x: auto;
}

/* Heatmap Styles */
.heatmap-container {
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.heatmap-header {
    display: flex;
    margin-bottom: 4px;
}

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

.heatmap-row {
    display: flex;
    gap: 2px;
    align-items: center;
}

.day-label {
    width: 50px;
    font-size: 0.7rem;
    color: #666;
    text-align: right;
    margin-right: 8px;
}

.day-label-empty {
    width: 58px;
}

.hour-label {
    width: 14px;
    font-size: 0.6rem;
    color: #666;
    text-align: center;
    margin-right: 2px;
}

.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    transition: transform 0.1s;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
}

.heatmap-cell.empty {
    background-color: rgba(255, 255, 255, 0.03);
}

.heatmap-cell.low {
    background-color: #ffdada; /* Sehr helles rot */
}

.heatmap-cell.medium {
    background-color: #ff7b7b; /* Mittleres rot */
}

.heatmap-cell.high {
    background-color: var(--accent-color); /* Kräftiges rot */
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.5rem;
}

.heatmap-legend .heatmap-cell {
    width: 10px;
    height: 10px;
}

/* Calendar View Styles */
.calendar-view {
    display: flex;
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    max-height: 2700px;
    overflow-y: auto;
}

.calendar-time-axis {
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.3);
    padding-top: 40px; /* Header offset */
}

.time-mark {
    height: 320px;
    font-size: 0.7rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.calendar-days {
    display: flex;
    flex-grow: 1;
}

.calendar-day-col {
    flex: 1;
    min-width: 150px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.calendar-day-header {
    height: 40px;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.calendar-day-body {
    position: relative;
    height: 7680px; /* 24 hours * 320px */
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px
    );
    background-size: 100% 320px;
}

.calendar-session-block {
    position: absolute;
    left: 4px;
    right: 4px;
    background-color: var(--accent-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.session-block-desc {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 25px;
}

.timeline-bar {
    width: 100%;
    background-color: var(--accent-color);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 2px;
}

.timeline-count {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #888;
}

.timeline-count {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #888;
}

.timeline-date {
    font-size: 0.65rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Inline Editor & List Styles */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item-container {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.session-item-container.expanded {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.active-session-item {
    border-left: 4px solid var(--accent-color);
    background-color: rgba(255, 82, 82, 0.05);
}

.active-session-item .session-desc {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.session-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.session-summary:focus {
    background-color: rgba(255, 255, 255, 0.08);
}

.session-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.session-time {
    font-size: 0.75rem;
    color: #888;
}

.session-desc {
    font-weight: 500;
}

.session-meta-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-duration {
    font-size: 0.85rem;
    color: #aaa;
}

.expand-icon {
    font-size: 0.7rem;
    color: #666;
    width: 1rem;
    text-align: center;
}

.inline-editor {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

.form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    border-color: var(--accent-color);
}

.ratings-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.rating-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    cursor: pointer;
    font-size: 1.2rem;
    color: #444;
    transition: color 0.1s;
    outline: none;
    display: inline-block;
}

.star:focus {
    color: #666;
}

.star:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.star.active {
    color: var(--accent-color);
}

.star:hover {
    color: var(--accent-hover);
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.save-btn {
    padding: 0.5rem 1.5rem;
}

.quick-delete-btn {
    background-color: transparent;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-delete-btn:hover {
    background-color: #f44336;
    color: white;
}

.quick-clone-btn {
    background-color: transparent;
    border: 1px solid #4caf50;
    color: #4caf50;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-clone-btn:hover {
    background-color: #4caf50;
    color: white;
}

.delete-btn-subtle {
    background: transparent;
    color: #666;
    border: 1px solid #444;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.delete-btn-subtle:hover {
    background-color: #f44336;
    border-color: #f44336;
    color: white;
}

.error-msg {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    .session-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .session-meta-info {
        width: 100%;
        justify-content: space-between;
    }
    .ratings-inline-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Evaluation View */
.evaluation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.evaluation-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    border-left-width: 6px;
}

.evaluation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.evaluation-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.evaluation-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.evaluation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-label {
    background-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

.evaluation-notes {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.evaluation-notes strong {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.2rem;
}

.evaluation-notes p {
    margin: 0;
    color: #ccc;
    white-space: pre-wrap;
}

.evaluation-ratings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.rating-label {
    color: #888;
}

.rating-value {
    font-weight: bold;
    color: var(--accent-color);
    background-color: rgba(255, 82, 82, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Evaluation Card Inputs */
.evaluation-title-input {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.2rem 0;
    width: 100%;
    margin-bottom: 0.5rem;
    transition: border-bottom-color 0.2s;
}

.evaluation-title-input:focus {
    border-bottom-color: var(--accent-color);
}

.evaluation-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
}

.evaluation-field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.evaluation-tags-input,
.evaluation-notes-input {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 0.85rem !important;
    padding: 0.4rem !important;
}

.rating-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-btn {
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    background-color: var(--border-color);
    line-height: 1;
}

.evaluation-save-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Footer Styles */
.app-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: #666;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-link-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 0;
    font-size: 0.8rem;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
}

.footer-link-btn:hover {
    color: var(--accent-color);
    background: transparent;
}

/* Impressum Overlay */
.impressum-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.impressum-card {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-left: 6px solid var(--accent-color);
    background-color: var(--container-bg);
}

.impressum-content {
    margin: 1.5rem 0;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-color);
}

.impressum-content p {
    margin-bottom: 1rem;
}

.impressum-content strong {
    color: var(--accent-color);
}
