/* Relies on variables from style.css (e.g., --bg, --fg, --border, --accent) */

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Atkinson Hyperlegible", sans-serif;
  margin: 0;
  padding: 0px;
  overflow-y: auto;
}

/* === Auth Screen === */
#auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  position: relative;
  background-color: var(--bg);
  background-image: radial-gradient(
    circle at center,
    var(--bg-dots) 2px,
    transparent 2px
  );
  background-size: 30px 30px;
}

#sign-in-form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:center;
  width: 100vw;
  height: 100vh;
  background: var(--bg-seethroug);
  backdrop-filter: blur(1.5rem);
  -webkit-backdrop-filter: blur(1.5rem);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10002;
  opacity: 0;
}

#sign-in-form-container.hidden {
  display:none;
}

#sign-in-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  background:transparent;
  position: fixed;
  width:100%;
  max-width:400px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
}

#bible-board-text {
  font-size: 50px;
  font-weight: 700;
  margin:0px;
}

/* .connection-svg-overlay {
  display:none;
} */

.board-item {
  display: none;
}

#auth-content-container {
  width: calc(100vw - 50px);
  max-width: 1500px;
  height: calc(100vh - 50px);
  max-height: 800px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
}

#get-started-button {
  position: fixed;
  right: 15px;
  top: 15px;
  z-index: 102;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border-radius: 15px;
  backdrop-filter: blur(1rem);
  background: var(--fg);
  border: 1px solid var(--border);
  color: var(--bg);
  width: fit-content;
  height: 45px;
  cursor: pointer;
}

#get-started-button:hover {
  opacity: 0.7;
}

#board-filter{ width:calc(100%); max-width:500px; height:30px; position:absolute; top:50%; left:13px; transform:translateY(-50%); background:transparent; border:none; font-size:17.5px; font-weight:800; color:var(--fg); }


/* Basic styling for the button */
.google-signin-button {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* Slightly reduced space between logo and text */

  /* Box Model */
  padding: 10px 24px;
  border: 1px solid var(--border); /* Light grey border */
  border-radius: 15px;

  /* Typography */
  font-family: "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--bg); /* Google's standard dark grey text */

  /* Appearance */
  background-color: var(--fg); /* White background */
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;

  /* Remove default button styles */
  outline: none;
}

/* Style for the SVG logo */
.google-signin-button svg {
  width: 18px;
  height: 18px;
  /* filter: brightness(0%); */
}

/* Hover effect */
.google-signin-button:hover {
  background-color: var(--fg); /* Very light grey background on hover */
  opacity: 0.9;
  border-color: var(--border);
}

.legal-links a { color: var(--fg); text-decoration: none; margin: 0 6px; }

/* Active/press effect */
.google-signin-button:active {
  background-color: #f1f3f4;
  border-color: #c6c6c6;
}

@media (min-width: 900px) {

  .board-item {
    scale: 0.5;
    display: flex;
  }
  /* 1. This container makes the SVG span the entire screen */
  .connection-svg-overlay {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Lets you click "through" the SVG */
  }

  /* 2. This styles your path element */
  .connection-line {
    stroke: var(--border); /* Line color */
    stroke-width: 3px; /* 7px is very thick, 3px might look better */
    fill: none; /* Makes it just a line, no fill */
  }

  .connection-line:hover {
    stroke: var(--border); /* Line color */
    fill: none;
    cursor: default;
  }
}

#auth-container p {
  font-size: 1.1rem;
  color: var(--muted);
}

/* === Dashboard Layout === */
#dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px; /* Added padding for layout */
}

#dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  /* border-bottom: 1px solid var(--border); */
  margin-bottom: 24px;
}

#dashboard-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* === Buttons === */
#signout-btn {
  position: fixed;
  right: 70px;
  top: 15px;
  z-index: 1000;
  padding: 10px 15px;
}

.dash-btn {
  font-family: inherit;
  height:45px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-seethroug);
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  color: var(--fg);
  cursor: pointer;
}

.dash-btn:hover {
  border-color: var(--muted);
}

.dash-btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.dash-btn.primary:hover {
  opacity: 0.85;
}
.dash-btn.danger {
  background: transparent;
  color: #e55353;
  border-color: #e55353;
}
.dash-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#new-board-btn {
  min-height:180px;
  color:var(--fg);
  background: var(--bg-seethroug);
  border: 3px dashed var(--border);
}

#new-board-btn:hover {
  min-height:180px;
  color:var(--fg);
  background: var(--bg-alt);
  border: 3px dashed var(--border);
}

/* === Status Messages (Loading/Empty/Error) === */
#status-message {
  padding: 20px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
  display: flex;
  align-items:center;
  justify-content:center;
}

#status-message.hidden {
  display:none;
}

.skeleton-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: 145px; /* Matches min-height of real card */
  opacity: 0.5;
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
.error-message {
  color: #e55353;
  background: rgba(229, 83, 83, 0.1);
  border: 1px solid #e55353;
  border-radius: 10px;
  padding: 16px; /* Added padding */
}

/* === Board Grid === */
#board-grid{
  display:grid;
  grid-template-rows: repeat(auto-fill, minmax(150px, 1fr));
  gap:20px;
  align-content:start;
  margin-top: 50px;
  margin-bottom: 85px;
}

/* === NEW Card Styles === */
.board-card {
  background: var(--bg-seethroug);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start; /* Align main content and menu to top */
  justify-content: space-between;
  min-height: 80px;
  transition: all 0.2s ease;
}

.board-card:hover {
  background: var(--bg-alt);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--border);
}

/* Clickable main content */
.card-main{
  display:flex;
  flex-direction:column;
  min-height:100%;
  flex:1;
  text-align:left;
  background:transparent;
  border:none;
  padding:0;
  gap: 4px;
  cursor:pointer;
  color: inherit;
}

.card-title{
  font-size:20px;
  font-weight:900;
  color:var(--fg);
  margin:0 0 0 0;
  word-break: break-word;
}

/* 3-line clamped description */
.card-desc {
  /* margin:6px 0 12px; */
  height:fit-content;
  color:var(--muted);
  font-weight: 600;

  display:-webkit-box;
  justify-content:center;
  align-items: center;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;

  line-height:1.35;
  font-size:15px;
  margin-top:0px;
}

/* Footer pinned to bottom-left */
.card-footer{
  height:fit-content;
}
.card-date{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:14px;
  font-weight: 700;
}
.card-date svg{ flex-shrink:0; }
.card-date svg {
  flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Optional tag */
.card-tag {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Three-dots menu */
.card-more {
  position: relative;
  flex-shrink: 0;
}

.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 4px; /* A bit of padding */
  margin: -4px; /* Counteract padding to align */
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.more-btn:hover {
  background: var(--bg-seethroug); /* Use main bg for contrast on hover */
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  color: var(--fg);
}
.more-btn svg {
  width: 20px;
  height: 20px;
}

.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 140px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  z-index: 10;
  list-style: none;
  margin: 0;
}
.more-menu.hidden {
  display: none;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease;
}
.menu-item:hover {
  background: var(--bg-alt);
}
.menu-item.menu-delete {
  color: #e55353;
}
.menu-item.menu-delete:hover {
  background: rgba(229, 83, 83, 0.1);
}

/* === OLD Card Styles (Removed/Replaced) === */
/*
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto; 
}
.card-btn {
  font-size: 0.9rem;
  padding: 6px 12px;
}
*/
/* === Modal === */
#modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}
#modal-backdrop.hidden {
  display: none;
}

#modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}
#modal h2 {
  margin-top: 0;
}
#modal-title-input {
  width: calc(100% - 20px);
  padding: 10px;
  font-size: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 8px;
  margin-bottom: 20px;
}
#modal-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-actions-right {
  display: flex;
  gap: 10px;
}

/* Header inputs */
.dash-input, .dash-select {
  font: inherit;
  color: var(--fg);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 15px;
  font-weight: 800;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-width: 200px;
}
.dash-input:focus, .dash-select:focus {
  outline: none;
}
.dash-select {
  min-width: 180px;
}
@media (max-width: 780px) {
  .dash-input, .dash-select { min-width: 140px; }
}

#board-sort {
  display:none;
}

/* ==== Grid: denser masonry-like cards ==== */
#board-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap:20px;
  align-content:start;
}

/* Cards: a bit taller so they feel substantial */
.board-card{
  min-height:140px; padding:18px;
  border-radius:14px;
  background:var(--bg-seethroug);
  border:1px solid var(--border);
}

/* Three-dots stays subtle; ensure it doesn’t crowd */
.card-more .more-btn{ padding:6px; border-radius:8px; }

#dashboard-title {
  font-family: inherit;
  height:45px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-seethroug);
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  color: var(--fg);
  position: fixed;
  left: 15px;
  top: 15px;
  z-index: 1000;
  padding: 10px 20px;
  height:28px;
  display:flex;
  justify-content:center;
  align-items: center;
  z-index: 100;
}



#best-on-table-laptop {
  display: none;
}

@media (max-width:750px) {
  #best-on-table-laptop {
    width:100vw;
    height:auto;
    position:fixed;
    top:0px;
    left:0px;
    bottom:0px;
    right:0px;
    background:var(--bg);
    z-index: 200000;
    display:flex;
    justify-content:center;
    align-items:center;
  }

  @keyframes loadMobileText {
    0% {
      opacity: 0;
    }
    
    25% {
      opacity: 1;
    }

    75% {
      opacity: 0;
    }
    100% {
      opacity: 0;
    }
  }

  @keyframes showKeepText {
    0% {
      opacity: 0;
      margin-top:15px;
    }

    100% {
      opacity: 1;
      margin-top:0px;
    }
  }

  #best-on-table-laptop-text {
    font-size: 25px;
    font-weight: 800;
    color:var(--fg);
    width:calc(100vw - 50px);
    text-align:center;
    animation:loadMobileText 5s;
    opacity:0;
  }

  #best-on-table-laptop-final-text-section {
    width:calc(100vw - 50px);
    height:calc(100vh - 50px);
    position:fixed;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    display:flex;
    flex-direction: column;
    justify-content:space-evenly;
  }

  .section-text-container {
    font-size: 25px;
    font-weight: 800;
    margin-top: 15px;
    animation:showKeepText .5s forwards;
    /* opacity:0; */
  }

  .section-text-container:nth-child(1n) {
    font-size: 25px;
    font-weight: 800;
    margin-top: 15px;
    opacity:0;
    animation-delay:5.25s;
  }

  .section-text-container:nth-child(2n) {
    font-size: 25px;
    font-weight: 800;
    margin-top: 15px;
    animation-delay:5.5s;
    opacity:0;
  }


  .section-text-container:nth-child(3n) {
    font-size: 25px;
    font-weight: 800;
    margin-top: 15px;
    animation-delay:5.75s;
    opacity:0
  }
}