/**
 * Magfinder - Production Styles
 * Matching magfinder.com/category/all exactly
 */

/* Light theme (default) */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #ebebed;
  --bg-sidebar: rgba(245, 245, 247, 0.94);
  --text-primary: #1d1d1d;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --border-color: #e5e5e5;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --accent-color: #D84315;
  --hover-bg: rgba(0, 0, 0, 0.05);
  --input-bg: rgba(0, 0, 0, 0.06);
  --tag-bg: rgba(0, 0, 0, 0.06);
  --tag-text: rgba(0, 0, 0, 0.7);
  --table-header-bg: #f5f5f7;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark theme */
:root[data-theme="dark"] {
  --bg-primary: #1c1c1e;
  --bg-secondary: #000000;
  --bg-tertiary: #2c2c2e;
  --bg-sidebar: rgba(32, 32, 35, 0.94);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.45);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --accent-color: #D84315;
  --hover-bg: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(255, 255, 255, 0.1);
  --tag-bg: rgba(255, 255, 255, 0.1);
  --tag-text: rgba(255, 255, 255, 0.7);
  --table-header-bg: #2c2c2e;
  --shadow-color: rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Page Layout */
.category-page {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.page-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.brand-logo {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 16px;
  padding: 8px 12px;
  background: var(--input-bg);
  border-radius: 8px;
  color: var(--text-tertiary);
}

.sidebar-search svg {
  flex-shrink: 0;
}

.sidebar-search input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.sidebar-search input::placeholder {
  color: var(--text-tertiary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-header {
  padding: 8px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.nav-item {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  margin: 0 8px;
  transition: background 0.15s ease;
}

.nav-item:hover {
  background: var(--hover-bg);
}

.nav-item.active {
  background: var(--hover-bg);
  color: var(--text-primary);
  font-weight: 500;
}

/* Newsletter Widget */
.newsletter-widget {
  margin: 16px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.newsletter-covers {
  display: flex;
  gap: 2px;
  padding: 8px;
  background: var(--bg-secondary);
  justify-content: center;
}

.newsletter-cover {
  width: 32px;
  height: 43px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cover-1 { transform: rotate(-3deg); }
.cover-2 { transform: rotate(0deg); }
.cover-3 { transform: rotate(3deg); }
.cover-4 { transform: rotate(-2deg); }
.cover-5 { transform: rotate(2deg); }

.newsletter-content {
  padding: 10px 12px 12px;
}

.newsletter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.newsletter-text {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.newsletter-button {
  display: block;
  width: 100%;
  padding: 8px;
  background: #FF460D;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.newsletter-button:hover {
  opacity: 0.9;
}

/* Main content */
.main-content {
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-nav-header {
  padding: 16px 24px 0;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Page Navigation */
.page-nav {
  display: flex;
  gap: 4px;
}

.nav-row .page-nav {
  margin-bottom: 0;
}

.nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.nav-btn:hover:not(:disabled) {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.nav-btn svg {
  flex-shrink: 0;
}

/* Header Avatar */
.header-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.avatar-btn:hover {
  background: var(--hover-bg);
}

.avatar-btn.signed-in {
  background: #FF460D;
  color: white;
}

.avatar-btn.signed-in:hover {
  background: #e63e0c;
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.page-header {
  padding: 0 0 16px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.table-container {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* Magazine Table */
.magazine-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.magazine-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--table-header-bg);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.magazine-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.magazine-table tbody tr:hover td {
  background: var(--hover-bg);
}

.magazine-table tbody tr.preview-active td {
  background: var(--accent-color-subtle, rgba(255, 70, 13, 0.1));
}

.col-cover {
  width: 56px;
  padding: 8px 12px !important;
}

.col-name {
  min-width: 140px;
  max-width: 200px;
}

.col-category {
  width: 130px;
}

.col-link {
  width: 50px;
  text-align: center;
}

.col-released {
  width: 90px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.col-desc {
  color: var(--text-secondary);
  min-width: 280px;
  max-width: 450px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-img {
  width: 40px;
  height: 53px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.magazine-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  display: block;
}

.magazine-link:hover {
  text-decoration: underline;
}

.issue-label {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.category-tag {
  color: var(--tag-text);
  text-decoration: none;
  font-size: 12px;
  background: var(--tag-bg);
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.category-tag:hover {
  background: var(--hover-bg);
}

.external-link {
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.external-link:hover {
  color: var(--text-secondary);
}

/* Loading / Scroll Sentinel */
.scroll-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.scroll-sentinel.loading .loading-text {
  opacity: 0.6;
}

.end-of-list {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: var(--text-tertiary);
  font-size: 13px;
  border-top: 1px solid var(--border-subtle);
}

/* Magazine Profile Page */
.magazine-page {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.magazine-profile {
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.magazine-profile .page-nav-header {
  padding: 16px 24px 0;
}

.magazine-profile .magazine-header,
.magazine-profile .magazine-issues,
.magazine-profile .empty-state {
  padding: 0 24px 24px;
}

.magazine-header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.magazine-cover {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.magazine-info {
  flex: 1;
  min-width: 0;
}

.magazine-info h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.magazine-category {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.magazine-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 600px;
}

.magazine-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.magazine-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #FF460D;
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--hover-bg);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Issues Grid (for magazine profile) */
.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.issue-card {
  display: flex;
  flex-direction: column;
}

.issue-cover-link {
  display: block;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.issue-cover-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.issue-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.issue-info {
  padding: 8px 0;
}

.issue-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Account Pages */
.account-page {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.account-content {
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0;
}

.account-content .page-nav-header {
  padding: 16px 24px 0;
}

.account-content h1 {
  padding: 0 24px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.account-content .loading-indicator,
.account-content .empty-state,
.account-content .settings-container,
.account-content .saved-grid {
  padding: 0 24px 24px;
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-tertiary);
}

.empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* Loading indicator */
.loading-indicator {
  display: none;
  justify-content: center;
  padding: 48px 0;
}

.loading-indicator.visible {
  display: flex;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Auth Modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px var(--shadow-color);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
}

.auth-modal h2 {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.auth-form button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: #FF460D;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.auth-divider {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  margin: 16px 0;
}

.btn-google {
  width: 100%;
  padding: 12px;
  background: white;
  color: #333;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.auth-links {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
}

.auth-links a {
  color: var(--accent-color);
}

.auth-links-divider {
  margin: 0 8px;
  color: var(--color-text-secondary, #666);
}

.auth-error {
  color: #ef4444;
  font-size: 14px;
  text-align: center;
}

/* Issue Page */
.issue-page {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.issue-profile {
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.issue-profile .page-nav-header {
  padding: 16px 24px 0;
}

.issue-profile .issue-breadcrumb,
.issue-profile .issue-header,
.issue-profile .related-issues {
  padding-left: 24px;
  padding-right: 24px;
}

.issue-profile .related-issues {
  padding-bottom: 24px;
}

.issue-profile .issue-header {
  margin-bottom: 40px;
}

/* Issue Breadcrumb */
.issue-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.issue-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.issue-breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb-sep {
  color: var(--text-tertiary);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* Issue Header */
.issue-header {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}

.issue-cover-large {
  width: 280px;
  height: 373px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px var(--shadow-color);
}

.issue-info {
  flex: 1;
  min-width: 0;
}

.issue-info h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.issue-magazine-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: background 0.15s ease;
}

.issue-magazine-link:hover {
  background: var(--hover-bg);
}

.magazine-thumbnail {
  width: 32px;
  height: 43px;
  object-fit: cover;
  border-radius: 4px;
}

.issue-magazine-link span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.issue-category {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

.issue-description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 600px;
}

.issue-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.issue-actions {
  display: flex;
  gap: 12px;
}

/* Related Issues Section */
.related-issues {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.issue-title-link {
  text-decoration: none;
  color: inherit;
}

.issue-title-link:hover .issue-title {
  color: var(--accent-color);
}

/* Responsive */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 200px 1fr;
  }
}

@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    flex-direction: row;
  }

  .sidebar-search {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 0 8px;
    overflow-y: visible;
  }

  .nav-section {
    display: flex;
    flex-direction: row;
    margin-bottom: 0;
  }

  .nav-section-header {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
    padding: 8px 16px;
    margin: 0 2px;
  }

  .sidebar-brand {
    padding: 0 8px 0 12px;
    margin: 0;
    border-bottom: none;
    flex-shrink: 0;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .brand-name {
    display: none;
  }

  .newsletter-widget {
    display: none;
  }

  .col-desc {
    display: none;
  }

  .magazine-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .magazine-cover {
    width: 140px;
    height: 187px;
  }

  /* Issue page responsive */
  .issue-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
  }

  .issue-cover-large {
    width: 200px;
    height: 267px;
  }

  .issue-info h1 {
    font-size: 24px;
  }

  .issue-magazine-link {
    justify-content: center;
  }

  .issue-description {
    text-align: left;
  }

  .issue-meta {
    justify-content: center;
  }

  .issue-actions {
    justify-content: center;
  }

  .issue-breadcrumb {
    justify-content: center;
  }
}

/* Issue Preview Modal */
.issue-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.issue-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.issue-preview-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.issue-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.issue-preview-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.issue-preview-main {
  display: flex;
  gap: 32px;
  padding: 32px;
  overflow-y: auto;
}

.issue-preview-cover {
  width: 280px;
  height: 373px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px var(--shadow-color);
}

.issue-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.issue-preview-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.issue-preview-magazine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
}

.issue-preview-magazine:hover {
  text-decoration: underline;
}

.issue-preview-category {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
  width: fit-content;
}

.issue-preview-description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
}

.issue-preview-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.issue-preview-actions {
  display: flex;
  gap: 12px;
}

.issue-preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.nav-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex: 1;
}

.issue-preview-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.issue-preview-arrow:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.issue-preview-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.nav-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Issue Preview Modal Responsive */
@media (max-width: 768px) {
  .issue-preview-modal {
    padding: 16px;
  }

  .issue-preview-main {
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 24px;
  }

  .issue-preview-cover {
    width: 180px;
    height: 240px;
  }

  .issue-preview-info {
    text-align: center;
    align-items: center;
  }

  .issue-preview-title {
    font-size: 22px;
  }

  .issue-preview-description {
    text-align: left;
  }

  .issue-preview-actions {
    flex-direction: column;
    width: 100%;
  }

  .issue-preview-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .issue-preview-nav {
    gap: 8px;
    padding: 12px 16px;
  }

  .nav-hints {
    display: none;
  }

  .issue-preview-arrow {
    width: 44px;
    height: 44px;
  }
}

/* Settings Page */
.settings-container {
  max-width: 600px;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-info {
  flex: 1;
  min-width: 0;
}

.settings-row-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-row-value {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-row-description {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 16px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #FF460D;
  border-color: #FF460D;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(255, 70, 13, 0.2);
}

/* Account Menu Dropdown */
.account-menu {
  position: fixed;
  right: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 24px var(--shadow-color), 0 0 0 1px var(--border-subtle);
  min-width: 220px;
  z-index: 200;
  overflow: hidden;
}

.account-menu-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.account-menu-email {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--hover-bg);
}

.account-menu-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.account-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.account-menu-logout {
  color: #ef4444;
}

.account-menu-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

.account-menu-logout svg {
  color: #ef4444;
}

/* Newsletter Page */
.newsletter-page {
  height: 100vh;
  overflow: hidden;
}

.newsletter-content-area {
  min-width: 0;
  min-height: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0;
}

.newsletter-content-area .page-nav-header {
  padding: 16px 24px 0;
}

.newsletter-hero {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.newsletter-hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.newsletter-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.newsletter-hero-covers {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.hero-cover {
  width: 80px;
  height: 110px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.hero-cover.cover-1 { transform: rotate(-8deg) translateY(8px); }
.hero-cover.cover-2 { transform: rotate(-4deg) translateY(4px); }
.hero-cover.cover-3 { transform: rotate(0deg); z-index: 2; }
.hero-cover.cover-4 { transform: rotate(4deg) translateY(4px); }
.hero-cover.cover-5 { transform: rotate(8deg) translateY(8px); }

.newsletter-form {
  margin-bottom: 24px;
}

.newsletter-form .form-row {
  display: flex;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent-color);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--text-tertiary);
}

.newsletter-form .btn {
  padding: 12px 24px;
  font-size: 16px;
  white-space: nowrap;
}

.form-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

.newsletter-success {
  padding: 24px;
}

.newsletter-success svg {
  color: #22c55e;
  margin-bottom: 16px;
}

.newsletter-success h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.newsletter-success p {
  color: var(--text-secondary);
}

.newsletter-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-error p {
  color: #ef4444;
  font-size: 14px;
  margin: 0;
}

.newsletter-features {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 48px 24px;
  border-top: 1px solid var(--border-subtle);
  max-width: 800px;
  margin: 0 auto;
}

.feature {
  text-align: center;
  max-width: 200px;
}

.feature svg {
  color: var(--accent-color);
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 768px) {
  .newsletter-hero {
    padding: 32px 16px;
  }

  .newsletter-hero h1 {
    font-size: 24px;
  }

  .hero-cover {
    width: 56px;
    height: 77px;
  }

  .newsletter-form .form-row {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  .newsletter-features {
    flex-direction: column;
    gap: 32px;
    align-items: center;
  }
}

/* Share Buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.share-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
}

.share-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.share-twitter:hover {
  background: rgba(29, 155, 240, 0.1);
  color: #1da1f2;
}

.share-facebook:hover {
  background: rgba(24, 119, 242, 0.1);
  color: #1877f2;
}

.share-pinterest:hover {
  background: rgba(230, 0, 35, 0.1);
  color: #e60023;
}

.share-copy.copied {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

@media (max-width: 768px) {
  .share-buttons {
    flex-wrap: wrap;
  }
}
