/* Notify — Styles */

:root {
  --bg: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --border: #475569;
  --radius: 12px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* --- Login screen --- */

.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 100;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.login-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-input:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

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

.login-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

@media (hover: hover) {
  .login-btn:hover {
    background: var(--accent-hover);
  }
}

.login-error {
  color: var(--error);
  font-size: 14px;
  margin-top: 12px;
}

/* --- Header --- */

.header {
  padding: 20px 16px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.menu-btn {
  font-size: 33px;
  padding: 2px 2px 4px 2px;
}

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

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

.icon-btn.spinning {
  animation: spin 500ms linear;
  pointer-events: none;
}

/* --- Status --- */

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 6px 0 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--error); }

.status-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Menu --- */

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  /* background: rgba(0, 0, 0, 0.3); */
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 16px;
  z-index: 30;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 0;
  margin-top: -28px;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item.disabled {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: default;
}

@media (hover: hover) {
  .menu-item:not(.disabled):hover {
    background: var(--bg-card);
  }
}

/* --- Subscribe --- */

.subscribe-section {
  padding: 0 16px;
}

.subscribe-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin: 12px 0;
}

@media (hover: hover) {
  .subscribe-btn:hover {
    background: var(--accent-hover);
  }
}

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

/* --- Notification list --- */

.notification-list {
  flex: 1;
  padding: 8px 16px;
}

.notif-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin: 8px 0;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  transition: background 0.15s;
  cursor: default;
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}

.notif-icon-default {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.notif-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.notif-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}

.notif-url {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dismiss-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  align-self: center;
}

/* --- Empty state --- */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 16px;
}

.empty-state .empty-hint {
  font-size: 13px;
  margin-top: 8px;
}

/* --- Focus styles (keyboard navigation) --- */

.login-btn:focus-visible,
.subscribe-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--bg-surface);
  color: var(--text);
}

.dismiss-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--bg-card);
  color: var(--text);
}

.menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--bg-card);
}

/* --- Hover effects (pointer devices only) --- */

@media (hover: hover) {
  .icon-btn:hover {
    background: var(--bg-surface);
    color: var(--text);
  }

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

/* --- Responsive --- */

@media (max-width: 400px) {
  .header { padding: 16px 12px 10px; }
  .notification-list { padding: 6px 12px; }
}
