/* Subscription System Styles */
.subscription-system {
  background: var(--bg-light, #f8f9fa);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 2rem auto;
}

.subscription-header {
  text-align: center;
  margin-bottom: 2rem;
}

.subscription-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color, #333);
  margin: 0 0 0.75rem 0;
}

.subscription-description {
  color: var(--text-muted, #666);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.subscription-forms {
  display: grid;
  gap: 2rem;
}

.subscription-form {
  padding: 1.5rem;
  background: var(--bg-lighter, #ffffff);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 8px;
}

.form-header {
  margin-bottom: 1.5rem;
}

.form-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color, #333);
  margin: 0 0 0.5rem 0;
}

.form-header p {
  color: var(--text-muted, #666);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--bg-lighter, #ffffff);
  color: var(--text-color, #333);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-color, #4158D0);
  box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
}

.form-input.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-preferences {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-color, #333);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-color, #4158D0);
}

.rss-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--brand-color, #4158D0);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.rss-link:hover {
  background: #3652c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(65, 88, 208, 0.2);
}

.rss-icon {
  font-size: 1.25rem;
}

.rss-readers {
  margin-top: 1.5rem;
}

.rss-readers-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color, #333);
  margin: 0 0 1rem 0;
}

.rss-reader-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.reader-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-light, #f8f9fa);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 6px;
  color: var(--text-color, #333);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-btn:hover {
  background: var(--bg-lighter, #ffffff);
  border-color: var(--brand-color, #4158D0);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(65, 88, 208, 0.1);
}

.reader-icon {
  font-size: 1rem;
}

/* Status Messages */
.subscription-status {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  padding: 1.25rem;
  border-radius: 8px;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

.subscription-status.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.subscription-status.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.subscription-status.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.status-message {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.close-status {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-status:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Floating Subscription Widget */
.floating-subscription {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.subscription-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--brand-color, #4158D0);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(65, 88, 208, 0.2);
  transition: all 0.2s ease;
}

.subscription-toggle:hover {
  background: #3652c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(65, 88, 208, 0.3);
}

.subscription-popup {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--bg-lighter, #ffffff);
  border: 1px solid var(--border-color, #e1e5e9);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  display: none;
}

.subscription-popup .subscription-system {
  margin: 0;
  max-width: none;
  border: none;
  border-radius: 8px;
  box-shadow: none;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px; /* Touch target size */
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--brand-color, #4158D0);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #3652c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(65, 88, 208, 0.2);
}

.btn-secondary {
  background: var(--bg-light, #f8f9fa);
  color: var(--text-color, #333);
  border: 1px solid var(--border-color, #e1e5e9);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-lighter, #ffffff);
  border-color: var(--brand-color, #4158D0);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(65, 88, 208, 0.1);
}

.btn-secondary.success {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

/* Copy Button Success State */
.copy-rss.success {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .subscription-system {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .subscription-forms {
    gap: 1.5rem;
  }
  
  .form-preferences {
    gap: 0.5rem;
  }
  
  .rss-reader-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .floating-subscription {
    bottom: 10px;
    left: 10px;
  }
  
  .subscription-popup {
    width: 350px;
  }
  
  .subscription-status {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .subscription-header h3 {
    font-size: 1.25rem;
  }
  
  .form-header h4 {
    font-size: 1rem;
  }
  
  .rss-reader-buttons {
    grid-template-columns: 1fr;
  }
  
  .subscription-popup {
    width: 320px;
  }
  
  .floating-subscription {
    bottom: 5px;
    left: 5px;
  }
  
  .subscription-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* Dark theme */
[data-theme="dark"] .subscription-system {
  background: #2a2a2a;
  border-color: #444;
}

[data-theme="dark"] .subscription-form {
  background: #1a1a1a;
  border-color: #444;
}

[data-theme="dark"] .form-header h4 {
  color: #e0e0e0;
}

[data-theme="dark"] .form-input {
  background: #0a0a0a;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] .form-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .checkbox-label {
  color: #e0e0e0;
}

[data-theme="dark"] .rss-link {
  background: #667eea;
}

[data-theme="dark"] .rss-link:hover {
  background: #5a67d8;
}

[data-theme="dark"] .reader-btn {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] .reader-btn:hover {
  background: #333;
  border-color: #667eea;
}

[data-theme="dark"] .btn-secondary {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #333;
  border-color: #667eea;
}

[data-theme="dark"] .subscription-popup {
  background: #1a1a1a;
  border-color: #444;
}

/* Print styles */
@media print {
  .subscription-system,
  .floating-subscription,
  .subscription-status {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .subscription-toggle,
  .btn,
  .reader-btn,
  .rss-link {
    transition: none;
  }
  
  .subscription-toggle:hover,
  .btn:hover,
  .reader-btn:hover,
  .rss-link:hover {
    transform: none;
  }
  
  .loading::after {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .subscription-system,
  .subscription-form {
    border-width: 2px;
  }
  
  .form-input,
  .btn,
  .reader-btn {
    border-width: 2px;
  }
}

/* Focus states */
.btn:focus,
.reader-btn:focus,
.subscription-toggle:focus,
.form-input:focus {
  outline: 2px solid var(--focus-color, #4158D0);
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible),
.reader-btn:focus:not(:focus-visible),
.subscription-toggle:focus:not(:focus-visible),
.form-input:focus:not(:focus-visible) {
  outline: none;
}

.btn:focus-visible,
.reader-btn:focus-visible,
.subscription-toggle:focus-visible,
.form-input:focus-visible {
  outline: 2px solid var(--focus-color, #4158D0);
  outline-offset: 2px;
}