/* routine.css - Styles strictly for the Routine page of Altyn Urpaq */

:root {
  --timeline-line: #a9bccd;
  --bg-gradient: #f8fbff;
  --pill-yellow: #fad172;
  --pill-blue: #aae0f3;
  --pill-coral: #fc8d7b;
  --pill-mint: #b3ecd4;
  --text-dark: #1f2937;
  --shadow-routine: 0 10px 30px rgba(0,0,0,0.06);
}

body.routine-page {
  background: linear-gradient(180deg, #f0f7fe 0%, #ffffff 100%);
  position: relative;
  overflow-x: hidden;
}

/* Routine Hero */
.routine-hero {
  padding: 80px 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.routine-hero__content {
  max-width: 500px;
}
.routine-hero__content h1 {
  font-size: 4rem;
  font-weight: 900;
  color: #df9b21; /* Gold color for heading */
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 20px;
}
.routine-hero__content p {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.routine-hero__visual {
  position: relative;
  flex: 1;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-decor-sun {
  position: absolute;
  top: 0; right: 0;
  width: 140px;
}
.hero-decor-cloud {
  position: absolute;
  top: 40px; left: 40px;
  width: 180px;
}

/* Tabs */
.routine-tabs-wrap {
  text-align: center;
  width: 100%;
  margin: 40px auto 60px;
  display: block;
}
.routine-tabs {
  background: #e3ecf3;
  padding: 8px;
  border-radius: 99px;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}
.routine-tab {
  padding: 12px 32px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 1rem;
  color: #5d6e82;
  text-align: center;
  line-height: 1.2;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}
.routine-tab span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
  margin-top: 4px;
}
.routine-tab.active {
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.routine-title-center {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 60px;
}

/* Timeline Layout */
.routine-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 100px;
  position: relative;
}

.timeline-container {
  position: relative;
  padding: 20px 0;
  display: none;
}
.timeline-container.active {
  display: block;
}

/* The vertical center wire — only around rows, not the title */
.tl-rows-wrap {
  position: relative;
}
.tl-rows-wrap::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--timeline-line) 5%, var(--timeline-line) 95%, transparent);
  z-index: 0;
}

.tl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
}

/* The dot ON the wire for each row */
.tl-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--timeline-line);
  z-index: 2;
}

.tl-pill {
  width: 44%;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  background: #fff;
  box-shadow: var(--shadow-routine);
  border-left: 5px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Horizontal connector line from pill to the dot */
.tl-pill::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  background-color: var(--timeline-line);
  transform: translateY(-50%);
  width: 24px;
}

.tl-icons {
  width: 44%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tl-icons img {
  height: 60px;
  width: auto;
}

/* Odd rows: pill LEFT, icons RIGHT */
.tl-row:nth-child(odd) .tl-pill {
  order: 1;
  text-align: left;
}
.tl-row:nth-child(odd) .tl-pill::after {
  right: -24px;
  left: auto;
}
.tl-row:nth-child(odd) .tl-icons {
  order: 2;
  justify-content: flex-start;
  padding-left: 12px;
}

/* Even rows: icons LEFT, pill RIGHT */
.tl-row:nth-child(even) .tl-pill {
  order: 2;
  text-align: left;
  border-left: none;
  border-right: 5px solid transparent;
}
.tl-row:nth-child(even) .tl-pill::after {
  left: -24px;
  right: auto;
}
.tl-row:nth-child(even) .tl-icons {
  order: 1;
  justify-content: flex-end;
  padding-right: 12px;
}

/* Pill Accents — odd rows use border-left, even rows use border-right */
.accent-yellow { border-left-color: var(--pill-yellow) !important; border-right-color: var(--pill-yellow) !important; }
.accent-yellow::after  { background-color: var(--pill-yellow); }
.tl-row:has(.accent-yellow)::before { border-color: var(--pill-yellow); }

.accent-blue  { border-left-color: var(--pill-blue)  !important; border-right-color: var(--pill-blue)  !important; }
.accent-blue::after   { background-color: var(--pill-blue); }
.tl-row:has(.accent-blue)::before  { border-color: var(--pill-blue); }

.accent-coral { border-left-color: var(--pill-coral) !important; border-right-color: var(--pill-coral) !important; }
.accent-coral::after  { background-color: var(--pill-coral); }
.tl-row:has(.accent-coral)::before { border-color: var(--pill-coral); }

.accent-mint  { border-left-color: var(--pill-mint)  !important; border-right-color: var(--pill-mint)  !important; }
.accent-mint::after   { background-color: var(--pill-mint); }
.tl-row:has(.accent-mint)::before  { border-color: var(--pill-mint); }

.tl-time {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.tl-desc {
  font-weight: 600;
  font-size: 1.05rem;
  opacity: 0.9;
}



/* Background Decorators */
.bg-decor {
  position: absolute;
  z-index: -1;
  opacity: 0.8;
  pointer-events: none;
}
.bg-decor-1 { top: 30%; left: -2%; max-width: 150px; }
.bg-decor-2 { top: 40%; right: 2%; max-width: 100px; }
.bg-decor-3 { top: 55%; left: 3%; max-width: 120px; }
.bg-decor-4 { top: 70%; right: -2%; max-width: 200px; }
.bg-decor-5 { top: 85%; left: 5%; max-width: 140px; }
.bg-decor-6 { top: 95%; right: 4%; max-width: 120px; }
.bg-decor-7 { top: 15%; right: 80%; max-width: 180px; }

@media (max-width: 1024px) {
  /* No changes needed since grid is removed */
}

@media (max-width: 768px) {
  .routine-hero { flex-direction: column; padding-top: 20px; text-align: center; gap: 20px; }
  .routine-hero__content h1 { font-size: 2.2rem; }
  .routine-hero__visual { height: 160px; }
  .routine-hero__visual > img { height: 120px; position: relative; z-index: 2; } /* the clock */
  .hero-decor-sun { display: none; }
  .hero-decor-cloud { display: none; }
  
  .routine-tabs { flex-direction: column; background: transparent; padding: 0; gap: 8px; width: 100%; margin-bottom: 20px; }
  .routine-tab { background: #e3ecf3; border-radius: 99px; width: 100%; padding: 12px; }
  .routine-tab.active { background: #ffffff; }
  
  .tl-rows-wrap::before { left: 24px; }
  .tl-row { flex-direction: column; margin-bottom: 40px; }
  .tl-row::before { left: 24px; top: 40px; }
  
  .tl-pill { width: calc(100% - 60px); margin-left: 60px; border-left-width: 8px !important; border-left-style: solid !important; border-right: none !important; padding: 16px 20px; }
  .tl-pill::after { display: none; } 
  .tl-icons { width: calc(100% - 60px); justify-content: flex-start !important; margin: 16px 0 0 60px; order: 3 !important; padding: 0 !important; }
  .tl-icons img { height: 40px; }
  
  .tl-row:nth-child(odd) .tl-pill, .tl-row:nth-child(even) .tl-pill { order: 1; text-align: left; }
  .tl-row:nth-child(odd) .tl-icons, .tl-row:nth-child(even) .tl-icons { order: 2; }

  /* Scale down background decorators on mobile heavily */
  .bg-decor { transform: scale(0.3); opacity: 0.4; }
}
