/* --- SCROLL FIX & BASE STYLES (from Dashboard) --- */
html, body {
  scroll-behavior: auto !important;
  overscroll-behavior: none !important;
}
* {
  scroll-behavior: auto !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
*:focus {
  scroll-margin: 0 !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #ef4444 100%);
  background-size: cover;
  background-attachment: fixed;
}

/* --- Floating Elements (match Dashboard/ZenRoast) --- */
.floating-elements {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.floating-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.2;
}
.floating-1 {
  top: 5rem;
  left: 2.5rem;
  width: 5rem;
  height: 5rem;
  background-color: #fde047;
  animation: bounce 2s infinite;
}
.floating-2 {
  top: 10rem;
  right: 5rem;
  width: 4rem;
  height: 4rem;
  background-color: #93c5fd;
  animation: pulse 2s infinite;
}
.floating-3 {
  bottom: 8rem;
  left: 25%;
  width: 3rem;
  height: 3rem;
  background-color: #86efac;
  animation: bounce 2s infinite;
  animation-delay: 1s;
}
.floating-4 {
  bottom: 5rem;
  right: 33%;
  width: 3.5rem;
  height: 3.5rem;
  background-color: #f9a8d4;
  animation: pulse 2s infinite;
  animation-delay: 0.5s;
}
.floating-5 {
  top: 60%;
  left: 8%;
  width: 2rem;
  height: 2rem;
  background-color: #a78bfa;
  animation: bounce 2s infinite;
  animation-delay: 1.5s;
}
.floating-6 {
  top: 40%;
  right: 5%;
  width: 4.5rem;
  height: 4.5rem;
  background-color: #fbbf24;
  animation: pulse 2s infinite;
  animation-delay: 1s;
}
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translate3d(0, 0, 0); }
  40%, 43% { transform: translate3d(0, -30px, 0); }
  70% { transform: translate3d(0, -15px, 0); }
  90% { transform: translate3d(0, -4px, 0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Navbar (match Dashboard/ZenRoast) --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
}
.sparkle-icon {
  width: 1.5rem;
  height: 1.5rem;
  animation: pulse 2s infinite;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}
.nav-item i {
  width: 1rem;
  height: 1rem;
}
.logout-btn {
  background: rgba(239, 68, 68, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 1);
  border-color: rgba(239, 68, 68, 0.5);
}

/* --- Glassmorphism Card (match Dashboard/ZenRoast) --- */
.arena-card {
  max-width: 1200px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* Header */
.arena-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-bottom: 0;
  border-bottom: none;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.header-content h1 {
  font-size: 2.5rem;
  color: white;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-content p {
  color: white;
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
  margin: 0;
}

.focus-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 1rem;
  min-width: auto;
}

.focus-streak i {
  width: 1.25rem;
  height: 1.25rem;
}

.streak-number {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.streak-label {
  font-size: 1rem;
  opacity: 1;
  margin: 0;
}

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

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Content Cards */
.content-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  color: #333;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: #8B5CF6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #7C3AED;
  transform: translateY(-1px);
}

.action-btn.danger {
  background: #EF4444;
}

.action-btn.danger:hover {
  background: #DC2626;
}

/* Distraction Form */
.distraction-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #8B5CF6;
}

.intensity-slider {
  appearance: none;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  outline: none;
}

.intensity-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #8B5CF6;
  border-radius: 50%;
  cursor: pointer;
}

.intensity-value {
  text-align: center;
  font-weight: 600;
  color: #8B5CF6;
}

.log-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.log-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.sarcasm-box {
  background: linear-gradient(135deg, #F59E0B, #F97316);
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1rem;
  font-style: italic;
  text-align: center;
  font-weight: 500;
  display: none;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-card canvas {
  max-height: 300px;
}

/* Logs */
.logs-container {
  max-height: 400px;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.empty-state i {
  font-size: 2rem;
  color: #8B5CF6;
  margin-bottom: 1rem;
}

.log-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border-left: 4px solid #8B5CF6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-content {
  flex: 1;
}

.log-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.log-details {
  font-size: 0.85rem;
  color: #666;
}

.log-time {
  font-size: 0.8rem;
  color: #888;
}

.log-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
}

.log-actions {
  display: flex;
  gap: 0.5rem;
}

.log-action {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.log-action:hover {
  background: #F3F4F6;
  color: #333;
}

/* Insights & Achievements */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.insights-content,
.achievements-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.insight-item i {
  color: #8B5CF6;
  font-size: 1.2rem;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.achievement.unlocked {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
}

.achievement.locked {
  opacity: 0.6;
}

.achievement i {
  font-size: 1.5rem;
  color: #F59E0B;
}

.achievement.unlocked i {
  color: white;
}

.achievement-info {
  flex: 1;
}

.achievement-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.achievement-desc {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Challenge */
.challenge-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.challenge-info {
  flex: 1;
}

.challenge-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.challenge-desc {
  color: #666;
  font-size: 0.9rem;
}

.challenge-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
  max-width: 300px;
}

.toast.success {
  border-left: 4px solid #10B981;
}

.toast.error {
  border-left: 4px solid #EF4444;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.modal-close:hover {
  background: #F3F4F6;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid #E5E7EB;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn.primary {
  background: #8B5CF6;
  color: white;

}

.btn.primary:hover {
  background: #7C3AED;
}

.btn.secondary {
  background: #F3F4F6;
  color: #374151;
}

.btn.secondary:hover {
  background: #E5E7EB;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.export-format {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.export-format label {
  font-weight: 500;
  color: #333;
}

.export-format select {
  padding: 0.5rem;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 1rem;
}

/* Category Colors */
.log-item[data-category="Social Media"] {
  border-left-color: #3B82F6;
}

.log-item[data-category="Gaming"] {
  border-left-color: #8B5CF6;
}

.log-item[data-category="Food"] {
  border-left-color: #F59E0B;
}

.log-item[data-category="Overthinking"] {
  border-left-color: #EF4444;
}

.log-item[data-category="Phone"] {
  border-left-color: #10B981;
}

.log-item[data-category="News"] {
  border-left-color: #F97316;
}

.log-item[data-category="YouTube"] {
  border-left-color: #DC2626;
}

.log-item[data-category="Shopping"] {
  border-left-color: #EC4899;
}

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

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

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

@keyframes triggerHighlight {
  0% {
    transform: scale(1);
    background-color: #ffffff;
  }
  50% {
    transform: scale(1.05);
    background-color: #fef3c7;
  }
  100% {
    transform: scale(1);
    background-color: #ffffff;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  .arena-card {
    margin: 1rem;
  }
}