/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Light theme (default) - matching sftya.com */
:root {
  --primary: #4a5568;
  --primary-dark: #2d3748;
  --primary-light: rgba(74, 85, 104, 0.1);
  --secondary: #4a5568;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8f9fa;
  --bg-secondary: #f0f0f0;
  --surface: #ffffff;
  --surface-hover: #f0f0f0;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #4a5568;
  --text-muted: #a0a0a0;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;
}

/* Dark theme - matching sftya.com */
[data-theme="dark"],
.dark {
  --primary: #9ca3af;
  --primary-dark: #6b7280;
  --primary-light: rgba(156, 163, 175, 0.15);
  --secondary: #9ca3af;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --bg: #121212;
  --bg-secondary: #1e1e1e;
  --surface: #1e1e1e;
  --surface-hover: #2a2a2a;
  --border: #333333;
  --border-light: #1e1e1e;
  --text: #e4e4e4;
  --text-secondary: #9ca3af;
  --text-muted: #888888;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #9ca3af;
    --primary-dark: #6b7280;
    --primary-light: rgba(156, 163, 175, 0.15);
    --secondary: #9ca3af;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --bg: #121212;
    --bg-secondary: #1e1e1e;
    --surface: #1e1e1e;
    --surface-hover: #2a2a2a;
    --border: #333333;
    --border-light: #1e1e1e;
    --text: #e4e4e4;
    --text-secondary: #9ca3af;
    --text-muted: #888888;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--primary-light);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Login Page */
.login-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

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

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.login-btn:hover {
  transform: translateY(-2px);
}

.login-btn.google {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.login-btn.google:hover {
  border-color: #4285f4;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.login-btn.github {
  background: #24292e;
  color: white;
}

.login-btn.github:hover {
  background: #1b1f23;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-btn.facebook {
  background: #1877f2;
  color: white;
}

.login-btn.facebook:hover {
  background: #166fe5;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.login-btn svg,
.login-btn img {
  width: 20px;
  height: 20px;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--primary);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(var(--surface), 0.95);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.user-name {
  font-weight: 500;
  font-size: 0.875rem;
}

/* Main content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.orgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.org-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.org-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.org-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.org-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.org-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.org-card-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.org-card-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.org-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.org-card-url {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.org-card-url:hover {
  text-decoration: underline;
}

.org-card-stats {
  display: flex;
  gap: 1rem;
}

.org-card-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Editor Preview Layout */
.editor-preview-wrapper {
  min-height: calc(100vh - 60px);
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.editor-preview-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Profile Section */
.preview-profile {
  text-align: center;
  padding: 1.5rem 0;
}

.preview-avatar-wrapper {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  position: relative;
  cursor: pointer;
}

.preview-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  transition: all var(--transition);
}

.preview-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.preview-avatar-wrapper:hover .preview-avatar {
  border-color: var(--primary);
}

.preview-avatar-wrapper:hover .preview-avatar-placeholder {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.preview-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid var(--bg);
  opacity: 0;
  transition: opacity var(--transition);
}

.preview-avatar-wrapper:hover .preview-avatar-edit {
  opacity: 1;
}

.preview-name-input {
  width: 100%;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.preview-name-input:hover,
.preview-name-input:focus {
  background: var(--surface);
  outline: none;
}

.preview-name-input::placeholder {
  color: var(--text-muted);
}

.preview-tagline-input {
  width: 100%;
  font-size: 0.9375rem;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  resize: none;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.preview-tagline-input:hover,
.preview-tagline-input:focus {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.preview-tagline-input::placeholder {
  color: var(--text-muted);
}

/* Preview Sections */
.preview-section {
  width: 100%;
}

.preview-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.preview-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.preview-add-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.preview-add-btn:hover {
  background: var(--primary-light);
}

/* Preview Links Grid */
.preview-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.preview-link-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.preview-link-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.preview-link-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.preview-link-item .link-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-link-item .link-actions {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.preview-link-item:hover .link-actions {
  opacity: 1;
}

.preview-link-item .link-actions button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.preview-link-item .link-actions .edit-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.preview-link-item .link-actions .edit-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.preview-link-item .link-actions .delete-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.preview-link-item .link-actions .delete-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.preview-links-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.preview-links-empty:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Preview Flyers */
.preview-flyers {
  width: 100%;
}

.preview-flyer-carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-flyer-slides {
  display: flex;
  transition: transform 0.3s ease;
}

.preview-flyer-slide {
  min-width: 100%;
  aspect-ratio: 4/5;
  position: relative;
}

.preview-flyer-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-flyer-slide .flyer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.preview-flyer-slide:hover .flyer-overlay {
  opacity: 1;
}

.preview-flyer-slide .flyer-overlay button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.preview-flyer-slide .flyer-overlay .edit-btn {
  background: white;
  color: var(--text);
}

.preview-flyer-slide .flyer-overlay .delete-btn {
  background: var(--danger);
  color: white;
}

.preview-flyer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.preview-flyer-nav.prev {
  left: 8px;
}

.preview-flyer-nav.next {
  right: 8px;
}

.preview-flyer-nav svg {
  width: 16px;
  height: 16px;
  fill: #262626;
}

.preview-flyer-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.preview-flyer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition);
}

.preview-flyer-dot.active {
  background: white;
}

.preview-flyer-info {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.preview-flyers-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
  aspect-ratio: 4/5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.preview-flyers-empty:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preview-flyers-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

/* Legacy editor classes (keep for modals) */
.editor-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group small {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.slug-input {
  display: flex;
  align-items: stretch;
}

.slug-input input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.slug-input span {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Avatar upload */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.avatar-preview,
.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-preview {
  object-fit: cover;
  border: 3px solid var(--border);
}

.avatar-preview:hover {
  border-color: var(--primary);
}

.avatar-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.avatar-placeholder:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.avatar-upload-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Links list */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.link-item:hover {
  border-color: var(--primary);
}

.link-item-drag {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1rem;
}

.link-item-content {
  flex: 1;
  min-width: 0;
}

.link-item-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
}

.link-item-url {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item-actions {
  display: flex;
  gap: 0.5rem;
}

.link-item-actions button {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.link-item-actions button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.link-item-actions .delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.empty-text {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Flyers grid */
.flyers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.flyer-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.flyer-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.flyer-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.flyer-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.flyer-card:hover .flyer-card-overlay {
  opacity: 1;
}

.flyer-card-actions {
  display: flex;
  gap: 0.5rem;
}

.flyer-card-info {
  padding: 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface);
}

/* Flyer upload */
.flyer-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.flyer-upload:hover,
.flyer-upload.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.flyer-preview {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.flyer-placeholder {
  color: var(--text-muted);
}

.flyer-placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.flyer-placeholder p {
  font-size: 0.9375rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.modal form {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Publish status */
.publish-status {
  padding: 2.5rem;
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

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

/* Preview panel */
.preview-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-dot.red { background: #ef4444; }
.preview-dot.yellow { background: #f59e0b; }
.preview-dot.green { background: #22c55e; }

.preview-url {
  flex: 1;
  margin-left: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.preview-frame {
  width: 100%;
  height: 600px;
  border: none;
  background: white;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Tooltips */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

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

  .preview-panel {
    order: -1;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .main {
    padding: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .editor-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .editor-header-actions {
    justify-content: stretch;
  }

  .editor-header-actions .btn {
    flex: 1;
  }

  .orgs-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .login-container {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }

  .user-info {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal {
  animation: slideIn 0.2s ease-out;
}
