@import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Manrope:wght@200..800&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");

/* ---------- RESET ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- THEME ---------- */
:root {
  --bg-main: hsl(226, 43%, 10%);
  --bg-card: hsl(235, 46%, 20%);
  --bg-profile: hsl(246, 80%, 60%);
  --text-muted: #bbc0ff;
  --text-main: #ffffff;

  --work: hsl(15, 100%, 70%);
  --play: hsl(195, 74%, 62%);
  --study: hsl(348, 100%, 68%);
  --exercise: hsl(145, 58%, 55%);
  --social: hsl(264, 64%, 52%);
  --selfcare: hsl(43, 84%, 65%);

  --text-1: 56px/66px "Rubik";
  --text-2: 40px/47px "Rubik";
  --text-3: 32px/38px "Rubik";
  --text-4: 24px/28px "Rubik";
  --text-5m: 18px/21px "Rubik";
  --text-5r: 18px/21px "Rubik";
  --text-6: 15px/18px "Rubik";
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  /* font-family:  */
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- LAYOUT ---------- */

.page {
  width: 100%;
  padding: 0.3rem;
}

.dashboard {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 500px;
}

/* ---------- PROFILE CARD (mobile) ---------- */

.profile-card {
  background-color: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  /* width: 100%; */
  height: 203px;
}

.profile-card__top {
  background-color: var(--bg-profile);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  /* width: 90%; */
  border-radius: 15px;
  height: 133px;
}

.profile-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
}

.profile-card__label {
  font: var(--text-6);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.profile-card__name {
  font: var(--text-4);
  font-weight: 300;
}

.profile-card__tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  gap: 2.8rem;
  height: 70px;
}

.tab {
  background: none;
  border: none;
  color: #7078c9;
  font: var(--text-5m);
  font-weight: 400;
  cursor: pointer;
}

.tab--active,
.tab:hover {
  color: #fff;
}

/* ---------- CARDS GRID (mobile) ---------- */

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* outer colored top */
.time-card {
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  height: 160px;
}

/* coloured strip */
.time-card__header {
  height: 3rem;
  position: relative;
  overflow: hidden;
  height: 50px;
}
.time-card__header img {
  position: absolute;
  width: 80px;
  height: 55px;
  top: -4px;
  right: 1rem;
  transform: rotate(4deg);
}
/* main dark card */
.time-card__body {
  background-color: var(--bg-card);
  border-radius: 1rem 1rem 0.8rem 0.8rem;
  padding: 1.7rem 1.5rem;
  margin-top: -0.75rem; /* overlap coloured strip */
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  height: 122px;
}

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

.time-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-card__top img {
  width: 1rem;
}
.time-card__title {
  font: var(--text-5m);
  font-weight: 500;
}

.time-card__hours {
  font: var(--text-3);
  font-weight: 300;
  margin-top: 0.5rem;
}
.flex-p-container {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  /* padding: 1.2rem 0; */
}
.flex-p-container p {
  white-space: pre-wrap; /* Keep formatting but allow wrapping */
  word-wrap: break-word; /* Break long words */
}
.time-card__prev {
  font: var(--text-6);
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- CARD COLORS ---------- */

.time-card--work .time-card__header {
  background-color: var(--work);
}

.time-card--play .time-card__header {
  background-color: var(--play);
}

.time-card--study .time-card__header {
  background-color: var(--study);
}

.time-card--exercise .time-card__header {
  background-color: var(--exercise);
}

.time-card--social .time-card__header {
  background-color: var(--social);
}

.time-card--selfcare .time-card__header {
  background-color: var(--selfcare);
}

/* ======================================================================
   TABLET  (≈ 700px) – profile full width, cards in 3-column grid
   ====================================================================== */
@media (min-width: 700px) {
  .dashboard {
    margin: 0 auto;
    gap: 1.5rem;
    max-width: none;
    height: calc(612px + 7rem);
    width: calc(670px);
  }

  .profile-card {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-rows: 133px 70px;
    overflow: hidden;
    height: 203px;
    width: 638px;
    border-radius: 15px;
  }

  .profile-card__tabs {
    justify-content: center;
    align-items: center;
    gap: 4rem;
    padding: 1.7rem;
    height: 70px;
  }
  /* .profile-card {
    max-width: 540px;
    margin-inline: auto;
    display: grid;
    grid-template-rows: auto auto;
  } */

  .profile-card__top {
    padding: 2rem;
    border-radius: 15px;
    height: 133px;
  }

  .profile-card__name {
    font: var(--text-4);
    font-weight: 300;
  }

  /* .profile-card__tabs {
    padding-inline: 2rem;
    justify-content: flex-start;
    gap: 1.5rem;
  } */

  .cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    place-items: center;
  }
  .time-card {
    height: 213px;
    width: 188px;
  }
  .time-card__header {
    height: 45px;
  }
  .time-card__body {
    padding: 25px 21px;
    width: 188px;
    height: 180px;
  }

  .time-card__hours {
    font: var(--text-1);
    font-weight: 300;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
  .flex-p-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}

/* ======================================================================
   DESKTOP  (≈ 1024px+) – left profile column, right cards grid 3x2
   ====================================================================== */
@media (min-width: 1180px) {
  .dashboard {
    display: grid;
    grid-template-columns: 1fr 3fr;
    align-items: stretch;
    width: calc(1116px + 2rem);
    height: calc(520px + 2rem);
    gap: 2rem;
  }

  .profile-card {
    height: 520px; /* stop stretching */
    width: 254px;
    grid-template-rows: auto auto; /* natural height */
  }

  .profile-card__top {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2.5rem;
    padding: 2rem;
    width: 255px;
    height: 354px;
  }

  .profile-card__avatar {
    height: 77px;
    width: 77px;
  }

  .profile-card__name {
    font: var(--text-2);
    font-weight: 300;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    place-items: center;
    gap: 2rem;
    width: 829px;
  }
  .profile-card__tabs {
    flex-direction: column;
    gap: 1.3rem;
    align-items: flex-start;
    padding: 1.7rem 2rem;
    height: 163px;
  }
  .time-card__body {
    width: 255px;
    height: 199px;
    padding: 2rem;
  }
  .time-card {
    width: 255px;
    height: 244px;
  }
  .time-card__top img {
    width: 21px;
  }
  .time-card__hours {
    margin-top: 1.5rem;
    font: var(--text-1);
    font-weight: 300;
    margin-bottom: 0.5rem;
  }
  .flex-p-container {
    font: var(--text-5r);
    font-weight: 500;
  }
  .time-card__header {
    height: 57px;
  }
}
