:root {
  --bg-main: #ffffff;
  --bg-sidebar: #fafafa;
  --border-soft: #e5e5e5;
  --text-main: #111111;  /* single dark tone everywhere */
  --accent: #111111;
  --accent-soft: #f5f5f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  margin: 0;
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Montserrat Arabic", sans-serif;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* Sidebar */

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  padding: 1.75rem 1.9rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.app-title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.theme-pill {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  padding: 0.2rem 0.8rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: default;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-button {
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.nav-button[disabled] {
  opacity: 0.55;
  cursor: default;
}

.nav-button:hover:not([disabled]) {
  background: var(--accent-soft);
}

.nav-button--active {
  background: #f3f3f3;
  border-color: #e0e0e0;
}

.nav-icon {
  font-size: 1rem;
  margin-right: 0.55rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.75rem;
  font-size: 0.75rem;
}

/* Main layout */

.main {
  padding: 2.2rem 3.5rem 2.5rem;
}

.section {
  display: none;
}

.section--active {
  display: block;
}

.today-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* Date */

.today-date {
  font-size: 2rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 1.1rem;
}


/* Today install row */

.today-install-row {
  max-width: 900px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 1rem;
}



/* Install hint */

.install-hint {
  flex: 1 1 220px;
  width: 100%;
  max-width: 650px;
  text-align: left;
  padding: 0.9rem 1.2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border-soft);
  background: #f7f7f7;
  font-size: 1.05rem;
  line-height: 1.45;
  min-height: 116px;
}

.install-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}


.install-gotit {
  margin-top: 0.6rem;
  padding: 0;
  border: none;
  background: none;
  text-decoration: underline;
  font-size: 1.05rem;
  cursor: pointer;
}

/* Today’s word */

.today-word-block {
  margin-top: 1.8rem;
}

.today-word {
  font-family: "Montserrat Arabic", sans-serif;
  font-size: clamp(5rem, 7.4vw, 6.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  user-select: none;
}

.today-description {
  margin-top: 0.9rem;
  font-size: 1.5rem;
  line-height: 1.35;
}

/* Note area */

.today-note-block {
  margin-top: 1.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.today-note-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

/* Lined journal textarea */

.lined-textarea {
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid #c8c8c8;
  background-color: #ffffff;
  color: var(--text-main);

  font-family: "Montserrat Arabic", sans-serif;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 24px; /* text sits on lines */

  padding: 6px 0.9rem 6px; /* equal spacing, removes fractional top gap */

  height: 188px; /* exactly 7 lines */

  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px
  );
  background-size: 100% 24px;
  background-position: 0 22px;

  resize: none; /* remove resize handle */
  overflow: hidden; /* remove scroll / arrow */
}
.lined-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Placeholder sections */

.section-placeholder {
  font-size: 0.95rem;
}

/* Responsive for smaller screens */


/* Mobile header + drawer nav */

.mobile-header {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-main);
}

.mobile-menu-button {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.45rem 0.55rem;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-icon {
  display: block;
  width: 1.35rem;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
  box-shadow: 0 -5px 0 var(--text-main), 0 5px 0 var(--text-main);
}

.mobile-header-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 50;
}

.mobile-nav-overlay--open {
  display: block;
}

.mobile-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  max-width: 80%;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.12);
}

.mobile-nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.mobile-nav-app-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mobile-nav .nav-button {
  width: 100%;
}


@media (max-width: 767px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    border-right: none;
    border-bottom: none;
  }

  .main {
    padding: 1.25rem 1.25rem 2.5rem;
  }

  .mobile-header {
    display: flex;
  }

  /* Prevent horizontal overflow on small screens */
  .today-inner,
  .today-install-row,
  .collection-inner,
  .history-inner,
  .settings-inner {
    max-width: 100%;
    width: 100%;
  }

  .today-install-row {
    flex-direction: column;
    align-items: stretch;
  }

  

  .install-hint {
    width: 100%;
    max-width: 100%;
  }

  .today-word {
    font-size: 3.6rem;
  }

  .today-date {
    font-size: 1.6rem;
  }
}


/* Word Collection */

.collection-inner {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 1rem;
}

.section-title {
  font-size: 2.5rem; /* larger for section heading */
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.6rem;
}

.section-description {
  font-size: 1.5rem; /* match Today description size */
  text-align: center;
  margin: 0 auto 1.5rem;
  max-width: 560px;
}

.word-collection {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}




.word-group {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.word-group-heading {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
  color: #666666;
}

.word-group-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.word-collection-item {
  width: 100%;
  border: none;
  border-radius: 0.35rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.25rem;
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
  word-break: normal;
}

.word-collection-item:hover,
.word-collection-item:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.word-detail {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.32);
  z-index: 50;
}

.word-detail.word-detail--visible {
  display: flex;
}

.word-detail-card {
  position: relative;
  max-width: 640px;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border-soft);
  padding: 1.25rem 1.5rem 1.35rem;
  background: #ffffff;
  text-align: left;
  box-sizing: border-box;
}

.word-detail-word {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.word-detail-meta {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.word-detail-note {
  font-size: 1.15rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin-bottom: 0.9rem;
}

.word-detail-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
}

.settings-inner {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 1rem;
  text-align: left;
}

.settings-card {
  width: 100%;
  max-width: 640px;
  border-radius: 0.9rem;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  padding: 1.75rem 2rem 1.75rem;
  margin: 1.75rem auto 0 auto;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.settings-heading {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.settings-text {
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}

.settings-reminder-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.settings-reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-reminder-label {
  font-size: 1.05rem;
}

.settings-reminder-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-time-input {
  font-size: 1.05rem;
  padding: 0.25rem 0.45rem;
}

.settings-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.settings-note {
  font-size: 0.95rem;
  font-style: italic;
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
}

.settings-link-button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
/* History */
.history-inner {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 1rem;
}

.history-list {
  margin-top: 0.35rem;
  display: flex;
  justify-content: center;
}

.history-card {
  width: 100%;
  max-width: 640px;
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.history-row:last-child {
  border-bottom: none;
}

.history-date {
  font-size: 1.15rem;
}

.history-word {
  font-size: 1.15rem;
  font-weight: 700;
}
  top: 0.55rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}


.today-install-row {
  max-width: 520px;
  margin: 0 auto 1.75rem auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
}



.today-widget-icon-image {
  max-width: 76%;
  max-height: 76%;
  border-radius: 1.2rem;
}

.today-tip {
  margin: 2rem 0 2.25rem 0;
  font-size: 1.2rem;
  color: #222222;
  text-align: center;
}



.settings-danger-button {
  margin-top: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #cc0000;
  background: #ffffff;
  color: #cc0000;
  font-size: 0.95rem;
  cursor: pointer;
}

.settings-danger-button:hover {
  background: #ffecec;
}



.today-note-hint {
  margin-top: 0.6rem;
  font-size: 1.02rem;
  color: #444444;
}

.settings-options {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.18rem;
  color: #222222;
}

.settings-option input[type="radio"] {
  accent-color: #111111;
}


.settings-link-button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: #0066cc;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}


.install-line {
  display: block;
  white-space: normal;
}

.today-tip {
  white-space: normal;
}


.word-detail-note-label {
  margin-top: 0.3rem;
  font-weight: 600;
}

.word-detail-note {
  margin-top: 0.15rem;
}




/* Corrected journal popup styles */
.word-detail-meta {
  font-size: 0.95rem; /* restore smaller size */
  font-weight: 700;   /* bold the date */
}

.word-detail-note-label {
  font-size: 1rem; 
  font-weight: 700;
}


/* Popup title (WORD) */
.word-detail-word {
  text-transform: uppercase;
  font-weight: 700;
}

/* Heading: Dates this word has appeared */
.word-detail-heading {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
  letter-spacing: 0.2px;
}

/* Date line: bold */
.word-detail-meta {
  font-size: 1rem;
  font-weight: 700;
}

/* Journal entry label already bold/sized */


@media (max-width: 768px) {
  .main {
    padding: 1.5rem 1rem 2rem;
  }

  .today-inner {
    max-width: 100%;
  }

  .today-install-row {
    max-width: 100%;
    flex-direction: column;
    align-items: center;
  }

  

  .install-hint {
    max-width: 100%;
    width: 100%;
  }
}


/* v103 – unified mobile header + title spacing */
@media (max-width: 767px) {
  .main {
    padding-top: 0.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 2.5rem;
  }

  .mobile-header {
    padding-top: 0.1rem;
    padding-bottom: 0.3rem;
  }

  .section-title {
    margin-top: 0.4rem;
  }
}

/* FORCE UNIFORM HEADER HEIGHT */
@media (max-width: 767px){
  .mobile-header{
    height: 20px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items:center !important;
  }
}

/* Mobile-only: align History page content with other sections */


/* Mobile: keep the app grid top-aligned so short pages (like History) don't sit lower */
@media (max-width: 767px){
  .app{
    align-content: flex-start;
    justify-content: flex-start;
    align-items: flex-start;
  }
}

/* Clean single source of truth for today's icon box */
.today-widget-icon {
  min-width: 144px;
  height: 144px;
  border-radius: 1.6rem;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Desktop-only: keep install hint card at natural width so the Today row looks narrower and centered */
@media (min-width: 900px) {
  .install-hint {
    flex: 0 0 auto;
    width: auto;
  }
}
