/* styles.css - Eastern Shore Auction visual system
   Coastal dark theme with Mobile Bay-inspired palette and subtle texture. */

/* CSS variables for a consistent palette and spacing */
:root {
  --bay-blue: #0b1f2a;
  --marsh-green: #2f4f3f;
  --dock-wood: #8b6f47;
  --fog-gray: #cbd5e1;
  --sunset-amber: #f59e0b;
  --ink: #e6edf3;
  --ink-muted: rgba(230, 237, 243, 0.7);
  --card-bg: #122a36;
  --card-border: rgba(203, 213, 225, 0.12);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
}

/* Base reset for predictable layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body styling with dusk-water gradient */
body {
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(47, 79, 63, 0.35), transparent 60%),
    radial-gradient(900px 400px at 80% 10%, rgba(245, 158, 11, 0.18), transparent 55%),
    linear-gradient(160deg, #081821 0%, #0b1f2a 40%, #0e2530 100%);
  min-height: 100vh;
}

/* Shared page container */
.container {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

/* Header styles */
.header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.header-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav-links a[aria-current="page"] {
  border-color: rgba(245, 158, 11, 0.6);
}

.nav-links a:hover {
  border-color: rgba(203, 213, 225, 0.6);
}

.header h1 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 2vw + 1.6rem, 3.4rem);
  letter-spacing: 0.02em;
}

.header p {
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.header .location-line {
  font-size: 0.95rem;
  color: rgba(203, 213, 225, 0.85);
}

/* Auction grid layout */
.auction-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  justify-items: center;
}

@media (min-width: 700px) {
  .auction-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    justify-items: center;
  }
}
}

/* Auth panel */
.auth-card {
  margin-bottom: 2rem;
  background: rgba(18, 42, 54, 0.92);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 1rem;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-header h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
}

.auth-status {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.auth-fields {
  display: grid;
  gap: 0.5rem;
}

.auth-fields input {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
  font-size: 0.95rem;
}

.auth-actions {
  display: grid;
  gap: 0.75rem;
}

.auth-actions button {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(245, 158, 11, 0.12);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.auth-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.5);
}

/* Auction card styles */
.auction-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(18, 42, 54, 0.98), rgba(14, 35, 46, 0.92));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  width: 100%;
}

.auction-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.35);
}

.auction-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(203, 213, 225, 0.1);
}

.auction-card .card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.auction-card .card-title {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Detail page layout */
.detail-layout {
  display: grid;
  gap: 1.75rem;
  margin-top: 12px;
}

.detail-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

.image-carousel {
  position: relative;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.6);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.carousel-btn.prev {
  left: 12px;
}

.carousel-btn.next {
  right: 12px;
}

.carousel-btn.is-hidden {
  display: none;
}

.detail-card {
  background: rgba(18, 42, 54, 0.95);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 1rem;
}

/* Account profile layout */
.profile-layout {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.profile-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.25);
  background: rgba(6, 18, 25, 0.5);
  display: grid;
  place-items: center;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info {
  display: grid;
  gap: 0.4rem;
  color: var(--ink-muted);
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.profile-meta {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.profile-form {
  display: grid;
  gap: 0.65rem;
}

.profile-form input,
.profile-form textarea {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
  font-size: 0.95rem;
}

.profile-form select {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
  font-size: 0.95rem;
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.edit-toggle {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(47, 79, 63, 0.3);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.link-button {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(47, 79, 63, 0.3);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.profile-form button {
  margin-top: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(120deg, #f59e0b, #f1b24a);
  color: #1a1405;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.quick-time {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(47, 79, 63, 0.25);
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
}

.quick-time.is-active {
  background: rgba(47, 120, 77, 0.6);
  border-color: rgba(140, 255, 196, 0.5);
  color: #e8fff2;
}

.profile-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.detail-card h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
}

.detail-meta {
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.lot-line {
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.lot-timer {
  color: var(--sunset-amber);
  font-size: 1.35rem;
  font-weight: 600;
}

.lot-timer.flash {
  color: #57d890;
}

.live-badge {
  color: #ff4d4d;
  font-weight: 700;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.35; }
  100% { opacity: 1; }
}

.flash-edit {
  display: grid;
  gap: 0.5rem;
}

.flash-edit input {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
}

.seller-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-muted);
}

.email-seller {
  color: var(--sunset-amber);
  text-decoration: none;
  font-weight: 600;
}

[data-account-rating] {
  color: var(--sunset-amber);
  font-weight: 600;
  cursor: pointer;
}

.chat-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 33, 0.55);
  border: 1px solid rgba(203, 213, 225, 0.1);
}

.chat-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}

.chat-list li {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 18, 25, 0.6);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.chat-form {
  display: grid;
  gap: 0.5rem;
}

.chat-form input {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
}

.chat-form button {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(245, 158, 11, 0.2);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 14, 0.75);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal-card {
  width: min(92vw, 520px);
  background: rgba(18, 42, 54, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.8rem;
}

.modal-card h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
}

.modal-gif {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(203, 213, 225, 0.1);
}

.modal-card button {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(120deg, #f59e0b, #f1b24a);
  color: #1a1405;
  font-weight: 600;
  cursor: pointer;
}

.modal-card button + button {
  background: rgba(203, 213, 225, 0.2);
  color: var(--ink);
}

/* Account tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.account-table th,
.account-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(203, 213, 225, 0.1);
  color: var(--ink-muted);
}

.account-table th {
  color: var(--ink);
  font-weight: 600;
}

.guidelines {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  color: var(--ink-muted);
}

.guidelines li {
  padding-left: 0.2rem;
}

.bid-highlight {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1rem;
}

.bid-highlight strong {
  font-size: 1.4rem;
  color: var(--sunset-amber);
}

/* Bid history list */
.bid-history {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.bid-history li {
  background: rgba(8, 24, 33, 0.65);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(203, 213, 225, 0.1);
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* Bid form */
.bid-form {
  display: grid;
  gap: 0.75rem;
}

.bid-form input {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.2);
  background: rgba(6, 18, 25, 0.7);
  color: var(--ink);
  font-size: 1rem;
}

.bid-form button {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(120deg, #f59e0b, #f1b24a);
  color: #1a1405;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bid-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.notice {
  padding: 0.75rem 0.9rem;
  background: rgba(47, 79, 63, 0.4);
  border-radius: var(--radius-sm);
  color: #dfe9e3;
  border: 1px solid rgba(203, 213, 225, 0.12);
}

/* Footer styling */
.footer {
  margin-top: 3rem;
  border-top: 1px solid rgba(203, 213, 225, 0.1);
  padding: 1.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.4rem;
}

/* Utility for conditional UI */
.is-hidden {
  display: none !important;
}

/* Responsive breakpoints for larger screens */
@media (min-width: 720px) {
  .auction-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auction-card {
    flex-direction: column;
    align-items: stretch;
  }

  .auction-card img {
    width: 100%;
    height: 210px;
  }

  .auth-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .header-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .profile-layout {
    grid-template-columns: auto 1fr;
  }

  .detail-layout {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }

  .detail-image {
    height: 420px;
  }
}

@media (min-width: 1024px) {
  .auction-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Index sections */
.section-header {
  margin: 2rem 0 1rem;
  display: grid;
  gap: 0.3rem;
}

.section-header h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
}

.section-header p {
  color: var(--ink-muted);
}
