/* Grundlegende Stile */
body {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    background: hsl(var(--b2));
    color: hsl(var(--bc));
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 50%, #bcccdc 100%);
}

html:not([data-theme]) body {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 50%, #bcccdc 100%);
}

/* Container und Karten */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--tw-shadow-lg);
}

/* Überschriften */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: hsl(var(--bc));
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: hsl(var(--p));
    border-color: hsl(var(--p));
    color: hsl(var(--pc));
}

.btn-primary:hover {
    background-color: hsl(var(--pf));
    border-color: hsl(var(--pf));
}

.btn-action {
    background-color: hsl(var(--er));
    border-color: hsl(var(--er));
    color: hsl(var(--erc));
}

.btn-action:hover {
    background-color: hsl(var(--er) / 90%);
    border-color: hsl(var(--er) / 90%);
}

/* Formulare */
.form-control {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: hsl(var(--p));
    box-shadow: 0 0 0 0.2rem hsl(var(--p) / 25%);
}

/* Tabellen */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th,
.table td {
    border: none;
    padding: 12px 15px;
    vertical-align: middle;
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;    
    background-color: hsl(var(--b3));
    color: hsl(var(--bc));
    border-bottom: 2px solid hsl(var(--b3));
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: hsl(var(--b2) / 50%);
}

.table tbody tr:hover {
    background-color: hsl(var(--b3) / 50%);
}

.table td {
    border-bottom: 1px solid hsl(var(--b3));
}

/* Responsive Tabelle */
@media screen and (max-width: 600px) {
    .table-responsive {
        overflow-x: auto;
    }
}

/* Statistik-Karten */
.stat {
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: hsl(var(--bc) / 60%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: hsl(var(--bc));
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Animationen */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(59, 130, 246, 0.2); }
    100% { background-color: transparent; }
}

.highlight {
    animation: highlight 1s ease-in-out;
}

/* Zusätzliche Verbesserungen */
.navbar {
    backdrop-filter: blur(10px);
    background-color: hsl(var(--b1) / 80%);
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: hsl(var(--n));
    color: hsl(var(--nc));
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Tabelle Anpassungen */
.table-responsive {
    overflow-x: auto;
}

.table td,
.table th {
    white-space: nowrap;
}

/* Karten ohne extra Rahmen */
.card {
    border: none;
}

/* Dark mode spezifische Anpassungen */
[data-theme="dark"] .navbar {
    background-color: hsl(var(--n) / 80%);
}

[data-theme="dark"] .table thead th {
    background-color: hsl(var(--n));
    border-bottom-color: hsl(var(--n));
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: hsl(var(--n) / 50%);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: hsl(var(--n) / 70%);
}

[data-theme="dark"] .table td {
    border-bottom-color: hsl(var(--n));
}

/* Sidebar and Layout */
.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    left: 0;
    top: 0;
    background: hsl(var(--b2));
    transition: transform 0.3s ease;
    z-index: 100;
    border-right: 1px solid hsl(var(--bc) / 0.12);
    padding-top: 1rem;
}

/* Add a lighter background color for the sidebar in light mode */
[data-theme="light"] .sidebar {
    background: hsl(var(--b1));
}

[data-theme="dark"] .sidebar {
    background: hsl(var(--b3));
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.main-content {
    margin-left: 250px;
    padding: 1rem;
    padding-top: 4rem;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 0;
}

.navbar {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(100% - 250px);
    height: 4rem;
    transition: width 0.3s ease;
    background: hsl(var(--b2));
    border-bottom: 1px solid hsl(var(--bc) / 0.12);
    z-index: 50;
    padding: 0 1rem;
}

.navbar.expanded {
    width: 100%;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: hsl(var(--bc));
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
    position: relative;
    overflow: hidden;
}

.sidebar-link:hover {
    background-color: hsl(var(--p) / 0.16);
    color: hsl(var(--bc));
    transform: translateX(5px);
}

.sidebar-link.active {
    background-color: hsl(var(--p));
    color: hsl(var(--pc));
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: hsl(var(--p));
    opacity: 0.2;
    transition: width 0.3s ease;
}

.sidebar-link:hover::before {
    width: 100%;
}

.sidebar-link i {
    width: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.sidebar-link:hover i {
    transform: scale(1.2);
}

/* Navbar center alignment */
.navbar-center {
    flex: 1;
    justify-content: center;
    display: flex;
}

.navbar-center img {
    transition: transform 0.3s ease;
}

.navbar-center:hover img {
    transform: scale(1.1);
}

.navbar-center .text-xl {
    white-space: nowrap; /* Ensure the title stays on one line */
}

/* Responsive Layout */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .navbar {
        width: 100%;
    }
    
    .navbar-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}
