/* mop - Retro Cubic Black & White */
/* Optimized for Kindle e-ink displays */

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

/* Base */
html, body {
  font-size: 16px;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fff;
  color: #000;
  line-height: 1.4;
}

/* Ensure all elements respect container width */
img, input, button, select, textarea {
  max-width: 100%;
}

/* Container */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-align: center;
}

p {
  margin-bottom: 1rem;
}

/* Links */
a {
  color: #000;
  text-decoration: underline;
}

.link, .link-btn {
  display: inline-block;
  padding: 0.5rem 0;
  color: #000;
  text-decoration: underline;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 3px solid #000;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: #000;
}

.btn-danger {
  background: #fff;
  color: #000;
  border-width: 2px;
}

.btn-large {
  padding: 1.25rem;
  font-size: 1.25rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  display: inline-block;
  width: auto;
}

.btn-secondary.active {
  background: #000;
  color: #fff;
}

/* Disabled state */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: #666;
  border-color: #666;
}

/* Loading state - Kindle compatible (no transform) */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: "...";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -0.6em;
  text-align: center;
  color: #fff;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
}

.btn-secondary.loading::after {
  color: #000;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
select {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  border: 3px solid #000;
  background: #fff;
  color: #000;
}

input:focus,
select:focus {
  outline: none;
  border-width: 4px;
}

/* Tabs */
.tabs {
  overflow: hidden;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #000;
}

.tab-btn {
  float: left;
  width: 50%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fff;
  color: #000;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -3px;
}

.tab-btn.active {
  background: #000;
  color: #fff;
  border-bottom-color: #000;
}

/* Practice Buttons (Home Screen) */
.practice-btn {
  display: block;
  width: 100%;
  padding: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  background: #000;
  color: #fff;
  border: 3px solid #000;
  cursor: pointer;
  margin-bottom: 0.75rem;
}


/* Timer showing hours/minutes until practice is due - left side */
.practice-timer {
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  width: 3rem;
  height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 2.5rem;
  text-align: center;
  background: #fff;
  color: #000;
  border: 2px solid #000;
}

/* Add left padding when timer is present */
.practice-row.has-timer .practice-btn {
  padding-left: 4.5rem;
}

/* Practice row with edit button */
.practice-row {
  position: relative;
  margin-bottom: 0.75rem;
}

.practice-row .practice-btn {
  margin-bottom: 0;
  padding-right: 4rem;
}

/* Pencil edit button - Kindle compatible (no flexbox/transform) */
.edit-btn {
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 2.5rem;
  text-align: center;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  cursor: pointer;
}

/* Pending completion state (inverted for Kindle e-ink) */
.practice-btn.pending {
  background: #fff;
  color: #000;
  border-width: 4px;
  position: relative;
}

.practice-btn.pending::after {
  content: "TAP TO CANCEL";
  display: block;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}

/* Completed state (saved, no longer clickable) */
.practice-btn.completed {
  background: #fff;
  color: #000;
  border-width: 2px;
}

.practice-btn.completed::after {
  content: "✓";
  display: block;
  font-size: 1.25rem;
  margin-top: 0.25rem;
}

/* Pagination */
.pagination {
  text-align: center;
  padding: 1rem 0;
  margin-bottom: 0.75rem;
}

.pagination .btn-small {
  margin: 0 0.5rem;
}

.page-info {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 700;
}

/* Practice List Items */
.practice-item {
  display: block;
  padding: 1rem;
  border: 3px solid #000;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: #000;
  /* Float-based layout for Kindle compatibility */
  overflow: hidden;
}

.practice-item-name {
  display: block;
  font-weight: 700;
  font-size: 1.125rem;
}

.practice-item-date {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}


/* Navigation Links */
.nav-links {
  margin-top: 3rem;
  padding: 1.5rem 0;
  text-align: center;
}

.nav-links .link-btn {
  font-size: 1.125rem;
  padding: 0.75rem 1.5rem;
}

/* Header Row */
.header-row {
  margin-bottom: 1rem;
}

/* Messages - Informational, visually distinct from buttons */
.message {
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  border: 1px dashed #000;
  margin-bottom: 1rem;
  font-weight: 400;
  text-align: left;
  position: relative;
  font-size: 0.9375rem;
}

.message::before {
  content: "✓";
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  font-size: 1rem;
}

.message.error {
  border-style: solid;
  border-width: 2px;
}

.message.error::before {
  content: "!";
  font-weight: 700;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.25rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  border: 2px solid #000;
  margin: 1rem 0;
}

.empty-state p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}


/* Edit Form Container */
.edit-form-container {
  border: 3px solid #000;
  padding: 1rem;
  margin-top: 1rem;
  background: #fff;
}

.edit-form-container h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
