/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Rubik", sans-serif;
  background-color: hsl(226, 43%, 10%);
  color: white;
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  display: grid;
  place-items: center;
}

/* Dashboard Grid Layout */
.dashboard {
  max-width: 1110px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.5rem;
}

/* Profile Card */
.profile-card {
  background-color: hsl(235, 46%, 20%);
  border-radius: 15px;
  overflow: hidden;
  grid-row: span 2;
}

.profile-info {
  background-color: hsl(246, 80%, 60%);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid white;
}

.profile-text {
  flex: 1;
}

.report-for {
  font-size: 0.9rem;
  color: hsl(236, 100%, 87%);
  margin-bottom: 0.25rem;
  font-weight: 400;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.2;
}

.time-filters {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-btn {
  background: none;
  border: none;
  color: hsl(235, 45%, 61%);
  font-family: inherit;
  font-size: 1.1rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s ease;
  font-weight: 400;
}

.filter-btn:hover,
.filter-btn.active {
  color: white;
}

/* Activity Cards */
.activity-card {
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}

.activity-card[data-activity="work"] {
  background-color: hsl(15, 100%, 70%);
}

.activity-card[data-activity="play"] {
  background-color: hsl(195, 74%, 62%);
}

.activity-card[data-activity="study"] {
  background-color: hsl(348, 100%, 68%);
}

.activity-card[data-activity="exercise"] {
  background-color: hsl(145, 58%, 55%);
}

.activity-card[data-activity="social"] {
  background-color: hsl(264, 64%, 52%);
}

.activity-card[data-activity="self-care"] {
  background-color: hsl(43, 84%, 65%);
}

.activity-header {
  height: 38px;
  position: relative;
  overflow: hidden;
}

.activity-icon {
  position: absolute;
  top: -10px;
  right: 17px;
  width: 79px;
  height: 79px;
}

.activity-content {
  background-color: hsl(235, 46%, 20%);
  padding: 1.75rem 1.5rem;
  border-radius: 15px;
  margin-top: 28px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 1;
}

.activity-content:hover {
  background-color: hsl(235, 45%, 30%);
}

.activity-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.activity-title {
  font-size: 1.1rem;
  font-weight: 500;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.menu-btn:hover {
  opacity: 1;
}

.menu-btn img {
  width: 21px;
  height: 5px;
}

.activity-time {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.current-time {
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}

.previous-time {
  font-size: 0.9rem;
  color: hsl(236, 100%, 87%);
  font-weight: 400;
}

/* Attribution */
.attribution {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  text-align: center;
  color: hsl(235, 45%, 61%);
}

.attribution a {
  color: hsl(246, 80%, 60%);
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Desktop Layout */
@media (min-width: 1110px) {
  .dashboard {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }

  .profile-card {
    grid-row: span 2;
  }

  .profile-info {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 2.25rem 2rem 5rem;
    margin-bottom: 0;
  }

  .profile-avatar {
    width: 84px;
    height: 84px;
    margin-bottom: 2.7rem;
  }

  .profile-name {
    font-size: 2.5rem;
  }

  .time-filters {
    padding: 1.6rem 2rem 2rem;
  }

  .activity-time {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .current-time {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
  }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1109px) {
  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }

  .profile-card {
    grid-column: span 3;
    grid-row: span 1;
  }

  .profile-info {
    flex-direction: row;
    align-items: center;
    margin-bottom: 0;
  }

  .time-filters {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 2rem 2rem;
  }
}

/* Mobile Layout */
@media (max-width: 767px) {
  body {
    padding: 1.5rem 1.5rem 3rem;
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-card {
    grid-row: span 1;
  }

  .profile-info {
    flex-direction: row;
    align-items: center;
    margin-bottom: 0;
    padding: 2rem 2rem 2rem;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .time-filters {
    flex-direction: row;
    justify-content: space-between;
    padding: 1.5rem 2rem 2rem;
  }

  .activity-time {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .current-time {
    font-size: 2rem;
  }

  .previous-time {
    font-size: 0.9rem;
  }
}
