@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600&display=swap');

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #FFFCFA;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ios-webview body {
  padding-top: env(safe-area-inset-top);
}

.container {
  flex: 1;
  width: 100%;
  padding: 2rem 1.2rem 6rem;
  box-sizing: border-box;
  background-color: #FFFCFA;
  display: flex;
  flex-direction: column;
}

.stats-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 1.5rem;
  margin: 1rem 0rem 0.5rem;
  text-align: center;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.05);
}

.stats-flex {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 600;
  color: #000;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

.streak-caption {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fef8f4;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.6rem 0;
  z-index: 99;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  text-decoration: none;
  flex: 1;
}


.bottom-nav img {
  width: 22px;
  height: 22px;
}

h1#greeting-heading {
  font-size: 2.4rem;
  font-weight: 600;
  text-align: left;
  margin-bottom: 1.5rem;
  color: #1F1F1F;
  letter-spacing: -0.5px;
}

p.tagline {
  text-align: left;
  font-size: 1.4rem;
  margin-top: -0.5rem;
}


h1 {
  font-size: 2.4rem;
  font-weight: 600;
  text-align: left;
  margin-bottom: 1.5rem;
  color: #1F1F1F;
  letter-spacing: -0.5px;
}

form label {
  display: block;
  margin-top: 1.2rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: #3A3A3A;
}

form input,
form select {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.4rem;
  border: 1px solid #DDD;
  border-radius: 16px;
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans';
  background-color: #FAFAFA;
  outline: none;
  transition: border 0.2s ease;
}

form input:focus,
form select:focus {
  border-color: #A7D3F3;
}

input[type="text"],
        input[type="email"],
        input[type="password"],
        input[type="date"],
        select {
            font-size: 1rem;
            padding: 0.9rem 1rem;
			font-family: "Plus Jakarta Sans'
            border-radius: 10px;
            width: 100%;
            box-sizing: border-box;
            margin-bottom: 1rem;
            border: 1px solid #ddd;
        }

button {
  width: 100%;
  padding: 1rem;
  margin-top: 2rem;
  background: linear-gradient(135deg, #A7D3F3, #F8C6C2);
  border: none;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  color: #2C2C2C;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  opacity: 0.95;
}

p {
  text-align: left;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

a {
  color: #7A5AF8;
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

.error-box {
  background: #FFF2F2;
  border: 1px solid #F8B4B4;
  padding: 1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  color: #C53030;
}

/* Chat */

.chat-box {
  flex-direction: column;
  display: flex;
  gap: 14px;
  padding: 4px;
  margin: 0.2rem 0;
  overflow-x: hidden;
}


/* Message Row */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message-row.user {
  flex-direction: row-reverse;
}

/* Avatar */
.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #E4F2FF;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bubble */
.message-bubble {
  padding: 1rem 1.3rem;
  border-radius: 20px;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 100%; /* ← this is what makes it match */
  word-wrap: break-word;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.message-row.user .message-bubble {
  background: #d8eaff;
  border-top-right-radius: 0;
  text-align: right;
}

.message-row .message-bubble.companion {
  background: #fff6f9;
  border-top-left-radius: 0;
  text-align: left;
}

.message-row .message-bubble.companion {
  background: #ffffff;
  border-top-left-radius: 0;
}

.message-row.user .message-bubble.user {
  background: #d8eaff;
  border-top-right-radius: 0;
}

/* Chat form */
#chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

#chat-form input[type="text"] {
  width: 100%;
  padding: 1.1rem;
  font-size: 1rem;
  border-radius: 16px;
  border: 1px solid #ccc;
  background: #FAFAFA;
  outline: none;
}

#chat-form button {
  width: 100%;
  padding: 1.1rem;
  font-size: 1rem;
  margin-top: 0px;
  font-weight: bold;
  border-radius: 16px;
  background: linear-gradient(to right, #a0c4ff, #ffafcc);
  border: none;
  cursor: pointer;
  color: #333;
}

.system-message {
  font-style: italic;
  font-size: 0.95rem;
  color: #666;
  margin: 10px 0;
}

/* ========================
   Mobile Styles
======================== */

@media (max-width: 600px) {
  body, html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background-color: #F7F3F0 !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem 1rem 6rem !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

	  h1#greeting-heading {
	  font-size: 1.6rem !important;
	  line-height: 1.3 !important;
	  margin: 0 0 0.4rem !important;
	}
	
	h1 {
	  font-size: 1.6rem !important;
	  line-height: 1.3 !important;
	  margin: 0 0 0.4rem !important;
	}

	.tagline {
	  font-size: 1rem;
	  margin: 0 0 1.2rem;
	}


  .message-bubble {
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
    max-width: 100% !important;
  }

  .message-avatar {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
  }

  #chat-form input[type="text"] {
    padding: 1rem !important;
    font-size: 1rem !important;
  }

  #chat-form button {
	margin-top: 0px !important;
    padding: 1rem !important;
    font-size: 1rem !important;
  }

  .bottom-nav {
    padding: 0.8rem 0 0.8rem !important;
  }

  .bottom-nav a {
    font-size: 0.75rem !important;
    gap: 3px !important;
  }

  .bottom-nav img {
    width: 24px !important;
    height: 24px !important;
  }
}

/* === Home Page Specific Styles === */

/* Mood Check-in Section */
.mood-checkin {
  margin-bottom: 2.5rem;
}

.mood-checkin.complete {
    margin-bottom: 2rem; /* or tweak the space here to your liking */
}


.mood-buttons {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.mood-btn {
  flex: 1 1 calc(25% - 0.8rem);
  padding: 0.8rem 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.mood-btn:hover {
  background: #f7f7f7;
}

/* Greeting spacing fixes */
.tagline {
  margin-top: 0.2rem;
  margin-bottom: 1.6rem;
}

/* Today's Flow Section */
.todays-flow {
  margin-top: 0rem;
}

.todays-flow h2 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.flow-sub {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1.2rem;
}

.task-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.2rem;
}

.task-list li {
  background: #fff;
  border: 1px solid #eee;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.6rem;
  border-radius: 18px;
  font-size: 1rem;
}

.task-list li.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.message-bubble.companion ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.message-bubble.companion li {
    margin-bottom: 0.4rem;
}

.message-bubble.companion p {
    margin: 0.5rem 0;
}

.message-bubble.companion p,
.message-bubble.companion ol,
.message-bubble.companion ul {
    text-align: left;
}

p.tagline {
    text-align: left;
    font-size: 1.1rem;
    margin-top: 0rem;
}

/* Button Styles */
.primary-button,
.secondary-button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.primary-button {
  background: linear-gradient(to right, #a0c4ff, #ffafcc);
  color: #2c2c2c;
  border: none;
}

.secondary-button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #333;
}

.primary-button:hover {
  opacity: 0.95;
}

.button {
    background: linear-gradient(to right, #a0c4ff, #ffafcc);
	color: #2c2c2c;
	border: none;
    padding: 1rem 1.6rem;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}
.button:hover {
    opacity: 0.95;
}

.message-bubble a {
    color: #a94fd1;
    text-decoration: underline;
    font-weight: 500;
}

.dot-flash {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #888;
  border-radius: 50%;
  animation: flash 1.2s infinite ease-in-out;
}

.dot-flash:nth-child(2) {
  animation-delay: 0.2s;
}
.dot-flash:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes flash {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.section-box {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.task-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: #fff;
    border-radius: 18px;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.task-list li.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.custom-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 6px;
    border: 2px solid #ccc;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: linear-gradient(to right, #c38bf0, #9fd0ff);
    border-color: transparent;
}

.custom-checkbox:checked::after {
    content: '✔';
    color: white;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 2px;
    left: 4px;
}

.task-list li.fade-out {
    opacity: 0.5;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.task-list li.completed {
    color: #999;
    text-decoration: line-through;
    opacity: 0.7;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  accent-color: #000869;
  width: 18px;
  height: 18px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
    position: relative;
}

.checkbox-wrap input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-wrap input[type="checkbox"]:checked {
    background-color: #c084fc;
    border-color: #c084fc;
}

.checkbox-wrap input[type="checkbox"]::after {
    content: '✓';
    position: absolute;
    left: 8px;
    top: 3px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease;
}


.checkbox-wrap input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: scale(1);
}

.task-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.task-time {
  font-size: 0.85rem;
  color: #999;
  margin-left: auto;
}

.important-icon {
  font-size: 1.1rem;
  color: #f39c12;
  margin-right: 4px;
}

.task-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.task-text {
    font-size: 1rem;
    font-weight: 500;
    flex: 1 1 60%;
}

.task-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 40%;
    font-size: 0.9rem;
    color: #999;
}

/* Mobile styling */
@media (max-width: 480px) {
    .task-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .task-meta {
        justify-content: flex-start;
        font-size: 0.85rem;
    }

    .task-meta .important-icon {
        font-size: 1rem;
    }
}

.fade-out {
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-link {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 500;
}

.task-meta-block p {
        text-align: left;
    }

/* Listen Page Audio Grid */
.section {
    margin-bottom: 2rem;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.track-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
}

.track-card:hover {
    transform: translateY(-3px);
}

.track-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.track-card .info {
    padding: 1rem;
    text-align: center;
}

.track-card .info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #6b42c1;
}

.track-card .info p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #666;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    justify-items: start;
    margin-top: 2rem;
}


.audio-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    background: #fff;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

@media (max-width: 1024px) {
    .audio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .audio-grid {
        grid-template-columns: repeat(1, 1fr);
        justify-items: center;
    }
}

.audio-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.audio-card .info {
    padding: 1rem;
}

.audio-card .title {
    font-weight: 600;
    color: #6B46C1; /* Your purple */
    margin-bottom: 0.25rem;
}

.audio-card .meta {
    font-size: 0.85rem;
    color: #666;
}

.featured-audio {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: 0.2s ease;
}
.featured-audio:hover {
    transform: translateY(-2px);
}
.featured-audio img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
}
.featured-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.featured-desc {
    font-size: 0.875rem;
    color: #666;
    margin: 0.25rem 0;
}
.featured-duration {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}
.subtle {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.mood-slider-wrap {
	margin-top: 1rem;
	margin-bottom: 2rem;
text-align: center;
}

.mood-value-display {
	font-size: 2.25rem;
	font-weight: 600;
	color: #333;
}

.mood-range {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	color: #aaa;
	padding: 0 1rem;
	margin-top: 0.25rem;
}

.mood-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #7e5bef, #f06292);
    border-radius: 10px;
    outline: none;
    margin: 0.5rem 0;
}

.mood-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #7e5bef;
    cursor: pointer;
    transition: background 0.3s ease;
}

.white-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

@media screen and (max-width: 600px) {
    .button {
        font-size: 0.65rem;
        padding: 0.5rem 0.9rem;
        min-width: auto;
    }

    .white-box.section > div {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.listen-up {
    margin-top: 1rem;
}

.listen-up h2 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.listen-sub {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.2rem;
}