/* Standard (Light Mode) Styles */
.gottesdienst-container {
    margin: 20px 0;
    overflow-x: auto;
}

/* Basis-Tabelle OHNE feste Farben */
.gottesdienst-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    /* KEINE background, color oder border hier! */
}

/* Light Mode nur wenn explizit gesetzt */
.gottesdienst-container[data-theme="light"] .gottesdienst-table,
.gottesdienst-table[data-theme="light"] {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
}

.gottesdienst-container[data-theme="light"] .gottesdienst-table th,
.gottesdienst-table[data-theme="light"] th {
    background: #f8f9fa !important;
    color: #333 !important;
    border-bottom: 1px solid #ddd !important;
}

.gottesdienst-container[data-theme="light"] .gottesdienst-table td,
.gottesdienst-table[data-theme="light"] td {
    background: #fff !important;
    color: #333 !important;
    border-bottom: 1px solid #ddd !important;
}

.gottesdienst-container[data-theme="light"] .gottesdienst-table tr:hover,
.gottesdienst-table[data-theme="light"] tr:hover {
    background: #f5f5f5 !important;
}

.gottesdienst-container[data-theme="light"] .gottesdienst-table tr:hover td,
.gottesdienst-table[data-theme="light"] tr:hover td {
    background: #f5f5f5 !important;
}

/* Dark Mode explizit definieren */
.gottesdienst-container[data-theme="dark"] .gottesdienst-table,
.gottesdienst-table[data-theme="dark"] {
    background: #333 !important;
    color: #e2e8f0 !important;
    border: 1px solid #4a5568 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.gottesdienst-container[data-theme="dark"] .gottesdienst-table th,
.gottesdienst-table[data-theme="dark"] th {
    background: #1a202c !important;
    color: #f7fafc !important;
    border-bottom: 1px solid #4a5568 !important;
}

.gottesdienst-container[data-theme="dark"] .gottesdienst-table td,
.gottesdienst-table[data-theme="dark"] td {
    border-bottom: 1px solid #4a5568 !important;
    background: #333 !important;
    color: #e2e8f0 !important;
}

.gottesdienst-container[data-theme="dark"] .gottesdienst-table tr:hover,
.gottesdienst-table[data-theme="dark"] tr:hover {
    background: #4a5568 !important;
}

.gottesdienst-container[data-theme="dark"] .gottesdienst-table tr:hover td,
.gottesdienst-table[data-theme="dark"] tr:hover td {
    background: #4a5568 !important;
}

/* Basis-Styles für alle Zellen */
.gottesdienst-table th,
.gottesdienst-table td {
    padding: 12px 15px;
    text-align: left;
    transition: all 0.3s ease;
}

.gottesdienst-table th {
    font-weight: bold;
}

/* Auto Mode */
.gottesdienst-container[data-theme="auto"] .gottesdienst-table,
.gottesdienst-table[data-theme="auto"] {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

.gottesdienst-container[data-theme="auto"] .gottesdienst-table th,
.gottesdienst-table[data-theme="auto"] th {
    background: #f8f9fa !important;
    color: #333 !important;
    border-bottom: 1px solid #ddd !important;
}

.gottesdienst-container[data-theme="auto"] .gottesdienst-table td,
.gottesdienst-table[data-theme="auto"] td {
    background: #fff !important;
    color: #333 !important;
    border-bottom: 1px solid #ddd !important;
}

/* Responsive Design */
.desktop-view {
    display: table-cell;
}

.mobile-view {
    display: none;
}

@media screen and (max-width: 768px) {
    .gottesdienst-table {
        font-size: 12px;
    }
    
    .gottesdienst-table th,
    .gottesdienst-table td {
        padding: 8px 10px;
    }
}

@media screen and (max-width: 600px) {
    .desktop-view {
        display: none !important;
    }
    
    .mobile-view {
        display: table-cell !important;
        padding: 15px 10px;
        line-height: 1.5;
    }
    
    .gottesdienst-table,
    .gottesdienst-table thead,
    .gottesdienst-table tbody,
    .gottesdienst-table th,
    .gottesdienst-table td,
    .gottesdienst-table tr {
        display: block;
    }
    
    .gottesdienst-table tr {
        margin-bottom: 10px;
        padding: 0;
        border-radius: 5px;
        transition: all 0.3s ease;
    }
    
    .gottesdienst-table td {
        border: none !important;
        padding: 15px;
        display: block;
    }
    
    /* Mobile Dark Mode */
    .gottesdienst-container[data-theme="dark"] .gottesdienst-table tr,
    .gottesdienst-table[data-theme="dark"] tr {
        border: 1px solid #4a5568 !important;
        background: #333 !important;
    }
    
    .gottesdienst-container[data-theme="dark"] .gottesdienst-table td,
    .gottesdienst-table[data-theme="dark"] td {
        background: #333 !important;
        color: #e2e8f0 !important;
    }
    
    /* Mobile Light Mode */
    .gottesdienst-container[data-theme="light"] .gottesdienst-table tr,
    .gottesdienst-table[data-theme="light"] tr,
    .gottesdienst-container:not([data-theme]) .gottesdienst-table tr,
    .gottesdienst-table:not([data-theme]) tr {
        border: 1px solid #ddd !important;
        background: #fff !important;
    }
}

/* Admin Styles */
.admingd {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.admingdform {
    display: inline;
    margin-left: 5px;
}

/* Preview Styles für Admin */
.gottesdienst-preview {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 15px;
}

.gottesdienst-preview[data-theme="dark"] {
    background: #1a202c;
    border-color: #4a5568;
}

.gottesdienst-preview[data-theme="dark"] .gottesdienst-table {
    background: #333 !important;
    color: #e2e8f0 !important;
    border: 1px solid #4a5568 !important;
}

.gottesdienst-preview[data-theme="dark"] .gottesdienst-table th {
    background: #1a202c !important;
    color: #f7fafc !important;
}

.gottesdienst-preview[data-theme="dark"] .gottesdienst-table td {
    color: #e2e8f0 !important;
    border-bottom: 1px solid #4a5568 !important;
    background: #333 !important;
}

.gottesdienst-preview[data-theme="dark"] .gottesdienst-table tr:hover {
    background: #4a5568 !important;
}

.gottesdienst-preview[data-theme="dark"] .gottesdienst-table tr:hover td {
    background: #4a5568 !important;
}

/* System Dark Mode Support für Auto-Modus */
@media (prefers-color-scheme: dark) {
    .gottesdienst-container[data-theme="auto"] .gottesdienst-table,
    .gottesdienst-table[data-theme="auto"] {
        background: #333 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
        border: 1px solid #4a5568 !important;
        color: #e2e8f0 !important;
    }
    
    .gottesdienst-container[data-theme="auto"] .gottesdienst-table th,
    .gottesdienst-table[data-theme="auto"] th {
        background: #1a202c !important;
        color: #f7fafc !important;
        border-bottom: 1px solid #4a5568 !important;
    }
    
    .gottesdienst-container[data-theme="auto"] .gottesdienst-table td,
    .gottesdienst-table[data-theme="auto"] td {
        border-bottom: 1px solid #4a5568 !important;
        background: #333 !important;
        color: #e2e8f0 !important;
    }
    
    .gottesdienst-container[data-theme="auto"] .gottesdienst-table tr:hover,
    .gottesdienst-table[data-theme="auto"] tr:hover {
        background: #4a5568 !important;
    }
    
    .gottesdienst-container[data-theme="auto"] .gottesdienst-table tr:hover td,
    .gottesdienst-table[data-theme="auto"] tr:hover td {
        background: #4a5568 !important;
    }
    
    /* Mobile Dark Mode für Auto */
    @media screen and (max-width: 600px) {
        .gottesdienst-container[data-theme="auto"] .gottesdienst-table tr,
        .gottesdienst-table[data-theme="auto"] tr {
            border: 1px solid #4a5568 !important;
            background: #333 !important;
        }
        
        .gottesdienst-container[data-theme="auto"] .gottesdienst-table td,
        .gottesdienst-table[data-theme="auto"] td {
            background: #333 !important;
            color: #e2e8f0 !important;
        }
    }
}

/* Smooth Transitions */
.gottesdienst-table,
.gottesdienst-table th,
.gottesdienst-table td,
.gottesdienst-table tr {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}