/* מס״ע – אתר Main (masa.jonathangalai.xyz) */
:root {
  --soil: #3d2c1e;
  --earth: #5c4a3a;
  --leaf: #2d5a27;
  --leaf-light: #4a7c43;
  --wheat: #c9a227;
  --cream: #f5f0e8;
  --white: #fefdfb;
  --shadow: rgba(61, 44, 30, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: 'Heebo', 'Assistant', -apple-system, sans-serif;
  margin: 0;
  background: var(--cream);
  color: var(--soil);
  line-height: 1.6;
  min-height: 100vh;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 253, 251, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--shadow);
  padding: 0.75rem 1.5rem;
}

nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--leaf);
  text-decoration: none;
}

nav .auth-area,
nav .user-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav .user-email {
  font-size: 0.9rem;
  color: var(--earth);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav .nav-author {
  font-size: 1rem;
  color: var(--earth);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

nav .nav-author:hover {
  background: var(--leaf);
  color: var(--white);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.btn-ghost {
  background: transparent;
  color: var(--earth);
  border-color: var(--shadow);
}

.btn-ghost:hover {
  background: var(--leaf);
  color: var(--white);
  border-color: var(--leaf);
}

.btn-primary {
  background: var(--leaf);
  color: var(--white);
  border: none;
  width: 100%;
  padding: 0.65rem;
}

.btn-primary:hover {
  background: var(--leaf-light);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--white);
  color: var(--soil);
  border: 1px solid var(--shadow);
}

.btn-google:hover {
  background: var(--cream);
  border-color: var(--leaf);
  color: var(--leaf);
}

.add-link-wrap {
  margin-top: 1rem;
}

.btn-plus {
  background: var(--leaf);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
}

.btn-plus:hover {
  background: var(--leaf-light);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal.modal-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.modal-box h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  color: var(--soil);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--earth);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--cream);
  color: var(--soil);
}

.auth-divider {
  text-align: center;
  margin: 1rem 0;
  color: var(--earth);
  font-size: 0.9rem;
}

.auth-form input,
.auth-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--shadow);
  border-radius: var(--radius-sm);
  font: inherit;
  direction: rtl;
}

.auth-form input:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--leaf);
}

.auth-form button {
  margin-top: 0.5rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: var(--earth);
  margin: 1rem 0 0;
}

.day-card-dynamic {
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--soil);
  border: 1px solid var(--shadow);
  box-shadow: 0 4px 16px var(--shadow);
  padding: 1.5rem 2rem;
}

.day-card-dynamic:hover {
  border-color: var(--leaf);
  box-shadow: 0 6px 24px var(--shadow);
}

.day-card-dynamic .day-card-link {
  flex: 1;
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.day-card-dynamic .day-card-link:hover {
  color: var(--leaf);
}

.day-card-dynamic .day-card-title {
  display: block;
  margin-bottom: 0.25rem;
}

.day-card-dynamic .day-card-desc {
  display: block;
  font-size: 0.95rem;
  opacity: 0.9;
}

.day-card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--shadow);
}

.btn-edit {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: var(--cream);
  color: var(--earth);
  border: 1px solid var(--shadow);
}

.btn-edit:hover {
  background: var(--leaf);
  color: var(--white);
  border-color: var(--leaf);
}

.btn-delete {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  color: #b53c3c;
  border: 1px solid rgba(181, 60, 60, 0.5);
}

.btn-delete:hover {
  background: #b53c3c;
  color: var(--white);
  border-color: #b53c3c;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 60vh;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  color: var(--soil);
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.hero p {
  color: var(--earth);
  font-size: 1.1rem;
  margin: 0;
}

.days {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 420px;
}

.day-card-main {
  background: linear-gradient(145deg, var(--leaf) 0%, #234a1f 100%);
  color: var(--white);
  box-shadow: 0 8px 32px rgba(45, 90, 39, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.day-card-main:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(45, 90, 39, 0.45);
  background: linear-gradient(145deg, var(--leaf-light) 0%, var(--leaf) 100%);
}

.day-card-icon {
  width: 64px;
  height: 64px;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.day-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.day-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.day-card-desc {
  font-size: 0.95rem;
  opacity: 0.9;
}

.day-card-link-item {
  background: var(--white);
  color: var(--soil);
  border: 1px solid var(--shadow);
  box-shadow: 0 4px 16px var(--shadow);
  text-decoration: none;
}

.day-card-link-item:hover {
  border-color: var(--leaf);
  box-shadow: 0 6px 24px var(--shadow);
  color: var(--leaf);
}

.day-links-page.days {
  align-items: stretch;
}

.day-links-page .day-card-link-item .day-card-title {
  display: block;
}

.day-links-page .day-card-link-item .day-card-desc {
  display: block;
}

@media (max-width: 700px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .day-card {
    padding: 1.5rem 1.25rem;
  }

  .day-card-title {
    font-size: 1.15rem;
  }
}
