.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.media-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    /* min-height: 400px; */
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.media-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.media-card.not_visible::before{
    /* opacity: 1;
    filter: grayscale(100%); */
    backdrop-filter: grayscale(100%);
}

.media-content {
    position: relative;
    z-index: 2;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}

.media-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.media-poster {
    width: 80px;
    height: 120px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    flex-shrink: 0;
}

.media-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-link {
    color: var(--text);
    text-decoration: none;
}

/* .media-link:hover {
           color: var(--text-sub);
           text-decoration: underline;
       } */

.media-date {
    font-size: 16px;
    margin: 0.3rem 0 0.5rem;
    color: var(--text);
}

.provider-logos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.provider-logos img {
    flex: 0;
    width: 30px;
    height: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.media-card-buttons {
   display: flex;
   gap: 0.5rem;
   margin-top: 0.8rem;
   flex-wrap: wrap;
}

.category-section {
    margin-bottom: var(--spacing-40);
}

.toggle-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.2s ease;
    flex: 1;
}

.toggle-btn.visible {
    background-color: #4CAF50;
    color: white;
}

.toggle-btn.not_visible {
    background-color: rgba(255, 255, 255, 0.7);
    color: #666;
}

.delete-btn {
   padding: 0.4rem 0.8rem;
   border: none;
   cursor: pointer;
   background-color: #dc3545;
   color: white;
   transition: all 0.2s ease;
   flex: 1;
   min-width: 120px;
}

.delete-btn:hover {
   background-color: #c82333;
}

.on-air-btn, .add-with-time-btn {
   width: 30px;
   height: 30px;
   color: var(--text);
   font-size: 0.8rem;
   background: var(--primary-color);
   border:none;
}

.on-air-btn:hover, .add-with-time-btn:hover {
   background: var(--primary-color-hover);
}

.admin-actions {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 40px;
}

.search-container {
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
}

#tmdb-search {
    width: calc(100% - 2rem);
    padding: 1rem;
    border-radius: 2rem;
    border: 1px solid var(--background-light);
    font-size: 16px;
    background: var(--background-light);
    color: var(--text);
}

.search-results-flyout {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-dark);
    border: 1px solid var(--background-light);
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    display: flex;
    padding: 0.8rem;
    border-bottom: 1px solid var(--background-light);
    align-items: center;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.search-result-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    margin-right: 1rem;
    border-radius: 3px;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.search-result-year {
    font-size: 0.8rem;
    opacity: 0.7;
}

.search-result-type {
    font-size: 0.8rem;
    background: var(--accent-color);
    color: black;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    display: inline-block;
    margin-top: 0.3rem;
}

.search-result-add {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-add:hover {
    background-color: var(--accent-color);
}

.button-container{
   display: flex;
   justify-content: start;
   align-items: center;
   gap: 16px;
}

.media-card img{
   width: auto !important;
}

@media screen and (max-width: 600px) {
   .media-grid .media-card, .swiper-slide .media-card{
       background-image: none !important;
   }  

   .media-grid, .media-content{
       padding: 0;
   }

   .search-container{
       padding: 0;
   }
}

/* Provider-Sektion */
.provider-section {
   display: flex;
   flex-direction: row;
   gap: 8px;
   margin-top: 0.8rem;
}

.on-air-section{
    display: flex;
    flex-direction: row;
    gap: var(--spacing-4);
    align-items: center;
    justify-content: center;
}


.provider-add-section {
   display: flex;
}

.provider-add-btn {
   background-color: var(--primary-color);
   color: white;
   border: none;
   width: 30px;
   height: 30px;
   cursor: pointer;
   display: flex;
   align-items: center;
   gap: 0.5rem;
   transition: all 0.2s ease;
   font-size: 0.8rem;
   justify-content: center;
}

.provider-add-btn:hover {
   background-color: var(--primary-color-hover);
}

/* Modal Styles */
.modal {
   display: none;
   position: fixed;
   z-index: 10000;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.7);
   animation: fadeIn 0.3s ease;
}

.modal-content {
   background-color: var(--background-dark);
   margin: 5% auto;
   padding: 0;
   border-radius: 8px;
   width: 90%;
   max-width: 600px;
   max-height: 80vh;
   overflow-y: auto;
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
   animation: slideIn 0.3s ease;
}

.modal-header {
   padding: 1.5rem;
   border-bottom: 1px solid var(--background-light);
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.modal-header h2 {
   margin: 0;
   color: var(--primary-color);
}

.close {
   color: #aaa;
   font-size: 2rem;
   font-weight: bold;
   cursor: pointer;
   line-height: 1;
}

.close:hover {
   color: white;
}

.modal-body {
   padding: 1.5rem;
}

.modal-footer {
   padding: 1rem 1.5rem;
   border-top: 1px solid var(--background-light);
   display: flex;
   justify-content: flex-end;
   gap: 1rem;
}

/* Provider-Auswahl */
.provider-selection {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 1rem;
   margin-top: 1rem;
}

.provider-option {
   display: flex;
   align-items: center;
   padding: 1rem;
   border: 2px solid var(--background-light);
   border-radius: 8px;
   cursor: pointer;
   transition: all 0.2s ease;
}

.provider-option:hover {
   border-color: var(--accent-color);
   background-color: rgba(255, 255, 255, 0.05);
}

.provider-option.selected {
   border-color: var(--accent-color);
   background-color: rgba(245, 197, 24, 0.1);
}

.provider-option input[type="checkbox"] {
   margin-right: 1rem;
   transform: scale(1.2);
}

.provider-option img {
   width: 40px;
   height: 40px;
   object-fit: cover;
   border-radius: 4px;
   margin-right: 1rem;
}

.provider-option .provider-name {
   flex: 1;
   font-weight: 500;
}

/* Modal Buttons */
/* .modal-btn-cancel {
   background-color: var(--secondary-color);
   color: var(--text);
   border: none;
   padding: 0.5rem 1.5rem;
   cursor: pointer;
   transition: background-color 0.2s;
}

.modal-btn-cancel:hover {
   background-color: var(--secondary-color-hover);
} */

/* .modal-btn-save {
   background-color: var(--primary-color);
   color: var(--text);
   border: none;
   padding: 0.5rem 1.5rem;
   cursor: pointer;
   font-weight: 500;
}

.modal-btn-save:hover {
   background-color: var(--primary-color-hover);
} */

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

@keyframes slideIn {
   from { 
       opacity: 0; 
       transform: translateY(-50px); 
   }
   to { 
       opacity: 1; 
       transform: translateY(0); 
   }
}

/* Loading Spinner für Buttons */
.button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.button.loading:hover {
    background-color: inherit;
}

.fas.fa-spinner.fa-spin {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button-States */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    background-color: inherit;
}

.media-card-special { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.special-label { font-size: 0.9rem; color: #888; }
.special-select { padding: 6px 8px; border-radius: 6px; border: 1px solid #000; background: #111; width: 100%; color: #fff;}


.admin-radio-group {
    display: flex;
    flex-direction: row;
    margin-bottom: 24px;
    gap: 8px;
}

.admin-radio-group input[type="radio"] {
    width: auto;
    
}

#addIdForm .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}