@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg-primary: #0f0e17;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --text-primary: #fffffe;
  --text-secondary: #a7a9be;
  --danger: #ff6b6b;
  --success: #00cec9;
  --warning: #fdcb6e;
  --border: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(0, 206, 201, 0.05) 0%, transparent 50%);
  z-index: -1;
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
}

.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.days-sidebar {
  flex: 0 0 220px;
  position: sticky;
  top: 30px;
}

.days-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.day-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition);
}

.day-item:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  transform: translateX(-4px);
}

.day-item:hover::before {
  background: var(--accent);
}

.day-item.active {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(108, 92, 231, 0.05));
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.day-item.active::before {
  background: var(--accent);
}

.day-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(108, 92, 231, 0.15);
  flex-shrink: 0;
}

.day-item.active .day-icon {
  background: var(--accent);
  color: white;
}

.day-info {
  flex: 1;
}

.day-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.day-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.day-badge {
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition);
}

.day-item:hover .day-badge,
.day-item.active .day-badge {
  opacity: 1;
  transform: scale(1);
}

.task-panel {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 400px;
}

.day-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.day-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
  font-size: 0.95rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: var(--transition);
  animation: slideIn 0.3s ease;
  position: relative;
}

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

.task-card:hover {
  border-color: rgba(108, 92, 231, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

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

.task-time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.task-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
  direction: ltr;
}

.task-reminder {
  font-size: 0.65rem;
  color: var(--warning);
  margin-top: 4px;
  background: rgba(253, 203, 110, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.task-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.task-details {
  flex: 1;
}

.task-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.task-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.task-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.task-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.task-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.task-action-btn.complete-btn:hover {
  background: rgba(0, 206, 201, 0.2);
  color: var(--success);
}

.task-action-btn.delete-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
}

.add-task-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: 2px dashed rgba(108, 92, 231, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-light);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-task-btn:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: var(--accent);
}

.add-task-btn span {
  font-size: 1.3rem;
  font-weight: 300;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a7a9be' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  padding-left: 32px;
}

.submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #5f3dc4);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* Toast */
.notification-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.3);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
}

.notification-toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-content {
  flex: 1;
}

.toast-content strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.toast-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }

  .days-sidebar {
    flex: none;
    position: static;
    width: 100%;
  }

  .days-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
    gap: 8px;
  }

  .day-item {
    flex: 0 0 auto;
    padding: 10px 14px;
  }

  .day-item:hover,
  .day-item.active {
    transform: none;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .task-panel {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 16px 12px;
  }

  .day-item {
    padding: 8px 12px;
    gap: 8px;
  }

  .day-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

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

  .task-time-block {
    flex-direction: row;
    gap: 10px;
  }

  .task-divider {
    width: 100%;
    height: 1px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
