/* Grundlegende Styling-Regeln */
body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.header {
    background: linear-gradient(135deg, #3494E6, #EC6EAD);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 0 0 15px 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 24px;
}

/* Tab Navigation */
.tabs {
    display: flex;
    margin: 0 15px 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.tab.active {
    background-color: #3494E6;
    color: white;
}

.tab-content {
    display: none;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

/* Stream hinzufügen Bereich */
.add-stream {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 15px 20px;
}

.add-stream h2 {
    margin-top: 0;
    color: #3494E6;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"], input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border 0.3s;
}

input[type="text"]:focus, input[type="url"]:focus {
    border-color: #3494E6;
    outline: none;
}

/* StreamURL Link */
.streamurl-link {
    margin-top: 8px;
    font-size: 14px;
}

.streamurl-link a {
    color: #3494E6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.streamurl-link a i {
    margin-left: 5px;
    font-size: 12px;
}

.streamurl-link a:hover {
    text-decoration: underline;
}

/* Icon Options */
.icon-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.icon-option {
    flex: 1;
    text-align: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-option:hover {
    border-color: #3494E6;
    background-color: #f9f9f9;
}

.icon-option.selected {
    border-color: #3494E6;
    background-color: #e8f4ff;
}

.icon-option i {
    font-size: 24px;
    color: #3494E6;
    margin-bottom: 10px;
    display: block;
}

/* Bild-Upload und Vorschau */
.image-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload:hover {
    border-color: #3494E6;
    background-color: #f9f9f9;
}

.image-upload i {
    font-size: 30px;
    color: #aaa;
    margin-bottom: 10px;
}

.image-preview {
    display: none; 
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #eee;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #3494E6, #EC6EAD);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

/* Stream-Karten */
.stream-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.stream-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stream-icon {
    width: 100%;
    height: 150px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.stream-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stream-info {
    padding: 15px;
    text-align: center;
}

.stream-info h3 {
    margin: 0;
    font-size: 16px;
    color: #3494E6;
}

.stream-controls {
    display: flex;
    padding: 0 15px 15px;
}

.stream-button {
    flex: 1;
    padding: 8px;
    font-size: 14px;
}

.play-button {
    flex: 3;
    background: linear-gradient(to right, #4facfe, #00f2fe);
}

.delete-button {
    flex: 1;
    background: linear-gradient(to right, #f78ca0, #f9748f);
}

.audio-hidden {
    width: 0;
    height: 0;
    visibility: hidden;
    position: absolute;
}

/* Now Playing Overlay */
.now-playing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
    border-radius: 10px;
}

.stream-card.playing .now-playing-overlay {
    opacity: 1;
    pointer-events: auto;
}

.broadcast-icon {
    width: 80px;
    height: 80px;
    stroke: white;
    stroke-width: 2;
    animation: pulse 2s infinite;
}

.stop-circle {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    cursor: pointer;
}

.stop-circle i {
    color: #f44336;
    font-size: 20px;
}

.stream-card.playing .play-button {
    background: linear-gradient(to right, #f44336, #d32f2f);
}

.stream-card.playing .play-button i:before {
    content: "\f04d";
}

/* Leerer Stream-Liste Nachricht */
.empty-message {
    text-align: center;
    padding: 40px;
    grid-column: 1/-1;
    color: #999;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Config Tab */
.config-section {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 15px 20px;
}

.config-section h2 {
    margin-top: 0;
    color: #3494E6;
}

.config-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.config-item:last-child {
    border-bottom: none;
}

.config-label {
    font-weight: bold;
    color: #555;
}

.config-value {
    color: #3494E6;
    font-weight: bold;
}

/* Backup-Button */
.backup-button {
    margin-top: 15px;
    background: linear-gradient(to right, #43cea2, #185a9d);
}

/* Gefahrenbereich für Löschfunktionen */
.danger-zone {
    margin-top: 20px;
    border-top: 1px dashed #ff6b6b;
    padding-top: 20px;
}

.danger-zone h3 {
    color: #ff6b6b;
    margin-top: 0;
}

.delete-button-danger {
    background: linear-gradient(to right, #ff6b6b, #ee5253);
    margin-top: 15px;
}

/* Overlay und Dialoge */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.setup-dialog {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.setup-dialog h2 {
    color: #3494E6;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.setup-dialog p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirmation-dialog {
    background-color: white;
    border-radius: 15px;
    border: 2px solid #ff6b6b;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.confirmation-dialog h2 {
    color: #ff6b6b;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.confirmation-code {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 5px;
    margin: 20px 0;
    color: #ff6b6b;
    font-family: monospace;
    background-color: #fff8f8;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ffdddd;
}

/* Ladeanimationen */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 20px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3494E6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.icon-generating {
    text-align: center;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Fehlermeldungen */
.error-message {
    color: #ff6b6b;
    background-color: #fff0f0;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    border-left: 4px solid #ff6b6b;
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    margin: 30px 0 20px;
    color: #999;
    font-size: 14px;
}

/* Show PW */

.password-container {
    display: flex;
    align-items: center;
}

.masked-password {
    font-family: monospace;
    letter-spacing: 1px;
}

/* Info-Button Styling */
.info-button {
    flex: 1;
    background: linear-gradient(to right, #3498db, #2980b9);
    margin-right: 5px;
}

.info-button i {
    color: white;
}

/* Verbesserter Stil für Stream-Controls mit drei Buttons */
.stream-controls {
    display: flex;
    padding: 0 15px 15px;
    gap: 5px; /* Abstand zwischen den Buttons */
}

/* Anpassungen für Play-Button, wenn drei Buttons vorhanden sind */
.play-button {
    flex: 2; /* mehr Platz für den Play-Button */
}

/* Stream-Info im Modal */
#streamInfoContent {
    margin: 15px 0;
}

#streamInfoContent div {
    margin-bottom: 15px;
}

/* Für bessere Lesbarkeit der Stream-URL */
.stream-url-field {
    font-family: monospace;
    word-break: break-all;
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}