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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f7f6;
  color: #2c3e50;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Login Screen */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn-primary {
  background: #3498db;
  color: white;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.error {
  color: #e74c3c;
  margin-top: 15px;
  text-align: center;
}

/* Navbar */
.navbar {
  background: #2c3e50;
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 20px;
}

.nav-links {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.1);
}

.nav-btn.active {
  background: #3498db;
  border-color: #3498db;
}

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

/* Activity Summary */
.activity-summary {
  background: white;
  margin: 20px 30px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.activity-summary h2 {
  margin-bottom: 15px;
  color: #2c3e50;
}

#activity-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.activity-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

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

/* Views */
.view {
  padding: 30px;
}

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

.view-header h2 {
  color: #2c3e50;
}

/* Task List */
.task-list {
  display: grid;
  gap: 15px;
}

.task-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-left: 4px solid #3498db;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.task-card.priority-high {
  border-left-color: #e74c3c;
  background-color: #fef5f4;
}

.task-card.priority-medium {
  border-left-color: #f39c12;
  background-color: #fefaf3;
}

.task-card.priority-low {
  border-left-color: #27ae60;
  background-color: #f4fbf6;
}

/* Category Tags */
.category-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-card.completed {
  opacity: 0.6;
}

.task-card.completed .task-title {
  text-decoration: line-through;
}

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

.task-title {
  font-weight: 600;
  font-size: 16px;
  color: #2c3e50;
}

.task-meta {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #7f8c8d;
  margin-bottom: 10px;
}

.task-description {
  color: #555;
  font-size: 14px;
  margin-bottom: 15px;
}

.task-actions {
  display: flex;
  gap: 10px;
}

.task-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* Calendar */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.calendar-grid {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.calendar-grid.daily {
  grid-template-columns: repeat(7, 1fr);
}

.calendar-grid.weekly {
  grid-template-columns: repeat(4, 1fr);
}

.calendar-grid.monthly {
  grid-template-columns: repeat(12, 1fr);
}

.calendar-day {
  background: white;
  padding: 15px;
  border-radius: 8px;
  min-height: 120px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.calendar-grid.monthly .calendar-day {
  padding: 8px;
}

.calendar-day-header {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 14px;
}

.calendar-day.today {
  background: #e8f4f8;
  border: 2px solid #3498db;
}

.calendar-task {
  background: #3498db;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 5px;
  cursor: pointer;
}

.calendar-task.priority-high {
  background: #e74c3c;
}

.calendar-task.priority-medium {
  background: #f39c12;
}

.calendar-task.priority-low {
  background: #27ae60;
}

.calendar-task.micro-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  font-size: 10px;
  background: white;
  color: #333;
  border: 1px solid #ddd;
  border-left: 3px solid #3498db;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task.micro-badge.priority-high {
  border-left-color: #e74c3c;
}

.calendar-task.micro-badge.priority-medium {
  border-left-color: #f39c12;
}

.calendar-task.micro-badge.priority-low {
  border-left-color: #27ae60;
}

/* Messages */
.messages-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  height: calc(100vh - 150px);
}

.messages-sidebar {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.messages-sidebar h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

.user-item {
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-item:hover {
  background: #f5f5f5;
}

.user-item.active {
  background: #3498db;
  color: white;
}

.unread-badge {
  background: #e74c3c;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.messages-main {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.messages-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messages-header h3 {
  color: #2c3e50;
}

.typing-indicator {
  color: #7f8c8d;
  font-style: italic;
  font-size: 14px;
}

.messages-list {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.message.sent {
  align-self: flex-end;
  background: #3498db;
  color: white;
}

.message.received {
  align-self: flex-start;
  background: #ecf0f1;
  color: #2c3e50;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 5px;
}

.message-form {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.message-form input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

/* Floating Chat Widget */
.floating-chat-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #3498db;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.floating-chat-btn:hover {
  transform: scale(1.05);
  background: #2980b9;
}

.floating-chat-btn .unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-chat-widget {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 320px;
  height: 450px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.chat-widget-header {
  background: #2c3e50;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-widget-header h3 {
  font-size: 16px;
  margin: 0;
  flex: 1;
  text-align: center;
}

.chat-widget-body {
  flex: 1;
  overflow-y: hidden;
  background: #f4f7f6;
  display: flex;
  flex-direction: column;
}

.chat-widget-body #users-list {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  /* Stage 1: General & Typography */
  body, .screen, .view, .modal-content, .task-card, p, h1, h2, h3, h4, h5, h6, span, div {
    word-break: break-word; /* Prevent long Turkish words from overflowing */
  }

  .btn, .form-group input, .form-group select, .form-group textarea {
    min-height: 44px; /* Touch targets for easy tapping */
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  .navbar {
    padding: 15px;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .navbar h1 {
    text-align: center;
    margin: 0 0 5px 0;
    width: 100%;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
  }

  .nav-btn {
    flex: 1;
    min-width: auto;
  }

  .user-info {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .view {
    padding: 15px;
  }

  /* Stage 2: Ana Plan (Main Plan) */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .view-header h2 {
    margin-bottom: 0;
  }

  #add-task-btn {
    width: 100%;
  }

  .task-card {
    padding: 15px;
  }

  .task-header {
    flex-direction: column;
    gap: 10px;
  }

  .task-meta {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
  }

  .category-tag {
    margin-bottom: 5px;
    padding: 5px 10px; /* Slightly larger for readability/touch if they ever become clickable */
  }

  .task-actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
  }

  .task-actions .btn {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 80px; 
    padding: 10px 5px; /* Increase height padding for touch */
  }
}

