/* Random Page Styles */

.random-page .random-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.random-page .btn-primary,
.random-page .btn-secondary,
.random-page .btn-tertiary,
.random-page .btn-danger {
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.random-page .btn-primary {
  background: linear-gradient(135deg, var(--slime), var(--slime-dark));
  color: #fff;
  border-color: var(--slime-dark);
}
.random-page .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 90, 212, 0.4);
}
.random-page .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.random-page .btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink);
}
.random-page .btn-secondary:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
}

.random-page .btn-tertiary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
}
.random-page .btn-tertiary:hover {
  background: var(--ink);
  color: var(--bg);
}

.random-page .btn-danger {
  background: transparent;
  color: #ff4444;
  border-color: #ff4444;
}
.random-page .btn-danger:hover {
  background: #ff4444;
  color: #fff;
}

.random-display {
  animation: fadeIn 0.3s ease;
}

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

.random-page-title {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--ink);
}

.random-page-summary {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.random-page-content {
  margin: 16px 0;
}

.page-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .page-content-grid {
    grid-template-columns: 1fr 300px;
  }
}

.page-emoji-large {
  font-size: 80px;
  line-height: 1;
  text-align: center;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(139, 90, 212, 0.3));
}

.page-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.page-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page-tag.type {
  background: rgba(139, 90, 212, 0.2);
  color: var(--slime);
  border: 1px solid var(--slime);
}

.page-tag.category {
  background: rgba(70, 180, 255, 0.2);
  color: #46b4ff;
  border: 1px solid #46b4ff;
}

.page-tag.difficulty {
  background: rgba(255, 160, 60, 0.2);
  color: #ffa03c;
  border: 1px solid #ffa03c;
}

.page-description {
  color: var(--fg);
  line-height: 1.6;
  margin: 0 0 16px;
}

.page-actions-inline {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-stats-box,
.page-preview-box {
  background: rgba(139, 90, 212, 0.08);
  border: 1px solid rgba(139, 90, 212, 0.2);
  border-radius: 10px;
  padding: 16px;
}

.page-stats-box h4,
.page-preview-box h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--slime);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(139, 90, 212, 0.1);
  font-size: 13px;
}

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

.stat-row span:first-child {
  color: var(--muted);
}

.stat-row span:last-child {
  font-weight: 600;
  color: var(--ink);
}

.page-preview-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
}

.random-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(139, 90, 212, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(139, 90, 212, 0.2);
  margin: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.random-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.random-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.random-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
}

.loading-spinner {
  font-size: 32px;
  animation: spin 1s linear infinite;
}

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

.random-error {
  padding: 16px;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid #ff4444;
  border-radius: 8px;
  color: #ff4444;
  text-align: center;
}

/* Page of the Day */
.page-of-day-card {
  background: linear-gradient(135deg, rgba(139, 90, 212, 0.12), rgba(70, 180, 255, 0.08));
  border: 2px solid var(--slime);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeIn 0.4s ease;
}

.page-of-day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  background: linear-gradient(90deg, var(--slime), var(--slime-dark));
  color: #fff;
}

.page-of-day-header h3 {
  margin: 0;
  font-size: 22px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-of-day-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 13px;
  opacity: 0.9;
}

.page-of-day-content {
  padding: 20px;
}

.page-of-day-content p {
  margin: 0 0 16px;
  line-height: 1.6;
  color: var(--fg);
}

.page-of-day-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-badge {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.page-of-day-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 20px 20px;
}

/* Breadcrumbs */
.breadcrumbs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.breadcrumbs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.breadcrumbs-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.breadcrumbs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.breadcrumb-item:hover {
  border-color: var(--slime);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(139, 90, 212, 0.15);
}

.breadcrumb-emoji {
  font-size: 24px;
  flex-shrink: 0;
}

.breadcrumb-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breadcrumb-title {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-type {
  font-size: 12px;
  color: var(--muted);
}

.breadcrumb-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
  min-width: 80px;
}

.breadcrumb-visit {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
  opacity: 0.7;
}

.breadcrumb-visit:hover {
  background: rgba(139, 90, 212, 0.15);
  opacity: 1;
}

.breadcrumbs-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px;
  background: rgba(139, 90, 212, 0.08);
  border: 1px solid rgba(139, 90, 212, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breadcrumbs-stats .stat-item span:last-child {
  font-weight: 600;
  color: var(--ink);
  font-size: 16px;
}

.breadcrumbs-export {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Favorites */
.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.favorites-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.favorites-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .favorites-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.favorite-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.favorite-card:hover {
  border-color: var(--slime);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 90, 212, 0.15);
}

.favorite-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.favorite-emoji {
  font-size: 28px;
}

.favorite-title {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.favorite-summary {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.favorite-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.favorite-tag {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.favorite-tag.type { color: var(--slime); border-color: var(--slime); }
.favorite-tag.category { color: #46b4ff; border-color: #46b4ff; }
.favorite-tag.difficulty { color: #ffa03c; border-color: #ffa03c; }

.favorite-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.favorite-visit {
  flex: 1;
  padding: 6px 12px;
  font-size: 12px;
}

.favorite-remove {
  background: none;
  border: 1px solid transparent;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0.6;
}

.favorite-remove:hover {
  background: rgba(255, 68, 68, 0.1);
  border-color: #ff4444;
  opacity: 1;
}

.favorite-date {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.favorites-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 16px;
  background: rgba(139, 90, 212, 0.08);
  border: 1px solid rgba(139, 90, 212, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}

.favorites-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.favorites-stats .stat-item span:last-child {
  font-weight: 600;
  color: var(--ink);
  font-size: 16px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
}

/* Toast override */
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .random-display,
  .page-of-day-card,
  .breadcrumb-item,
  .favorite-card,
  .loading-spinner {
    animation: none;
    transition: none;
  }
}