/**
 * BesserNews PWA & Push Styles
 */

/* Modal Backdrop & Container */
.bn-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.bn-modal.active {
  opacity: 1;
  visibility: visible;
}

.bn-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Modal Content */
.bn-modal-content {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.bn-modal.active .bn-modal-content {
  transform: translateY(0) scale(1);
}

.bn-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f7;
  border-radius: 50%;
  font-size: 24px;
  color: #86868b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bn-modal-close:hover {
  background: #e5e5e7;
  color: #1d1d1f;
}

/* Modal Header */
.bn-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.bn-modal-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.bn-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 8px 0;
}

.bn-modal-header p {
  font-size: 15px;
  color: #86868b;
  margin: 0;
  line-height: 1.5;
}

/* Channels List */
.bn-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.bn-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f5f5f7;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.bn-channel:hover {
  background: #e5e5e7;
}

.bn-channel.active {
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: white;
}

.bn-channel input {
  display: none;
}

.bn-channel-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.bn-channel-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.bn-channel-check {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.bn-channel.active .bn-channel-check {
  opacity: 1;
  transform: scale(1);
}

/* Buttons */
.bn-modal-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.bn-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bn-btn-primary {
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: white;
}

.bn-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.bn-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.bn-btn-secondary {
  background: #f5f5f7;
  color: #1d1d1f;
}

.bn-btn-secondary:hover {
  background: #e5e5e7;
}

.bn-btn-outline {
  background: transparent;
  border: 2px solid #007AFF;
  color: #007AFF;
}

.bn-btn-outline:hover {
  background: #007AFF;
  color: white;
}

/* Spinner */
.bn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Install Hint */
.bn-install-hint {
  background: linear-gradient(135deg, #f5f5f7 0%, #e5e5e7 100%);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.bn-install-hint p {
  font-size: 14px;
  color: #1d1d1f;
  margin: 0 0 12px 0;
}

.bn-install-hint .bn-btn {
  width: auto;
  flex: none;
}

/* Modal Footer */
.bn-modal-footer {
  text-align: center;
}

.bn-modal-footer p {
  font-size: 12px;
  color: #86868b;
  margin: 0;
}

/* Floating Action Button */
.bn-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
  transition: all 0.3s ease;
  z-index: 9999;
  display: none !important; /* PWA Button ausgeblendet */
  align-items: center;
  justify-content: center;
}

.bn-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 122, 255, 0.5);
}

.bn-fab.subscribed {
  background: linear-gradient(135deg, #34C759 0%, #2DA44E 100%);
  box-shadow: 0 4px 20px rgba(52, 199, 89, 0.4);
}

/* Toast Notification */
.bn-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1d1d1f;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10001;
  max-width: 90%;
  text-align: center;
}

.bn-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bn-toast-success {
  background: linear-gradient(135deg, #34C759 0%, #2DA44E 100%);
}

.bn-toast-error {
  background: linear-gradient(135deg, #FF3B30 0%, #D70015 100%);
}

.bn-toast-warning {
  background: linear-gradient(135deg, #FF9500 0%, #C77800 100%);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .bn-modal-content {
    background: #1c1c1e;
    color: #f5f5f7;
  }
  
  .bn-modal-close {
    background: #2c2c2e;
    color: #8e8e93;
  }
  
  .bn-modal-close:hover {
    background: #3a3a3c;
    color: #f5f5f7;
  }
  
  .bn-modal-header h2 {
    color: #f5f5f7;
  }
  
  .bn-channel {
    background: #2c2c2e;
  }
  
  .bn-channel:hover {
    background: #3a3a3c;
  }
  
  .bn-btn-secondary {
    background: #2c2c2e;
    color: #f5f5f7;
  }
  
  .bn-btn-secondary:hover {
    background: #3a3a3c;
  }
  
  .bn-install-hint {
    background: linear-gradient(135deg, #2c2c2e 0%, #3a3a3c 100%);
  }
  
  .bn-install-hint p {
    color: #f5f5f7;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .bn-modal-content {
    padding: 24px;
    margin: 16px;
    max-height: calc(100vh - 32px);
  }
  
  .bn-modal-icon {
    font-size: 48px;
  }
  
  .bn-modal-header h2 {
    font-size: 20px;
  }
  
  .bn-modal-actions {
    flex-direction: column;
  }
  
  .bn-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}
