/* ===================================================
   SomeDailyWords — Rework
   Static frontend, no backend required
   =================================================== */

/* --- Base --- */

body {
  background: #fafafa;
  margin: 0;
}

header {
  margin-top: 70px;
  text-align: justify;
}

h1, h2, label,
.brand-logo,
blockquote .quote,
blockquote small {
  font-family: Inconsolata, monospace;
}

header p,
footer p,
.normal-font,
.normal-font-block p,
.teaser-box p,
.btn {
  font-family: "Roboto", sans-serif;
}

h1 {
  font-size: 2.5rem;
  padding-bottom: 5px;
  text-align: left;
  border-bottom: 3px solid #eee;
}

h2 {
  font-size: 2rem;
  text-align: left;
}

h3 {
  font-size: 1.5rem;
  text-align: left;
}

h4 {
  font-size: 1.3rem;
  text-align: left;
}

.bold-border-bottom {
  border-bottom: 3px solid #eee;
}

input:not([type=submit]),
textarea {
  background: white !important;
  padding: 15px 10px !important;
}

input:not([type=submit]) {
  height: auto !important;
}

textarea {
  height: 20rem !important;
  overflow-y: auto !important;
  font-size: 18px !important;
  line-height: 1.3 !important;
}

strong {
  font-weight: bold !important;
}

blockquote {
  font-size: 1.4rem;
  text-align: center;
  border: none;
  padding-left: 0;
}

blockquote p.quote {
  margin-bottom: 0;
  display: inline-block;
}

blockquote p.author {
  margin-top: 0;
  color: #aaa;
}

/* --- Layout Utilities --- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.spacing-top    { margin-top: 30px; }
.spacing-top-lg { margin-top: 60px; }
.spacing-bottom    { margin-bottom: 30px; }
.spacing-bottom-lg { margin-bottom: 60px; }

.text {
  font-size: 1.3rem;
}

.italic    { font-style: italic; }
.underline { text-decoration: underline; }

.teaser-box          { text-align: center; }
.teaser-box h2       { text-align: center; }
.teaser-box p,
.about-box p         { text-align: justify; }

.storage-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e3f2fd;
  border-left: 4px solid #039be5;
  border-radius: 2px;
  padding: 12px 16px;
  font-size: 0.92rem;
  color: #0d47a1;
}

.storage-banner a {
  color: #0d47a1;
  text-decoration: underline;
}

.storage-banner-icon {
  color: #039be5;
  font-size: 1.3rem !important;
  flex-shrink: 0;
}

.dark .storage-banner {
  background: #0d2137;
  border-color: #039be5;
  color: #90caf9;
}

.dark .storage-banner a {
  color: #90caf9;
}

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: 2px;
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #5d4037;
  max-width: 720px;
  margin: 0 auto;
}

.disclaimer p {
  margin: 0;
  text-align: left;
  font-family: "Roboto", sans-serif;
}

.disclaimer a {
  color: #5d4037;
  text-decoration: underline;
}

.disclaimer-icon {
  color: #ffc107;
  font-size: 1.3rem !important;
  flex-shrink: 0;
  margin-top: 1px;
}

.dark .disclaimer {
  background: #3e3520;
  border-color: #ffc107;
  color: #c8a96e;
}

.dark .disclaimer a {
  color: #c8a96e;
}

.today-preview {
  font-family: Inconsolata, monospace;
  font-size: 1rem;
  color: #888;
  max-width: 600px;
  margin: 0 auto 16px;
  text-align: left;
  font-style: italic;
  border-left: 3px solid #e0e0e0;
  padding-left: 12px;
}

.dark .today-preview {
  color: #666;
  border-color: #444;
}

/* --- Navbar --- */

nav {
  background: #424242;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .nav-wrapper {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 8px;
}

nav .brand-logo {
  font-family: Inconsolata, monospace;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  flex: 1;
  white-space: nowrap;
  /* override Materialize 1.x which sets position: absolute */
  position: static;
  transform: none;
  left: auto;
  padding: 0;
}

nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav .nav-links a {
  color: rgba(255,255,255,.87);
  text-decoration: none;
  padding: 0 12px;
  font-size: 0.95rem;
  aline-height: 56px;
  display: block;
}

nav .nav-links a:hover {
  background: rgba(255,255,255,.1);
}

/* hamburger — shown only on small screens */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #fff;
}

.nav-hamburger:focus {
  background: #6ebce2;
  outline: none;
}

/* --- Mobile Side Nav --- */

.side-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
}

.side-nav {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 201;
  transition: left .25s ease;
  padding-top: 20px;
  overflow-y: auto;
}

.side-nav.open {
  left: 0;
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav ul li {
  float: none !important;
  display: block !important;
  width: 100%;
}

.side-nav ul li a {
  display: block;
  padding: 14px 28px;
  color: #444;
  text-decoration: none;
  font-size: 1rem;
}

.side-nav ul li a:hover {
  background: #f5f5f5;
}

.side-nav .divider {
  height: 1px;
  background: #eee;
  margin: 8px 0;
}

/* --- Buttons --- */

.btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  height: 36px;
  line-height: normal;
  border-radius: 2px;
  background: #039be5;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 2px rgba(0,0,0,.14), 0 1px 5px rgba(0,0,0,.12);
  transition: background .2s;
  margin-bottom: 4px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.btn:hover {
  background: #0288d1;
  color: #fff;
}

.btn:focus {
  background: #6ebce2 !important;
}

.btn i.material-icons {
  font-family: 'Material Icons' !important;
  font-size: 1.1rem !important;
  display: inline !important;
  float: none !important;
  line-height: 1;
  margin: 0;
}

.btn-sm {
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
  font-size: 0.8rem;
}

nav .btn {
  margin-top: 2px !important;
  margin-right: 5px !important;
}

#side-nav-btn {
  margin: 10px 29px !important;
  display: block;
  width: calc(100% - 58px);
  text-align: center;
}

/* --- Cards --- */

.card {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 2px rgba(0,0,0,.14), 0 1px 5px rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.2);
  margin: 16px 0;
}

.card .card-content {
  padding: 24px;
  overflow-wrap: break-word;
}

.card .card-action {
  padding: 12px 24px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.card .card-action a:not(.btn) {
  color: #888;
  text-decoration: none;
  margin-right: 16px;
}

.card .card-action a:not(.btn):hover {
  color: #333;
}

.valign-wrapper {
  display: inline-flex !important;
  align-items: center;
}

.card .card-action .valign-wrapper {
  margin-right: 16px;
}

.card .card-action .valign-wrapper i {
  font-size: 1.1rem;
  margin-right: 3px;
}

.text-author {
  margin-top: -10px;
  font-style: italic;
}

/* --- Flash Messages --- */

.flash {
  padding: 5px 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 2px;
  box-shadow: 0 2px 2px rgba(0,0,0,.14);
}

.flash-notice  { background: #29b6f6; color: #fff; }
.flash-alert   { background: #ddd; color: #616161; }
.flash-danger  { background: #e57373; color: #fff; }
.flash-success { background: #66bb6a; color: #fff; }

/* --- Progress Bar --- */

.progress {
  background: #e0e0e0;
  border-radius: 2px;
  height: 4px;
  overflow: hidden;
}

.progress .determinate {
  background: #039be5;
  height: 100%;
  transition: width .3s ease;
}

.progress .determinate.green {
  background: #66bb6a;
}

/* --- Pagination --- */

.pagination {
  text-align: center;
  margin-bottom: 15px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 10px;
  margin: 2px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 2px rgba(0,0,0,.14), 0 1px 5px rgba(0,0,0,.12);
  text-decoration: none;
  color: inherit;
  font-style: normal;
  min-width: 36px;
}

.pagination .disabled { color: #aaa; cursor: default; }
.pagination .current,
.pagination a:hover   { background: #039be5; color: #fff; }

.written-today-box {
  text-align: center !important;
}

/* --- Footer --- */

.page-footer {
  margin-top: 60px;
  background: #eee;
  padding: 40px 0 0;
}

.page-footer .footer-content {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.page-footer .footer-col {
  flex: 1;
  min-width: 220px;
}

.page-footer h5 {
  color: #9e9e9e;
  font-size: 1rem;
  margin-bottom: 12px;
}

.page-footer p {
  color: #9e9e9e;
  font-size: 0.9rem;
}

.page-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-footer ul li a {
  color: #9e9e9e;
  text-decoration: none;
  line-height: 2;
  font-size: 0.9rem;
}

.page-footer ul li a:hover {
  color: #616161;
}

.footer-copyright {
  margin-top: 30px;
  padding: 12px 0;
  background: #e0e0e0;
  font-size: 0.85rem;
  color: #9e9e9e;
}

.footer-copyright i.material-icons {
  position: relative;
  top: 6px;
  font-size: 1rem;
}

.footer-copyright a {
  color: #9e9e9e;
  text-decoration: none;
}

/* --- Form Styles --- */

label {
  color: black;
  font-size: 1.1rem;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 5px;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 1rem;
  font-family: Inconsolata, monospace !important;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=number]:focus,
textarea:focus {
  border-color: #039be5;
  outline: none;
}

/* --- Word Count Bar (editor) --- */

#editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #777;
}

#autosave-state {
  font-style: italic;
}

.editor-meta-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.font-size-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #777;
  padding: 2px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.font-size-btn:focus {
  background: transparent !important;
  outline: none;
}

.font-size-btn:hover {
  color: #039be5;
}

.font-size-btn .material-icons {
  font-size: 1.1rem !important;
}

.font-size-label {
  font-size: 0.8rem;
  color: #999;
  min-width: 30px;
  text-align: center;
}

.dark .font-size-btn {
  color: #aaa;
}

.dark .font-size-btn:hover {
  color: #6ebce2;
}

/* ===================================================
   DARK MODE
   =================================================== */

.dark {
  background: #222;
  color: #aaa;
}

.dark h1,
.dark .bold-border-bottom {
  border-color: #444;
}

.dark .flash-alert {
  background: #aaa;
  color: #333;
}

.dark input:not([type=submit]),
.dark textarea {
  background: #333 !important;
  color: #aaa;
}

.dark label {
  color: #aaa;
}

.dark .page-footer {
  background: #333 !important;
}

.dark .footer-copyright {
  background: #2a2a2a;
}

.dark .card {
  background: #333 !important;
}

.dark .card .card-action a:not(.btn) { color: #bbb; }
.dark .card .card-action a:not(.btn):hover { color: #eee; }

.dark .side-nav {
  background: #444;
}

.dark .side-nav ul li a {
  color: #eee;
}

.dark .side-nav ul li a:hover {
  background: #555;
}

.dark .side-nav .divider {
  background: #777;
}

.dark .pagination a,
.dark .pagination span {
  background: #444;
  color: #ccc;
}

.dark .pagination .disabled {
  background: #333;
  color: #555;
}

.dark .pagination .current,
.dark .pagination a:hover {
  background: #039be5;
  color: #fff;
}

.dark .progress {
  background: #444;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 900px) {
  .nav-links { display: none !important; }
  .nav-hamburger { display: block; }
}

@media (max-width: 440px) {
  footer { text-align: center; }
  h1     { text-align: center; }
}

/* ===================================================
   STATISTICS
   =================================================== */

#stats-buttons a {
  margin-right: 6px;
  margin-bottom: 6px;
}

#stats-buttons a:hover {
  background: #888 !important;
}

/* Streak boxes */
#stats-streaks {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 16px 0 32px;
}

.streak-box {
  text-align: center;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 2px rgba(0,0,0,.14), 0 1px 5px rgba(0,0,0,.12);
  padding: 20px 32px;
  min-width: 120px;
}

.streak-number {
  font-size: 3rem;
  font-weight: bold;
  font-family: Inconsolata, monospace;
  color: #039be5;
  line-height: 1;
}

.streak-label {
  font-size: 0.85rem;
  color: #888;
  margin-top: 6px;
}

/* Daily entries */
.daily-month {
  margin-bottom: 16px;
}

.daily {
  display: inline;
}

.green-text {
  color: #43a047;
}

/* Dark mode overrides */
.dark .streak-box {
  background: #333;
}

.dark .streak-number {
  color: #29b6f6;
}

/* ===================================================
   TOASTS
   =================================================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.sdw-toast {
  background: #323232;
  color: #fff;
  padding: 12px 24px;
  border-radius: 2px;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
  pointer-events: auto;
}

.sdw-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 750px) {
  #toast-container {
    right: 16px;
    left: 16px;
    align-items: stretch;
  }
  .sdw-toast {
    white-space: normal;
    text-align: left;
  }
}

/* ===================================================
   PRINT
   =================================================== */

@media print {
  nav, footer, .btn, .flash, .nav-hamburger { display: none; }
  .text { font-size: 1rem; }
  .text-author {
    color: #666 !important;
    border-bottom: 1px solid #eee;
    text-align: right;
    margin-top: -20px;
  }
}
