/* OSRS Tracker - Clean Social Feed Theme */

/* Import clean, modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Clean Social Theme */
:root {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f3f5;

  /* Accent Colors - Subtle */
  --accent-primary: #1a73e8;
  --accent-hover: #1557b0;
  --accent-light: #e8f0fe;

  /* Text Colors */
  --text-primary: #1a1a1b;
  --text-secondary: #7c7c7c;
  --text-tertiary: #a8a8a8;
  --text-link: #0079d3;

  /* Border & Divider */
  --border-color: #e0e0e0;
  --divider-color: #edeff1;

  /* Status Colors */
  --success: #46a758;
  --success-bg: #ebf9ed;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --info: #0ea5e9;
  --info-bg: #e0f2fe;

  /* Social Interaction */
  --upvote: #ff4500;
  --upvote-filled: #cc3700;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1b;
    --bg-secondary: #0d0d0e;
    --bg-tertiary: #272729;
    --bg-elevated: #1a1a1b;
    --bg-hover: #272729;

    --accent-primary: #0079d3;
    --accent-hover: #3393dd;
    --accent-light: #1a1a1b;

    --text-primary: #d7dadc;
    --text-secondary: #818384;
    --text-tertiary: #6a6a6b;
    --text-link: #4fbcff;

    --border-color: #343536;
    --divider-color: #343536;

    --success-bg: #1a3320;
    --warning-bg: #3d2e00;
    --error-bg: #3d1313;
    --info-bg: #0d2f3f;
  }
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

body {
  background: var(--bg-secondary);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Monospace for stats/numbers */
.stat-number, .mono {
  font-family: 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Card System - Clean & Minimal */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--text-tertiary);
}

/* Feed Post Card */
.feed-post {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
  position: relative;
}

.feed-post:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Vote Sidebar */
.vote-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  min-width: 40px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.upvote-btn {
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color 0.1s;
}

.upvote-btn:hover {
  color: var(--upvote);
}

.vote-count {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 4px 0;
  color: var(--text-primary);
}

/* Button Styles - Clean */
.btn {
  font-family: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
}

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

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

.btn-danger:hover {
  background: #b91c1c;
}

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

.btn-success:hover {
  background: #3d8b49;
}

/* Badge System - Subtle */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
}

.badge-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.badge-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info);
}

.badge-neutral {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px; /* Minimum 16px prevents iOS zoom on focus */
  transition: all 0.2s;
  -webkit-appearance: none; /* Remove iOS default styling */
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
  border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--upvote);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Video/Image Viewer */
video, img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Feed Item Types */
.feed-item-levelup {
  border-left: 3px solid var(--success);
}

.feed-item-quest {
  border-left: 3px solid var(--warning);
}

.feed-item-loot {
  border-left: 3px solid var(--info);
}

.feed-item-death {
  border-left: 3px solid var(--error);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--divider-color);
  margin: 16px 0;
}

/* Avatar/User */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Metadata text */
.meta-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Hover card effect */
.hover-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .vote-sidebar {
    display: none;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Utility Classes */
.text-muted { color: var(--text-secondary); }
.text-subtle { color: var(--text-tertiary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.bg-subtle { background: var(--bg-secondary); }
.bg-elevated { background: var(--bg-elevated); }

.border-bottom { border-bottom: 1px solid var(--divider-color); }
.border-top { border-top: 1px solid var(--divider-color); }

/* Remove animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Turbo Native iOS App Styles */
body.turbo-native-ios nav {
  display: none !important;
}

body.turbo-native-ios main {
  padding-top: 8px;
}

/* Add safe area padding for iOS notch/home indicator */
body.turbo-native-ios {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
