.card {
    background-color: var(--card-background);
    border: none;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

/* Status for disabled sources */
.source-disabled {
    opacity: 0.4 !important;
    filter: grayscale(80%);
    transition: opacity 0.3s, filter 0.3s;
}

.source-disabled:hover {
    opacity: 0.7 !important;
    filter: grayscale(40%);
}

/* Tables */
.table {
    color: var(--text-color);
    background-color: #000 !important; /* Schwarzer Hintergrund für Tabelle */
    border-spacing: 0;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
}

.table thead th {
    background-color: #1a202c;
    border-bottom: 2px solid var(--secondary-color);
    color: var(--heading-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-top: none;
}

.table td {
    border-top: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    padding: 0.75rem;
}

/* Filmtitel in der Tabelle */
.film-notes-trigger {
    color: #fff !important;
    font-weight: 500;
    text-decoration: none;
}

.film-notes-trigger:hover {
    text-decoration: underline;
}

/* Badges in der Tabelle */
.badge-custom {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
    display: inline-block;
}

.badge-source {
    background-color: #2d3748;
    color: #e2e8f0;
    border: 1px solid #4a5568;
}

.badge-category {
    background-color: #2c5282;
    color: #fff;
}

.badge-priority {
    background-color: #2d3748;
    border: 1px solid #4a5568;
}

.badge-p1 { color: #f56565 !important; border-color: #f56565; font-weight: bold; }
.badge-p2 { color: #ed8936 !important; border-color: #ed8936; }
.badge-p3 { color: #ecc94b !important; border-color: #ecc94b; }

.badge-highlight {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px;
    padding: 2px 4px;
}

.rating-badge {
    background-color: #c05621;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Icons */
.edit-icon-table {
    font-size: 1.2rem;
    margin-left: 12px;
    cursor: pointer;
    color: var(--secondary-color);
    display: inline-block;
    padding: 2px 5px;
    vertical-align: middle;
}

.edit-icon-table:hover {
    color: var(--text-color);
    transform: scale(1.2);
}

.watched-icon {
    font-size: 1.1rem;
    color: #48bb78;
    margin-left: 8px;
    vertical-align: middle;
}

.text-dlna-partial {
    color: #9ae6b4 !important; /* Hellgrün für teilweise verfügbare DLNA-Reihen */
}

/* Shortlist Icon */
.shortlist-btn {
    font-size: 1.3rem;
    margin-right: 12px;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.1s, opacity 0.2s, filter 0.2s;
    vertical-align: middle;
    opacity: 0.25 !important;
    filter: grayscale(100%) brightness(0.7);
}

.shortlist-btn.active {
    opacity: 1 !important;
    filter: grayscale(0%) brightness(1.2);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
}

.shortlist-btn:hover {
    transform: scale(1.2);
    opacity: 0.6 !important;
}

/* Buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
}

.btn-icon.btn-sm {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
}

.btn-magic {
    background-color: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Badge in Quick Filter Buttons */
.btn-group.w-100 .btn {
    position: relative;
    padding-right: 2.5rem; /* Platz für Badge */
}

.btn-group.w-100 .btn .badge {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Quick Filter Pills */
.nav-pills .nav-link {
    color: var(--text-color);
    margin-right: 10px;
    border: 1px solid var(--secondary-color);
    position: relative;
    padding-right: 3.25rem;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-pills .nav-link .badge {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.3);
}

/* Series Grouping */
tr.series-header {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    cursor: pointer;
}

.series-toggle-btn {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 10px;
    transition: transform 0.2s;
    cursor: pointer;
    user-select: none;
}

.series-toggle-btn.open {
    transform: rotate(90deg);
}

.series-count-badge {
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
}

tr.series-child {
    background-color: rgba(0, 0, 0, 0.2);
    display: none;
}

tr.series-child.show {
    display: table-row;
}

tr.series-child td:first-child {
    padding-left: 45px;
    position: relative;
}

tr.series-child td:first-child::before {
    content: '↳';
    position: absolute;
    left: 15px;
    opacity: 0.5;
}

/* Grid View */
.grid-view-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-background);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    height: 100%;
}

.grid-poster-container {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: #1a202c;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.grid-overlay-top-left {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-overlay-top-right {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-overlay-bottom-right {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 10;
}

.grid-overlay-bottom-left {
    position: absolute;
    bottom: 5px;
    left: 5px;
    z-index: 10;
    max-width: 70%;
}

.grid-source-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.grid-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.grid-badge.watched { background-color: #48bb78; }
.grid-badge.shortlist { background-color: #ed8936; }
.grid-badge.warning { background-color: #f56565; }
.grid-badge.expiration-critical { background-color: #f56565; }
.grid-badge.expiration-warning { background-color: #ed8936; color: #1a202c; }

.grid-play-button {
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    border: 2px solid white;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    backdrop-filter: blur(2px);
    transition: transform 0.2s, background 0.2s;
}

.grid-play-button.broken {
    border-color: #f56565;
    color: #f56565;
}

.grid-play-button.partial {
    border-color: #9ae6b4;
    color: #9ae6b4;
}

.grid-info {
    padding: 8px 10px;
    background: var(--card-background);
}

/* Progress & Alerts */
.progress {
    background-color: #1a202c;
    border: 1px solid var(--secondary-color);
    height: 1.5rem;
    border-radius: 1rem;
}

.alert-info, .alert-danger, .alert-success, .alert-warning {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary-color);
    color: var(--text-color);
}
