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

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --info: #909399;
  --text: #303133;
  --text-light: #606266;
  --text-lighter: #909399;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --border: #ebeef5;
  --shadow: 0 2px 12px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 30px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.logo {
  padding: 0 24px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

.logo h1 {
  font-size: 22px;
  font-weight: bold;
}

.logo p {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  padding: 14px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  font-size: 14px;
}

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

.nav-item.active {
  background: rgba(255,255,255,0.2);
  border-right: 3px solid #fff;
}

.nav-icon {
  font-size: 18px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px 32px;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
}

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

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.stat-icon.blue { background: #e6f7ff; }
.stat-icon.green { background: #f6ffed; }
.stat-icon.orange { background: #fff7e6; }
.stat-icon.purple { background: #f9f0ff; }

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--text);
}

.stat-label {
  font-size: 14px;
  color: var(--text-lighter);
  margin-top: 4px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

/* Course List */
.course-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.course-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: #fafafa;
  border-radius: 10px;
  transition: all 0.2s;
}

.course-item:hover {
  background: #f0f5ff;
  transform: translateY(-2px);
}

.course-img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.course-info {
  flex: 1;
}

.course-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.course-desc {
  font-size: 13px;
  color: var(--text-lighter);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #764ba2);
  border-radius: 3px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 12px;
  color: var(--text-lighter);
  min-width: 40px;
}

/* Notes */
.note-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.note-item {
  padding: 20px;
  background: #fafafa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.note-item:hover {
  background: #f0f5ff;
}

.note-tag {
  display: inline-block;
  padding: 4px 10px;
  background: #e6f7ff;
  color: #1890ff;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 12px;
}

.note-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.note-preview {
  font-size: 13px;
  color: var(--text-lighter);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-lighter);
}

/* Tasks */
.task-list {
  
}

.task-item {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.task-check {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  margin-right: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.task-check:hover {
  border-color: var(--primary);
}

.task-check.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-check.checked::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.task-title.done {
  text-decoration: line-through;
  color: var(--text-lighter);
}

.task-time {
  font-size: 12px;
  color: var(--text-lighter);
}

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

.task-action {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.task-action.edit {
  background: #e6f7ff;
  color: #1890ff;
}

.task-action.delete {
  background: #fff1f0;
  color: #ff4d4f;
}

.task-action:hover {
  opacity: 0.8;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

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

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

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

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

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-lighter);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .course-list {
    grid-template-columns: 1fr;
  }
  .note-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    padding: 20px 0;
  }
  .logo, .nav-text {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 14px;
  }
  .main-content {
    margin-left: 60px;
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .note-list {
    grid-template-columns: 1fr;
  }
}

/* Page Sections */
.page-section {
  display: none;
}

.page-section.active {
  display: block;
}
