/* Custom cho trang profile */
.profile-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1.5rem;
  font-family: "Roboto", sans-serif;
}
.profile-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #e5e7eb;
}
.profile-info h1 {
  font-size: 2.2rem;
  margin: 0;
  font-weight: 700;
}
.username {
  color: #666;
  font-size: 1.1rem;
}
.bio {
  margin-top: 0.5rem;
  color: #444;
  line-height: 1.6;
}

/* Biểu đồ hoạt động */
.contribution-graph {
  background: var(--bg-color, #fff);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}
.graph-title {
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.graph-legend {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 3px;
  margin-top: 1rem;
}
.graph-day {
  width: 11px;
  height: 11px;
  background: #e5e7eb;
  border-radius: 2px;
  transition: all 0.2s;
}
.level-0 {
  background: #f3f4f6;
}
.level-1 {
  background: #9be9a8;
}
.level-2 {
  background: #40c463;
}
.level-3 {
  background: #30a14e;
}
.level-4 {
  background: #216e39;
}

/* Khóa học */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.course-card:hover {
  transform: translateY(-4px);
}
.course-banner {
  height: 100px;
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
}
.course-content {
  padding: 1rem;
}
.course-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.course-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.75rem;
}
.free-tag {
  background: #10b981;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .avatar {
    margin: 0 auto;
  }
}
.back-btn {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  right: 458px;
  top: 50px;
}
.back-btn a {
  text-decoration: none;
  padding: 15px;
  color: white;
  background: #10b981;
  border-radius: 50px;
  font-weight: 500;
}
.edit-profile-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
  transition: background 0.3s;
}

.edit-profile-btn:hover {
  background: #059669;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.edit-avatar-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #10b981;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.edit-avatar-btn:hover {
  background: #059669;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin-top: 0;
  color: #1f2937;
  font-size: 24px;
}

.modal-content input[type="text"],
.modal-content textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Roboto", sans-serif;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.modal-content input[type="text"]:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: #10b981;
}

.modal-content textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-content input[type="file"] {
  margin: 10px 0;
  padding: 10px;
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-save {
  background: #10b981;
  color: white;
}

.btn-save:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-cancel {
  background: #e5e7eb;
  color: #1f2937;
}

.btn-cancel:hover {
  background: #d1d5db;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 10px auto;
  display: block;
  border: 3px solid #10b981;
}
