/* Modern, clean design for Paywall Bypass PWA */

:root {
  /* Light mode colors (fallback) */
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --success-color: #0f9d58;
  --error-color: #d93025;
  --warning-color: #f9ab00;
  --bg-color: #f8f9fa;
  --surface-color: #ffffff;
  --border-color: #dadce0;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.08);
}

/* Dark mode (default) */
body {
  --primary-color: #4c9aff;
  --primary-hover: #2684ff;
  --success-color: #36b37e;
  --error-color: #ff5630;
  --warning-color: #ffab00;
  --bg-color: #1a1a1a;
  --surface-color: #242424;
  --border-color: #3a3a3a;
  --text-primary: #e4e4e4;
  --text-secondary: #a8a8a8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.2);
}

/* Update Notification Banner */
.update-notification {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.update-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a73e8 0%, #4c9aff 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.update-notification-icon {
  font-size: 1.2em;
}

.update-notification-text {
  font-weight: 500;
  font-size: 0.95em;
}

.update-notification-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.update-notification-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.update-notification-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.4em;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.update-notification-dismiss:hover {
  color: white;
}

/* Light mode (opt-in) */
body.light-mode {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --success-color: #0f9d58;
  --error-color: #d93025;
  --warning-color: #f9ab00;
  --bg-color: #f8f9fa;
  --surface-color: #ffffff;
  --border-color: #dadce0;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px 30px;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary-color), #00bcd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Main Content */
.main {
  flex: 1;
  width: 100%;
}

/* Input Section */
.input-section {
  background: var(--surface-color);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.input-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.url-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.url-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.url-input::placeholder {
  color: #aaa;
}

.fetch-btn {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 140px;
}

.fetch-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.fetch-btn:active {
  transform: translateY(0);
}

.fetch-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  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); }
}

/* Bypass Modes */
.bypass-modes {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(76, 154, 255, 0.1);
  border-radius: 8px;
  border: 2px solid rgba(76, 154, 255, 0.3);
}

body.light-mode .bypass-modes {
  background: #f0f7ff;
  border-color: #c5e1ff;
}

.mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 600;
}

.rotation-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.rotation-toggle input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.rotation-toggle label {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.rotation-toggle input[type="checkbox"]:checked + label {
  color: var(--primary-color);
  font-weight: 600;
}

.mode-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-btn {
  flex: 1;
  min-width: 110px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-color);
  color: var(--text-primary);
  border: 2px solid rgba(76, 154, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.light-mode .mode-btn {
  background: white;
  border-color: #c5e1ff;
}

.mode-btn:hover {
  border-color: var(--primary-color);
  background: rgba(76, 154, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.light-mode .mode-btn:hover {
  background: #e3f2ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.mode-btn.active:hover {
  background: var(--primary-hover);
}

.mode-btn:active {
  transform: translateY(0);
}

/* Browser Engine Selection */
.browser-selection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(76, 154, 255, 0.3);
}

body.light-mode .browser-selection {
  border-top-color: #c5e1ff;
}

.browser-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  font-weight: 600;
  display: block;
}

.browser-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.browser-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-color);
  color: var(--text-primary);
  border: 2px solid rgba(76, 154, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.light-mode .browser-btn {
  background: white;
  border-color: #e3f2ff;
}

.browser-btn:hover {
  border-color: var(--primary-color);
  background: rgba(76, 154, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

body.light-mode .browser-btn:hover {
  background: #f0f7ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.browser-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.browser-btn.active:hover {
  background: var(--primary-hover);
}

.browser-btn:active {
  transform: translateY(0);
}

.browser-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
}

/* Archive Options */
.archive-options {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

body.light-mode .archive-options {
  background: #f8f9fa;
}

.archive-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  font-weight: 500;
}

.archive-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-color);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.light-mode .archive-btn {
  background: white;
}

.archive-btn:hover {
  border-color: var(--primary-color);
  background: rgba(76, 154, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.light-mode .archive-btn:hover {
  background: #f0f7ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.archive-btn:active {
  transform: translateY(0);
}

/* Info Box */
.info-box {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 16px;
  background: rgba(76, 154, 255, 0.08);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

body.light-mode .info-box {
  background: #e8f0fe;
}

.info-icon {
  flex-shrink: 0;
  color: var(--primary-color);
  margin-top: 2px;
}

.info-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Status Message */
.status-message {
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-content {
  padding: 16px 20px;
  border-radius: 12px;
  font-weight: 500;
}

.status-message.success .status-content {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.status-message.error .status-content {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid var(--error-color);
}

.status-message.info .status-content {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.status-message.warning .status-content {
  background: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

/* Article Display */
.article-display {
  background: var(--surface-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.article-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.article-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #e8e8e8;
  border-color: #999;
}

.dark-mode-btn.active {
  background: #2d3748;
  color: #e2e8f0;
  border-color: #4a5568;
}

.dark-mode-btn.active:hover {
  background: #3d4758;
  border-color: #5a6578;
}

.article-meta {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #2d3748;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.article-meta strong {
  color: #fff;
}

.article-meta a {
  color: #63b3ed;
}

.article-meta a:hover {
  color: #90cdf4;
}

.article-frame {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: auto;
}

.footer p {
  margin: 8px 0;
}

.footer-tech {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  .fetch-btn {
    width: 100%;
  }

  .article-header {
    flex-direction: column;
    align-items: start;
    gap: 15px;
  }

  .article-actions {
    width: 100%;
    justify-content: space-between;
  }

  .article-frame {
    height: 500px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #202124;
    --surface-color: #292a2d;
    --border-color: #3c4043;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
  }

  .url-input {
    background: var(--surface-color);
    color: var(--text-primary);
  }

  .info-box {
    background: rgba(26, 115, 232, 0.1);
  }

  .action-btn {
    background: var(--surface-color);
  }

  .action-btn:hover {
    background: #3c4043;
  }
}

/* ============================================
   SETTINGS PANEL
   ============================================ */

.settings-panel {
  margin-top: 20px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-color);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-toggle:hover {
  background: rgba(76, 154, 255, 0.1);
  border-color: var(--primary-color);
  color: var(--text-primary);
}

.settings-content {
  margin-top: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.setting-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.setting-row select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-color);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.setting-row select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.update-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.update-status {
  font-size: 14px;
  font-weight: 500;
}

.update-status.checking {
  color: var(--primary-color);
}

.update-status.success {
  color: var(--success-color);
}

.update-status.error {
  color: var(--error-color);
}

.update-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(76, 154, 255, 0.05);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   TEXT SIZE CONTROLS
   ============================================ */

.text-size-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.text-size-btn {
  padding: 6px 10px !important;
  min-width: auto !important;
  font-size: 13px !important;
  font-weight: 600;
}

.text-size-indicator {
  padding: 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 45px;
  text-align: center;
}

/* Responsive adjustments for new components */
@media (max-width: 768px) {
  .text-size-controls {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    margin-top: 10px;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    justify-content: center;
  }

  .update-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-content {
    padding: 15px;
  }
}
