/* AI Virtual Office — Main Styles */
/* RTL support for Arabic */

:root {
  --primary: #3f51b5;
  --primary-dark: #303f9f;
  --accent: #ff9800;
  --success: #4caf50;
  --danger: #f44336;
  --info: #2196f3;
  --bg: #f5f5f5;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #212121;
  --muted: #666;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  text-align: right;
  color: var(--text);
  background: var(--bg);
}

#canvas-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#ui-layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#ui-content {
  pointer-events: auto;
  padding: 20px;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  margin: 24px;
  border: 1px solid rgba(255,255,255,0.6);
}

h1 {
  margin: 0 0 16px 0;
  font-size: 1.35rem;
  color: #1a237e;
  text-align: center;
}

#agent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-card {
  background: #eceff1;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.88rem;
  border-left: 5px solid #3f51b5;
  transition: all 0.2s ease;
}

.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.agent-card.idle { border-left-color: #9e9e9e; background: #fafafa; }
.agent-card.working { border-left-color: #4caf50; background: #e8f5e9; }
.agent-card.reviewing { border-left-color: #ff9800; background: #fff3e0; }
.agent-card.completed { border-left-color: #2196f3; background: #e3f2fd; }
.agent-card.error { border-left-color: #f44336; background: #ffebee; }

.agent-name {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  color: #1a237e;
}

.agent-role {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.agent-status-row {
  display: flex;
  align_items: center;
  gap: 6px;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.agent-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.agent-task {
  font-size: 0.8rem;
  color: #3f51b5;
  font-weight: 600;
  word-break: break-word;
}

#task-section {
  margin-bottom: 16px;
}

#task-section h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: #1a237e;
}

#task-list {
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.82rem;
  color: #333;
  padding-right: 4px;
}

.task-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 6px;
}

.task-item:last-child { border-bottom: none; margin-bottom: 0; }

.task-title {
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 10px;
  text-align: center;
  min-width: 60px;
}

.task-status.completed { background: #e3f2fd; color: #1565c0; }
.task-status.reviewing { background: #fff3e0; color: #ef6c00; }
.task-status.planned { background: #f3e5f5; color: #7b1fa2; }
.task-status.in_progress { background: #e8f5e9; color: #2e7d32; }

#controls {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  border_radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}

button:hover { background: var(--primary-dark); }
button:active { transform: scale(0.97); }

button.secondary {
  background: #9e9e9e;
}

button.secondary:hover { background: #757575; }

#status-bar {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 10px 14px;
  border_radius: 10px;
  font-size: 0.85rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

#mobile-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  background: var(--primary);
  color: white;
  border: none;
  border_radius: 24px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: none;
  box-shadow: 0 4px 12px rgba(63,81,181,0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
  #mobile-toggle { display: block; }
  #ui-layer {
    width: auto;
    height: auto;
    right: auto;
    left: 0;
    top: 0;
    padding: 0;
  }
  #ui-content {
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    margin: 0;
    border_radius: 12px;
  }
  h1 { font-size: 1.1rem; }
  #agent-grid { grid-template-columns: 1fr; }
  #status_bar { left: 12px; right: auto; bottom: 12px; }
}

/* Scrollbar styling */
#task-list::-webkit-scrollbar { width: 6px; }
#task-list::-webkit-scrollbar-track { background: transparent; }
#task-list::-webkit-scrollbar-thumb { background: #ccc; border_radius: 3px; }
