:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --gray: #6b7280;
  --light-gray: #f3f4f6;
  --white: #ffffff;
  --border-radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--dark);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.install-content {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.install-icon {
  font-size: 2.5em;
}

.install-text {
  flex: 1;
}

.install-text strong {
  display: block;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.install-text small {
  color: var(--gray);
  font-size: 0.9em;
}

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

/* Header */
header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

/* User Info Card */
.user-info-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #fff;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

header h1 {
  font-size: 3.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  font-weight: 800;
}

.subtitle {
  font-size: 1.3em;
  opacity: 0.95;
  margin-bottom: 20px;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  color: white;
  padding: 6px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
  background: white;
  color: var(--primary);
  border-color: white;
}

.header-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-top: 20px;
}

.header-stat {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-stat .label {
  font-size: 0.9em;
  opacity: 0.9;
}

.header-stat .value {
  font-size: 1.5em;
  font-weight: bold;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 2.5em;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-label {
  display: block;
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.8em;
  font-weight: bold;
  color: var(--primary);
}

.stat-note {
  display: block;
  font-size: 0.75em;
  color: var(--gray);
  margin-top: 5px;
}

.stat-bar {
  width: 100%;
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Achievements */
.achievements-section {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.achievements-section h3 {
  margin-bottom: 20px;
  color: var(--dark);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.achievement {
  background: var(--light-gray);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement.unlocked {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  animation: achievementUnlock 0.5s ease-out;
}

@keyframes achievementUnlock {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.achievement-icon {
  font-size: 2em;
  margin-bottom: 5px;
}

.achievement-title {
  font-weight: bold;
  font-size: 0.9em;
  margin-bottom: 3px;
}

.achievement-desc {
  font-size: 0.75em;
  color: var(--gray);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.feature-card h2 {
  margin-bottom: 15px;
  color: var(--dark);
  font-size: 1.8em;
}

.feature-card p {
  color: var(--gray);
  margin-bottom: 20px;
}

/* Timer */
.timer-display {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 40px;
  border-radius: var(--border-radius);
  text-align: center;
  margin: 20px 0;
}

.timer-time {
  font-size: 4em;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.timer-status {
  font-size: 1.2em;
  opacity: 0.9;
  margin-top: 10px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
}

.input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.2s;
}

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

/* App List */
.app-list {
  margin: 20px 0;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--light-gray);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.app-item:hover {
  background: #e5e7eb;
}

.app-checkbox {
  width: 20px;
  height: 20px;
}

.app-name {
  flex: 1;
  font-weight: 500;
}

.app-badge {
  font-size: 0.75em;
  background: var(--warning);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
}

.limit-notice {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.limit-icon {
  font-size: 1.5em;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

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

.btn-premium {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  animation: premiumPulse 2s ease-in-out infinite;
}

@keyframes premiumPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.1em;
}

/* Viral Section */
.viral-section {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.viral-section h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 10px;
  color: var(--dark);
}

.viral-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 30px;
  font-style: italic;
}

.viral-card {
  max-width: 800px;
  margin: 0 auto;
}

.viral-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  justify-content: center;
}

.viral-stat {
  background: var(--light-gray);
  padding: 20px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 200px;
}

.viral-icon {
  font-size: 2.5em;
}

.viral-label {
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 5px;
}

.viral-value {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--primary);
}

.invite-section {
  margin-bottom: 30px;
}

.invite-section label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--dark);
}

.invite-code-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.invite-code-wrapper .input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.invite-code-wrapper .btn {
  min-width: 120px;
}

.network-effect-display {
  background: var(--light-gray);
  padding: 25px;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
}

.network-effect-display h4 {
  margin-bottom: 20px;
  color: var(--dark);
}

.network-bars {
  margin-bottom: 15px;
}

.network-bar-item {
  margin-bottom: 15px;
}

.network-bar-item span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.network-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.network-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 6px;
}

.network-bar-fill.paid {
  background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.network-bar-fill.enlightened {
  background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
}

.network-message {
  text-align: center;
  color: var(--gray);
  margin-top: 15px;
}

/* Pricing */
.pricing-section {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.pricing-section h2 {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--dark);
}

.pricing-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 30px;
  line-height: 1.8;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.pricing-card {
  background: var(--light-gray);
  border-radius: var(--border-radius);
  padding: 30px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.pricing-featured {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: scale(1.05);
}

.pricing-featured .pricing-header h3,
.pricing-featured .price,
.pricing-featured .pricing-features,
.pricing-featured .pricing-note {
  color: white;
}

.pricing-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--danger);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
}

.pricing-header {
  text-align: center;
  margin-bottom: 20px;
}

.pricing-header h3 {
  font-size: 1.8em;
  margin-bottom: 10px;
}

.price {
  font-size: 3em;
  font-weight: bold;
  color: var(--primary);
}

.price small {
  font-size: 0.4em;
  color: var(--gray);
}

.pricing-features {
  list-style: none;
  margin: 20px 0;
}

.pricing-features li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pricing-note {
  background: rgba(16, 185, 129, 0.1);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9em;
  margin-top: 20px;
  color: var(--success);
  font-weight: 600;
}

/* Notifications */
.notification-area {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

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

.notification-header h3 {
  color: var(--dark);
}

.notification-container {
  max-height: 400px;
  overflow-y: auto;
}

.notification {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  animation: notificationSlide 0.3s ease-out;
}

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

.notification.enlightenment {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  border-left-color: #ffd700;
}

.notification.encouragement {
  background: #dbeafe;
  border-left-color: var(--primary);
}

.notification.paid {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-left-color: #f5576c;
  color: white;
}

.notification.network {
  background: #e0e7ff;
  border-left-color: var(--primary);
  animation: networkPulse 1s ease-in-out infinite;
}

@keyframes networkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.notification.peer_pressure {
  background: #fef3c7;
  border-left-color: var(--warning);
}

.notification.hope {
  background: #d1fae5;
  border-left-color: var(--success);
}

.notification.bonus {
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  border-left-color: var(--success);
}

.notification-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 1.1em;
}

.notification-message {
  font-size: 0.95em;
  color: var(--gray);
}

/* Footer */
footer {
  margin-top: 40px;
  color: white;
}

.footer-warning {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  text-align: center;
}

.footer-warning h3 {
  margin-bottom: 15px;
  font-size: 1.8em;
}

.footer-stats {
  text-align: center;
  opacity: 0.9;
}

.footer-stats h4 {
  margin-bottom: 15px;
  font-size: 1.5em;
}

.global-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.global-stats span {
  font-size: 1.1em;
}

.global-stats strong {
  font-size: 1.3em;
  color: #ffd700;
}

/* Responsive */
/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
    padding: 15px;
  }

  header h1 {
    font-size: 2em;
  }

  .header-top {
    flex-direction: column;
    gap: 1rem;
  }

  .header-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-stat {
    width: 100%;
    justify-content: space-between;
  }

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

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

  .feature-card {
    padding: 1.5rem;
  }

  .feature-card h2 {
    font-size: 1.5rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pricing-featured {
    transform: scale(1);
  }

  .user-info-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
  }

  .user-details {
    flex: 1;
    min-width: 150px;
  }

  .user-name {
    font-size: 0.95rem;
  }

  .user-email {
    font-size: 0.85rem;
  }

  .btn-logout {
    width: 100%;
    margin-top: 5px;
  }

  .viral-stats {
    flex-direction: column;
    gap: 15px;
  }

  .viral-stat {
    min-width: auto;
    width: 100%;
  }

  .invite-code-wrapper {
    flex-direction: column;
  }

  .invite-code-wrapper input {
    width: 100%;
  }

  .invite-code-wrapper button {
    width: 100%;
  }

  .network-bars {
    gap: 1rem;
  }

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

  .notification-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .notification-header button {
    width: 100%;
  }

  .modal {
    width: 90%;
    margin: 20px;
    max-width: none;
  }

  .focus-duration-grid {
    grid-template-columns: 1fr;
  }

  .global-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .install-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8em;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .user-info-card {
    padding: 10px;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    border-width: 2px;
  }

  .user-name {
    font-size: 0.9rem;
  }

  .user-email {
    font-size: 0.8rem;
  }

  .viral-stat {
    padding: 15px;
  }

  .viral-icon {
    font-size: 2em;
  }

  .viral-value {
    font-size: 1.5em;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    font-size: 2rem;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 12px 24px;
    font-size: 1rem;
  }

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

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

  .pricing-card {
    padding: 1.5rem;
  }

  .toast {
    width: 90%;
    left: 5%;
    right: 5%;
  }
}