/* dzcv - Component Styles */

/* Homework card */
.homework-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.homework-item + .homework-item {
  border-top: 1px solid var(--border-light);
}

.homework-item .checkbox {
  margin-top: 2px;
}

.homework-content {
  flex: 1;
  min-width: 0;
}

.homework-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.homework-task {
  font-size: 14px;
  line-height: 1.5;
}

.homework-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Chat message */
.message {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  position: relative;
}

.message + .message {
  margin-top: 4px;
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.message-name {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.message-name:hover {
  text-decoration: underline;
}

.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.message-edited {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.message-actions {
  position: absolute;
  top: 4px;
  right: 0;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.message:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.message-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.message.pinned {
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 4px 0;
}

.pinned-indicator {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 500;
}

/* Chat input */
.chat-input-container {
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  background: var(--bg-blur);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 8px 12px;
  z-index: 50;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 800px;
  margin: 0 auto;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform 0.1s ease;
}

.chat-send-btn:hover {
  background: var(--accent-hover);
}

.chat-send-btn:active {
  transform: scale(0.92);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-messages {
  padding-bottom: 80px;
}

/* Muted banner */
.muted-banner {
  background: var(--warning-light);
  color: var(--warning);
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

/* Countdown */
.countdown-card {
  text-align: center;
  padding: 24px 16px;
}

.countdown-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.countdown-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile */
.profile-header {
  text-align: center;
  padding: 24px 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 auto 12px;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-username {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Settings list */
.settings-list {
  list-style: none;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-icon {
  color: var(--text-tertiary);
}

.settings-item-text {
  font-size: 14px;
}

.settings-item-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked ~ .toggle-thumb {
  transform: translateX(20px);
}

/* Admin user list */
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info-name {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-info-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.user-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Menu */
.menu-day {
  margin-bottom: 20px;
}

.menu-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.menu-items {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

/* Auth */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 0 16px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Color picker */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-input {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.color-hex-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: monospace;
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: var(--text-tertiary);
  padding: 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

/* List with drag */
.sortable-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.sortable-item.dragging {
  opacity: 0.5;
}

/* Pinned messages container */
.pinned-container {
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.pinned-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

/* User profile popup */
.user-popup {
  text-align: center;
  padding: 8px 0;
}

.user-popup-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 auto 12px;
}

.user-popup-name {
  font-size: 18px;
  font-weight: 700;
}

.user-popup-username {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.user-popup-details {
  margin-top: 16px;
  text-align: left;
}

.user-popup-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.user-popup-label {
  color: var(--text-tertiary);
}

/* More page */
.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition);
}

.more-item:hover {
  background: var(--bg-hover);
}

.more-item svg {
  color: var(--accent);
}

.more-item span {
  font-size: 13px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
