.status-debug {
  font-size: 12px;
  margin-top: 8px;
  color: var(--ios-gray);
  font-family: monospace;
}/* Activity Feed */
.activity-feed {
  flex: 1;
  background: var(--bg-primary);
  border-left: 1px solid var(--ios-gray5);
  display: flex;
  flex-direction: column;
}

.feed-header {
  padding: 16px;
  border-bottom: 1px solid var(--ios-gray5);
}/* ---------- iOS Design System ---------- */
:root {
  /* iOS Colors */
  --ios-blue: #007AFF;
  --ios-green: #34C759;
  --ios-red: #FF3B30;
  --ios-orange: #FF9500;
  --ios-yellow: #FFCC00;
  --ios-purple: #AF52DE;
  --ios-pink: #FF2D55;
  --ios-gray: #8E8E93;
  --ios-gray2: #AEAEB2;
  --ios-gray3: #C7C7CC;
  --ios-gray4: #D1D1D6;
  --ios-gray5: #E5E5EA;
  --ios-gray6: #F2F2F7;
  
  /* Light Mode Background */
  --bg-primary: #FFFFFF;
  --bg-secondary: var(--ios-gray6);
  --text-primary: #000000;
  --text-secondary: var(--ios-gray);
  
  /* System Fonts */
  --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* ---------- Typography ---------- */
h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ---------- Shared Components ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page {
  width: 100%;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.ios-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

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

.ios-btn-primary:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ios-btn-secondary {
  background: var(--ios-gray5);
  color: var(--ios-blue);
}

.ios-btn-secondary:hover {
  background: #d8d8dd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.ios-btn-success:hover {
  background: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.ios-btn-danger:hover {
  background: #dc3545;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ios-btn-warning {
  background: var(--ios-orange);
  color: white;
}

.ios-btn-warning:hover {
  background: #fd7e14;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ios-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.ios-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--ios-gray4);
  font-family: var(--font-primary);
  font-size: 16px;
  transition: border-color 0.3s ease;
  appearance: none;
  background: var(--ios-gray6);
}

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

.input-group {
  margin-bottom: 16px;
}

.app-title {
  color: var(--ios-blue);
  font-weight: 700;
}

.error {
  color: var(--ios-red);
  font-size: 14px;
  margin-top: 8px;
}

/* ---------- Login Page ---------- */
#loginPage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.login-container {
  display: flex;
  max-width: 900px;
  background: var(--bg-primary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.logo-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background: #000000;
  color: white;
  text-align: center;
}

.logo-section .app-title {
  color: white;
  font-size: 24px;
  margin-bottom: 16px;
  word-wrap: break-word;
  max-width: 100%;
}

.guest-login {
  margin-top: 30px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  width: 80%;
}

.guest-login h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.guest-login p {
  margin: 5px 0;
  font-size: 16px;
}

.tagline {
  font-size: 18px;
  opacity: 0.9;
}

.login-form {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form h2 {
  margin-bottom: 24px;
}

.login-form .ios-btn {
  max-width: 100%;
}

/* ---------- Dashboard Layout ---------- */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--ios-gray5);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info span {
  font-weight: 500;
}

.dashboard-content {
  display: flex;
  flex: 1;
  padding: 20px;
}

/* Recent Sessions Column */
.recent-sessions {
  flex: 1;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: 12px;
  margin-right: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ios-gray5);
}

.session-item {
  padding: 16px;
  background: var(--ios-gray6);
  border-radius: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.session-date {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.session-time {
  color: var(--ios-blue);
  font-weight: 500;
  margin-bottom: 8px;
}

.session-stats {
  display: flex;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Start Session Column */
.start-session-section {
  flex: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.start-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.start-card h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.start-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.start-card .ios-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 24px;
}

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

.stat-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 28px;
  font-weight: 600;
  color: var(--ios-blue);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* Friends Activity Column */
.friends-activity {
  flex: 1;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: 12px;
  margin-left: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.online-indicator {
  font-size: 14px;
  color: var(--ios-green);
  font-weight: 500;
}

.friends-list {
  max-height: 500px;
  overflow-y: auto;
}

.friend-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--ios-gray6);
}

.friend-item.online {
  border-left: 3px solid var(--ios-green);
}

.friend-item.offline {
  opacity: 0.7;
}

.friend-avatar {
  width: 40px;
  height: 40px;
  background: var(--ios-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  margin-right: 12px;
}

.friend-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.friend-status {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- Study Session Page ---------- */
#studySessionPage {
  overflow: hidden;
}

.session-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--ios-gray5);
}

.session-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.webcam-section {
  flex: 3;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

#webcam-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 20px;
  max-height: 75vh;
}

/* Ensure controls stay visible regardless of webcam size */
.controls-wrapper {
  position: relative;
  width: 100%;
}

.status-panel {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.session-control-panel {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

#webcam-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#startOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

#startOverlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.status-panel {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

#statusText {
  font-weight: 500;
  margin-right: 8px;
}

.status-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ios-gray);
}

.status-panel.studying .status-light {
  background: var(--ios-green);
}

.status-panel.paused .status-light {
  background: var(--ios-red);
}

.timer-display {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.session-control-panel {
  display: flex;
  gap: 12px;
}

.session-control-panel button {
  flex: 1;
  padding: 12px;
}

/* Todo List Styling */
.todo-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.add-todo {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-todo .ios-input {
  flex: 1;
}

.add-todo .ios-btn {
  flex-shrink: 0;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--ios-gray6);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

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

.todo-checkbox {
  margin-right: 12px;
  width: 20px;
  height: 20px;
}

.todo-text {
  flex: 1;
  font-size: 16px;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.todo-delete {
  background: none;
  border: none;
  color: var(--ios-red);
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.todo-delete:hover {
  opacity: 1;
}

/* Mini Friends List */
.mini-friends-list {
  padding: 16px;
  border-top: 1px solid var(--ios-gray5);
}

.mini-friends {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-friend {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-avatar {
  width: 40px;
  height: 40px;
  background: var(--ios-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
}

.mini-name {
  font-size: 12px;
  font-weight: 500;
}

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

.modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ios-gray5);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ios-gray);
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--ios-red);
}

.modal-body {
  padding: 20px;
}

/* Session Details Modal */
.session-overview {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ios-gray5);
}

.session-date-time {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.session-duration {
  color: var(--ios-blue);
  font-weight: 500;
}

.distraction-summary h3 {
  margin-bottom: 16px;
}

.chart-container {
  height: 200px;
  margin-bottom: 20px;
}

.distraction-list {
  max-height: 200px;
  overflow-y: auto;
}

.distraction-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--ios-gray5);
}

.distraction-item:last-child {
  border-bottom: none;
}

.distraction-item .time {
  font-weight: 500;
}

.distraction-item .type {
  color: var(--ios-red);
}

/* Summary Modal */
.summary-modal .modal-body {
  padding-bottom: 30px;
}

#summary {
  margin-bottom: 20px;
}

#summary h3 {
  color: var(--ios-blue);
  margin-bottom: 16px;
  text-align: center;
}

#summary p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ios-gray5);
}

#summary p:last-of-type {
  border-bottom: none;
  margin-bottom: 20px;
}

.summary-actions {
  text-align: center;
}

.distraction-summary-list {
  list-style: none;
  background: var(--ios-gray6);
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.distraction-summary-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--ios-gray5);
  font-size: 14px;
}

.distraction-summary-list li:last-child {
  border-bottom: none;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .dashboard-content {
    flex-direction: column;
  }
  
  .recent-sessions,
  .friends-activity {
    margin: 0 0 20px 0;
  }
  
  .session-container {
    flex-direction: column;
  }
  
  .activity-feed {
    border-left: none;
    border-top: 1px solid var(--ios-gray5);
  }
  
  .login-container {
    flex-direction: column;
    max-width: 500px;
  }
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite ease-in-out;
}