/* ===========================================
   AI Empire - Apple-style CSS
   =========================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-card: #141414;
  --color-bg-card-hover: #1e1e1e;
  --color-text: #f5f5f7;
  --color-text-secondary: #86868b;
  --color-text-tertiary: #6e6e73;
  --color-accent: #bf4dff;
  --color-accent-secondary: #ff6b9d;
  --color-accent-tertiary: #00d4aa;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  --color-success: #30d158;
  --color-warning: #ffd60a;
  --gradient-primary: linear-gradient(135deg, #bf4dff 0%, #ff6b9d 50%, #ff9f0a 100%);
  --gradient-secondary: linear-gradient(135deg, #00d4aa 0%, #00b4d8 100%);
  --gradient-card: linear-gradient(145deg, rgba(191, 77, 255, 0.1), rgba(255, 107, 157, 0.05));
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-base: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  --max-width: 1120px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

select, textarea, input {
  font-family: inherit;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition-base);
}

.nav-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.nav-logo-img {
  width: 28px;
  height: 28px;
}

.nav-logo-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  font-weight: 400;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  transition: var(--transition-fast);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  z-index: 999;
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu a {
  display: block;
  padding: 14px 0;
  font-size: 17px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu.active {
  display: block;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(191, 77, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-logo-container {
  margin-bottom: 32px;
  animation: float 6s ease-in-out infinite;
}

.hero-logo {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  filter: drop-shadow(0 20px 40px rgba(191, 77, 255, 0.3));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-title {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(20px, 3vw, 28px);
  color: var(--color-text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 17px;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 40px;
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator {
  width: 24px;
  height: 38px;
  border: 2px solid var(--color-text-tertiary);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.3; transform: translateX(-50%) translateY(10px); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(191, 77, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(191, 77, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  margin-top: 24px;
}

.btn-outline:hover {
  background: rgba(191, 77, 255, 0.08);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Sections --- */
.section {
  padding: 120px 24px;
  position: relative;
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 17px;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: 980px;
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 500;
}

/* --- Category Tabs --- */
.task-categories {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 8px 20px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border-hover);
}

.category-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
}

/* --- Task Cards --- */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.task-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.task-card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.task-card:hover::before {
  opacity: 1;
}

.task-card.completed {
  border-color: var(--color-success);
  background: rgba(48, 209, 88, 0.05);
}

.task-card.completed::before {
  background: var(--color-success);
  opacity: 1;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.task-emoji {
  font-size: 36px;
  line-height: 1;
}

.task-checkbox {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.task-checkbox:hover {
  border-color: var(--color-accent);
  background: rgba(191, 77, 255, 0.1);
}

.task-card.completed .task-checkbox {
  border-color: var(--color-success);
  background: var(--color-success);
}

.task-card.completed .task-checkbox::after {
  content: '✓';
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.task-category-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.tag-health { background: rgba(48, 209, 88, 0.15); color: #30d158; }
.tag-mind { background: rgba(100, 130, 255, 0.15); color: #6482ff; }
.tag-social { background: rgba(255, 159, 10, 0.15); color: #ff9f0a; }
.tag-fun { background: rgba(255, 107, 157, 0.15); color: #ff6b9d; }
.tag-news { background: rgba(0, 212, 170, 0.15); color: #00d4aa; }

.task-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

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

.task-difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.difficulty-dots {
  display: flex;
  gap: 3px;
}

.difficulty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

.difficulty-dot.active {
  background: var(--color-accent);
}

/* --- Progress --- */
.tasks-progress {
  text-align: center;
}

.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  margin: 0 auto 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width var(--transition-slow);
  width: 0%;
}

.progress-text {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* --- News Section --- */
.news-section {
  background: var(--color-bg-secondary);
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 16px;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 980px;
  font-size: 13px;
  color: var(--color-accent-tertiary);
}

.location-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-tertiary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.news-tasks {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.news-task-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all var(--transition-base);
}

.news-task-card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
}

.news-task-card.completed {
  border-color: var(--color-accent-tertiary);
  background: rgba(0, 212, 170, 0.05);
}

.news-source {
  font-size: 12px;
  color: var(--color-accent-tertiary);
  font-weight: 500;
  margin-bottom: 6px;
}

.news-task-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.news-task-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.news-task-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.news-task-check:hover {
  border-color: var(--color-accent-tertiary);
}

.news-task-card.completed .news-task-check {
  border-color: var(--color-accent-tertiary);
  background: var(--color-accent-tertiary);
}

.news-task-card.completed .news-task-check::after {
  content: '✓';
  color: #fff;
  font-weight: 700;
}

.loading-spinner {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* --- Proof Section --- */
.proof-section {
  background: var(--color-bg);
}

.proof-container {
  max-width: 700px;
  margin: 0 auto;
}

.proof-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 48px;
}

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

.proof-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.proof-task-type {
  padding: 4px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
}

.proof-select-task {
  margin-bottom: 24px;
}

.proof-select-task label {
  display: block;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.proof-select-task select {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 15px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.proof-select-task select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.proof-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proof-dropzone:hover,
.proof-dropzone.dragover {
  border-color: var(--color-accent);
  background: rgba(191, 77, 255, 0.05);
}

.proof-dropzone-content .proof-icon {
  color: var(--color-text-tertiary);
  margin-bottom: 16px;
}

.proof-dropzone-content .proof-text {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.proof-browse {
  color: var(--color-accent);
  cursor: pointer;
}

.proof-hint {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.proof-preview {
  position: relative;
  margin-top: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.proof-preview img {
  width: 100%;
  border-radius: var(--radius-md);
}

.proof-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.proof-remove:hover {
  background: rgba(255, 59, 48, 0.8);
}

.proof-camera-btns {
  text-align: center;
  margin-top: 16px;
}

.btn-camera {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  border-radius: 980px;
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.btn-camera:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.proof-description {
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 14px;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.proof-description:focus {
  outline: none;
  border-color: var(--color-accent);
}

.btn-submit-proof {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
  padding: 16px 28px;
  font-size: 17px;
}

/* --- Proof History --- */
.proof-history h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.proof-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.proof-history-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.proof-history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.proof-history-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.proof-history-info {
  padding: 12px;
}

.proof-history-info .proof-task-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.proof-history-info .proof-date-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.empty-state {
  text-align: center;
  color: var(--color-text-tertiary);
  padding: 40px;
  font-size: 15px;
  grid-column: 1 / -1;
}

/* --- Stats Section --- */
.stats-section {
  background: var(--color-bg-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* --- Weekly Chart --- */
.stats-weekly {
  max-width: 600px;
  margin: 0 auto 60px;
  text-align: center;
}

.stats-weekly h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.weekly-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 120px;
}

.chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 60px;
}

.chart-bar-fill {
  width: 100%;
  background: var(--gradient-primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height var(--transition-slow);
}

.chart-bar-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

/* --- Achievements --- */
.stats-achievement {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.stats-achievement h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.achievement {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  transition: all var(--transition-base);
}

.achievement.unlocked {
  border-color: var(--color-warning);
  background: rgba(255, 214, 10, 0.05);
}

.achievement.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.achievement-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* --- Footer --- */
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--color-border);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
}

.footer-logo {
  width: 22px;
  height: 22px;
}

.footer-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideIn 0.3s ease-out;
  max-width: 360px;
}

.toast.success {
  border-color: var(--color-success);
}

.toast.error {
  border-color: #ff3b30;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.modal-content h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.modal-content p {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.modal-reward {
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 24px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero { padding: 100px 20px 60px; }
  .hero-logo { width: 120px; height: 120px; }

  .section { padding: 80px 20px; }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .proof-card {
    padding: 24px;
  }

  .news-task-card {
    flex-direction: column;
    gap: 12px;
  }

  .proof-history-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile nav: language button shows only icon */
  .nav-right {
    gap: 4px;
  }
  .lang-btn {
    padding: 6px;
  }
  .lang-btn-text {
    display: none;
  }
  #langBtnText {
    display: none;
  }

  /* Mobile dropdown: position below nav, full width */
  .lang-dropdown {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    min-width: unset;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    transform: translateY(-12px);
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-value {
    font-size: 28px;
  }

  .achievements-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Smaller section titles on tiny screens */
  .section-title {
    font-size: 28px !important;
  }

  .section-desc {
    font-size: 15px;
  }

  /* Compact proof card */
  .proof-card {
    padding: 16px;
  }

  .task-card {
    padding: 20px;
  }

  /* Better touch targets */
  .task-checkbox,
  .news-task-check {
    width: 36px;
    height: 36px;
  }

  /* Toast: full width on small screens */
  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    max-width: 100%;
  }

  /* Modal: reduce padding */
  .modal-content {
    padding: 32px 24px;
  }
}

/* Safe area for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .nav {
    padding-top: env(safe-area-inset-top);
  }
  .footer {
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }
}

/* Prevent text zoom on iOS orientation change */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: auto;
    padding: 80px 20px 40px;
  }
  .hero-logo {
    width: 80px;
    height: 80px;
  }
}

/* --- Language Switcher --- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn svg {
  width: 16px;
  height: 16px;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 1100;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

[dir="rtl"] .lang-option {
  text-align: right;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.lang-option.active {
  color: var(--color-accent);
  background: rgba(191, 77, 255, 0.1);
}

.lang-option .lang-check {
  margin-left: auto;
  font-size: 12px;
  opacity: 0;
}

[dir="rtl"] .lang-option .lang-check {
  margin-left: 0;
  margin-right: auto;
}

.lang-option.active .lang-check {
  opacity: 1;
}

/* Footer language selector */
.footer-lang {
  margin-top: 16px;
}

.footer-lang-select {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-tertiary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236e6e73' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

[dir="rtl"] .footer-lang-select {
  padding-right: 8px;
  padding-left: 24px;
  background-position: left 8px center;
}

.footer-lang-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* --- RTL Support --- */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .nav-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-cta {
  flex-direction: row-reverse;
}

[dir="rtl"] .task-card-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .task-difficulty {
  flex-direction: row-reverse;
}

[dir="rtl"] .proof-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .news-task-card {
  flex-direction: column-reverse;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}

[dir="rtl"] .proof-remove {
  right: auto;
  left: 12px;
}

[dir="rtl"] .proof-select-task select {
  background-position: left 16px center;
  padding-right: 16px;
  padding-left: 16px;
}

[dir="rtl"] .stat-card {
  direction: rtl;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================
   Task Marketplace
   =========================================== */

/* --- Market Section --- */
.market-section {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.market-auth-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 14px;
}

.market-user-badge {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 980px;
}

.market-user-badge .user-name {
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 500;
}

.btn-market-logout {
  font-size: 12px;
  color: var(--color-text-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.btn-market-logout:hover {
  color: var(--color-text);
}

/* --- Market Categories --- */
.market-categories {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* --- Market Actions --- */
.market-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.btn-create-task {
  padding: 12px 28px;
  font-size: 16px;
}

/* --- Market Tasks Grid --- */
.market-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.market-task-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.market-task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-secondary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.market-task-card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.market-task-card:hover::before {
  opacity: 1;
}

.market-task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.market-task-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.market-user-name {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.market-task-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.market-task-reward {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.market-task-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

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

.market-task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.market-category-tag {
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
}

.tag-errand { background: rgba(48, 209, 88, 0.15); color: #30d158; }
.tag-skill { background: rgba(100, 130, 255, 0.15); color: #6482ff; }
.tag-creative { background: rgba(255, 107, 157, 0.15); color: #ff6b9d; }
.tag-advice { background: rgba(255, 159, 10, 0.15); color: #ff9f0a; }
.tag-other { background: rgba(255, 255, 255, 0.08); color: var(--color-text-secondary); }

.btn-market-accept {
  padding: 8px 18px;
  background: var(--gradient-secondary);
  color: #fff;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-market-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-market-owner {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-market-owner:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text);
}

/* --- Modal form styles --- */
.modal-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.modal-lg {
  max-width: 560px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

[dir="rtl"] .form-group {
  text-align: right;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 15px;
  transition: border-color var(--transition-fast);
}

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

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

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

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 14px 28px;
  font-size: 15px;
}

.form-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.form-switch a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.form-switch a:hover {
  text-decoration: underline;
}

/* --- Market Submit --- */
.market-submit-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.market-submit-reward {
  font-size: 14px;
  color: var(--color-accent-tertiary);
  font-weight: 500;
  margin-bottom: 20px;
}

/* --- Submissions Grid --- */
.market-submissions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.submission-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

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

.submission-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.submission-proof {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

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

.btn-submission-approve {
  padding: 8px 18px;
  background: var(--color-success);
  color: #fff;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-submission-approve:hover {
  box-shadow: 0 4px 15px rgba(48, 209, 88, 0.3);
}

.btn-submission-reject {
  padding: 8px 18px;
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-submission-reject:hover {
  background: rgba(255, 59, 48, 0.25);
}

/* --- Market responsive --- */
@media (max-width: 768px) {
  .market-tasks-grid {
    grid-template-columns: 1fr;
  }

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

  .modal-lg {
    max-width: 95%;
    padding: 32px 20px;
  }

  .market-task-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .btn-market-accept,
  .btn-market-owner {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .market-auth-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
