/* Brain V4 Calendar Widget — matches existing dashboard cyan-on-dark aesthetic */
.cal-widget {
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e8f0f5;
  max-width: 480px;
  margin: 20px auto;
}

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

.cal-month-title {
  font-size: 20px;
  font-weight: 500;
  color: #00d4ff;
  letter-spacing: 1px;
}

.cal-nav {
  display: flex;
  gap: 8px;
}

.cal-nav button {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.cal-nav button:hover {
  background: rgba(0, 212, 255, 0.3);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  font-size: 11px;
  text-align: center;
  color: rgba(0, 212, 255, 0.6);
  padding: 6px 0;
  letter-spacing: 1px;
  font-weight: 500;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  position: relative;
  font-size: 13px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.cal-day:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.4);
}

.cal-day.empty {
  background: transparent;
  cursor: default;
}

.cal-day.today {
  border: 1px solid #00d4ff;
  background: rgba(0, 212, 255, 0.18);
  font-weight: 500;
}

.cal-day.has-events.busy-1 { background: rgba(0, 212, 255, 0.2); }
.cal-day.has-events.busy-2 { background: rgba(0, 212, 255, 0.4); }
.cal-day.has-events.busy-3 { background: rgba(0, 212, 255, 0.65); color: #0a0a0a; font-weight: 500; }

.cal-day.has-birthday::after {
  content: '🎂';
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
}

.cal-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 212, 255, 0.15);
}

.cal-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(0, 212, 255, 0.7);
  margin-bottom: 10px;
}

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

.cal-event {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #00d4ff;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-event.birthday {
  border-left-color: #ff6b9d;
}

.cal-event-meta {
  font-size: 11px;
  color: rgba(232, 240, 245, 0.6);
}

.cal-event-delete {
  background: transparent;
  border: none;
  color: rgba(255, 100, 100, 0.6);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
}

.cal-event-delete:hover { color: #ff5050; }

.cal-add-btn {
  width: 100%;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.4);
  color: #00d4ff;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
  letter-spacing: 1px;
}

.cal-add-btn:hover {
  background: rgba(0, 212, 255, 0.3);
}

.cal-form {
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.cal-form.visible { display: flex; }

.cal-form input,
.cal-form select,
.cal-form textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #e8f0f5;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}

.cal-form input:focus,
.cal-form select:focus,
.cal-form textarea:focus {
  outline: none;
  border-color: #00d4ff;
}

.cal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cal-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.cal-form-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid;
  letter-spacing: 1px;
}

.cal-form-save {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  color: #00d4ff;
}

.cal-form-cancel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e8f0f5;
}

@media (max-width: 600px) {
  .cal-widget { padding: 14px; margin: 10px; }
  .cal-month-title { font-size: 16px; }
  .cal-day { font-size: 11px; }
}
