/* Quick Posts - Capture PWA */
/* Minimal, clean, Godly-inspired */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-hover: #1a1a1a;
  --text: #fafafa;
  --text-secondary: #737373;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --success: #22c55e;
  --border: #262626;
  --radius: 12px;
  --radius-lg: 20px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
  padding-top: env(safe-area-inset-top, 20px);
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.status {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg-elevated);
  border-radius: 100px;
}

.status.recording {
  color: var(--danger);
  background: var(--danger-glow);
}

.status.saving {
  color: var(--success);
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 48px;
}

/* Record Button */
.record-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.record-btn-inner {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.record-btn:hover .record-btn-inner {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.record-btn:active .record-btn-inner {
  transform: scale(0.95);
}

.record-btn.recording .record-btn-inner {
  background: var(--danger-glow);
  border-color: var(--danger);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--danger-glow); }
  50% { box-shadow: 0 0 0 20px transparent; }
}

.mic-icon, .stop-icon {
  width: 40px;
  height: 40px;
  color: var(--text);
  transition: all 0.2s ease;
}

.record-btn.recording .mic-icon {
  display: none;
}

.record-btn.recording .stop-icon {
  display: block;
  color: var(--danger);
}

.record-label, .record-time {
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.record-btn.recording .record-label {
  display: none;
}

.record-btn.recording .record-time {
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--danger);
  font-size: 16px;
  font-weight: 500;
}

/* Secondary Actions */
.actions {
  display: flex;
  gap: 16px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn svg {
  width: 24px;
  height: 24px;
}

.action-btn span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Footer / Pending */
.footer {
  padding: 20px 0;
}

.pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.pending-count {
  font-weight: 600;
  color: var(--accent);
}

.pending.empty {
  opacity: 0.5;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.modal-content {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.note-input {
  width: 100%;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  resize: none;
  margin-bottom: 20px;
}

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

.note-input::placeholder {
  color: var(--text-secondary);
}

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

.btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

.btn:active {
  transform: scale(0.97);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.settings-btn svg {
  width: 18px;
  height: 18px;
}

/* Settings Modal */
.settings-modal {
  max-height: 80vh;
  overflow-y: auto;
}

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

.settings-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Sync Options */
.sync-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-option {
  display: block;
  cursor: pointer;
}

.sync-option input {
  display: none;
}

.sync-option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.sync-option input:checked + .sync-option-content {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.sync-option-content:hover {
  border-color: var(--text-secondary);
}

.sync-option-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 10px;
}

.sync-option-icon.dropbox {
  background: rgba(0, 126, 229, 0.2);
  color: #007ee5;
}

.sync-option-icon.downloads {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.sync-option-icon svg {
  width: 20px;
  height: 20px;
}

.sync-option-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.sync-option-path {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: ui-monospace, monospace;
}

/* Sync Status */
.sync-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  margin-top: 4px;
  flex-shrink: 0;
}

.sync-status.active .sync-indicator {
  background: var(--success);
}

#syncStatusText {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
