/* --- File: ./static/css/pages/tracker.css --- */
/* Spezifische Stile nur für die Tracker-Seite (tracker.html) */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    flex-basis: calc(50% - 0.75rem);
    min-width: 220px;
    box-sizing: border-box;
}

.control-group label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
    font-size: 1rem;
}

#rat-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 150px;
    min-height: 150px;
    overflow-y: auto;
    background-color: var(--input-bg);
    padding: 0.625rem 0.9375rem;
    border-radius: 0.5rem;
    border: 1px solid var(--input-border-color);
    width: 100%;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

#rat-selector label {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: var(--input-text);
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: 0;
    font-size: 1rem;
}

.gender-icon-male {
    color: #87CEFA;
    font-size: 0.8em;
}
.gender-icon-female {
    color: #f06292;
    font-size: 0.8em;
}
html[data-theme="light"] .gender-icon-male {
    color: #1565c0;
}
html[data-theme="light"] .gender-icon-female {
    color: #c2185b;
}


#rat-selector input[type="checkbox"] {
    margin-right: 0.625rem;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}

#time-period {
    padding: 0.625rem 0.875rem;
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--input-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    font-family: inherit;
}

#time-period:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px var(--input-focus-shadow), inset 0 1px 3px rgba(0,0,0,0.2);
}

.filter-tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding-bottom: 5px;
}

.filter-tab {
    padding: 8px 15px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color-light);
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    margin-bottom: -1px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

html[data-theme="light"] .filter-tab {
    color: #333333;
}


.filter-tab:hover {
    color: var(--text-color);
    background-color: var(--table-row-even-bg);
    border-bottom-color: var(--border-color-light);
}

html[data-theme="light"] .filter-tab:hover {
    color: var(--text-color);
}

.filter-tab.active {
    color: var(--text-color);
    background-color: var(--box-bg-color);
    border: 1px solid var(--border-color);
    border-bottom: 3px solid var(--accent-color);
    cursor: default;
}

html[data-theme="light"] .filter-tab.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--btn-primary-text);
}


.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9375rem;
}

.stat-item {
    background-color: var(--input-bg);
    padding: 0.625rem 0.9375rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
html[data-theme="light"] .stat-item {
     background-color: #f1f3f5;
}


.stat-label {
    font-weight: bold;
    color: var(--text-color-light);
    margin-right: 0.625rem;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: bold;
}

#stats-no-data {
    margin-top: 0.9375rem;
}

.stat-value.positive { color: #81c784; }
.stat-value.negative { color: #e57373; }
.stat-value.neutral { color: var(--text-color-light); }

html[data-theme="light"] .stat-value.positive { color: #2e7d32; }
html[data-theme="light"] .stat-value.negative { color: #c62828; }


.chart-legend-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 15px;
    margin-bottom: 1.25rem;
    padding: 5px 0;
    min-height: 28px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color-light);
    transition: opacity 0.2s ease;
}

.legend-item.hidden {
    opacity: 0.5;
    text-decoration: line-through;
}

.legend-color-box {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-color-light);
    margin-right: 6px;
    display: inline-block;
    border-radius: 2px;
}

.legend-label {
}

.chart-container {
    position: relative;
    aspect-ratio: 2 / 1;
    min-height: 350px;
    max-width: 100%;
}

.chart-container.skeleton-loading {
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}

#chart-no-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.table-container {
    margin-top: 1.875rem;
    max-height: 450px;
    overflow-y: auto;
}

#data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--box-text-color);
    border: none;
    font-size: 1rem;
}

#data-table th,
#data-table td {
    border: none;
    border-bottom: 1px solid var(--table-border-color);
    padding: 0.625rem 0.75rem;
    text-align: left;
    vertical-align: middle;
}

#data-table thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    position: sticky;
    top: -1px;
    z-index: 1;
    font-weight: bold;
    font-size: 1rem;
}

#data-table tbody tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}

#data-table tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

#data-table tbody tr:last-child td {
    border-bottom: none;
}

#table-no-data-message {
    padding-top: 1.25rem;
}

#data-table tbody td a {
    color: var(--link-color);
}

/* --- Skeleton Styles für Tracker-Seite --- */
@keyframes skeleton-pulse {
  0% { background-color: var(--input-bg); }
  50% { background-color: var(--box-border-color); }
  100% { background-color: var(--input-bg); }
}

.skeleton-text {
    background-color: var(--input-bg);
    border-radius: 4px;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
}

.stat-item.skeleton .stat-value,
.stat-item.skeleton .stat-label {
    color: transparent;
}

.stat-item.skeleton .stat-label .skeleton-text {
    width: 80px;
    height: 0.9rem;
    display: inline-block;
}
.stat-item.skeleton .stat-value .skeleton-text {
    width: 50px;
    height: 1rem;
    display: inline-block;
}

.legend-item.skeleton .legend-color-box {
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}

.legend-item.skeleton .legend-label {
    width: 80px;
    height: 0.9rem;
}

#data-table tbody tr.skeleton td .skeleton-text {
    height: 1rem;
    width: 80%;
}
#data-table tbody tr.skeleton td:last-child .skeleton-text {
    width: 40px;
}

#rat-selector .skeleton-item .skeleton-text {
    width: 120px;
    height: 1rem;
}
