/* =============================================
   EIDOS — CSS
   Palette: #F7F4ED / #13293D / #2A7F7F / #C26D4F
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --cream:    #F7F4ED;
  --navy:     #13293D;
  --teal:     #2A7F7F;
  --copper:   #C26D4F;
  --text-dark:#0F1F2E;
  --text-mid: #4A4A4A;
  --text-light:#8A8A7A;
  --white:    #FFFFFF;
  --border:   #DDD8CC;
  --shadow:   0 2px 20px rgba(19,41,61,0.08);
  --shadow-lg:0 8px 40px rgba(19,41,61,0.14);
  --radius:   6px;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.7;
  direction: rtl;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  color: var(--navy);
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--copper); }

/* ---- NAVBAR ---- */
#navbar {
  background: var(--navy);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 2px;
}
.nav-logo span { color: var(--copper); }

.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* Guest nav */
#nav-guest { display: flex; gap: 0.75rem; align-items: center; }
#nav-user  { display: none; align-items: center; gap: 1rem; }

.nav-username {
  color: var(--cream);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.nav-username:hover { color: var(--copper); border-color: var(--copper); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover { background: #236b6b; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(42,127,127,0.3); }

.btn-copper {
  background: var(--copper);
  color: var(--white);
}
.btn-copper:hover { background: #a85a3e; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1.5px solid rgba(247,244,237,0.4);
}
.btn-outline:hover { border-color: var(--cream); background: rgba(247,244,237,0.08); }

.btn-outline-navy {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline-navy:hover { background: var(--navy); color: var(--cream); }

.btn-danger {
  background: #c0392b;
  color: #fff;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}
.btn-danger:hover { background: #a93226; }

.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.82rem; }

/* ---- HERO ---- */
#hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a52 60%, #0d2233 100%);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(42,127,127,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 30%, rgba(194,109,79,0.1) 0%, transparent 50%);
}

.hero-content { position: relative; z-index: 1; max-width: 680px; }

.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--cream);
  margin-bottom: 1.2rem;
  line-height: 1.2;
}
.hero-title em { font-style: italic; color: var(--teal); }

.hero-sub {
  color: rgba(247,244,237,0.7);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* ---- MAIN CONTENT ---- */
#main { padding: 3rem 2rem; max-width: 1100px; margin: 0 auto; }

/* Sort bar */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.sort-tabs { display: flex; gap: 0.5rem; }
.sort-tab {
  padding: 0.45rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.sort-tab.active, .sort-tab:hover {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

/* ---- IDEA CARDS ---- */
#ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.idea-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.idea-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.idea-domain-tag {
  display: inline-block;
  background: rgba(42,127,127,0.1);
  color: var(--teal);
  border: 1px solid rgba(42,127,127,0.25);
  border-radius: 50px;
  font-size: 0.75rem;
  padding: 0.2rem 0.75rem;
  font-weight: 500;
  width: fit-content;
}

.idea-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 600;
}

.idea-card-desc {
  font-size: 0.88rem;
  color: var(--text-mid);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-light);
}

.idea-card-author { font-weight: 500; color: var(--teal); }
.idea-card-author:hover { color: var(--copper); }

.like-count { display: flex; align-items: center; gap: 0.3rem; }

/* ---- MODAL OVERLAY ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,31,46,0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--cream);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 1;
}

.modal-header h2 { font-size: 1.3rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-mid);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--copper); }

.modal-body { padding: 1.5rem; }

/* ---- AUTH FORMS ---- */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-mid);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.auth-tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.auth-form { display: none; }
.auth-form.active { display: block; }

/* ---- FORM FIELDS ---- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}
.form-group label .req { color: var(--copper); margin-right: 2px; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,127,127,0.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }

.form-error {
  color: #c0392b;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* Section divider in idea form */
.form-section {
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.form-section h3 {
  font-size: 0.95rem;
  color: var(--navy);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-section h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--teal);
  border-radius: 2px;
}

.form-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* ---- IDEA DETAIL MODAL ---- */
.idea-detail-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.idea-detail-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.idea-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-light);
}

.idea-section-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 1.2rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.idea-field { margin-bottom: 0.8rem; font-size: 0.9rem; }
.idea-field-label { font-weight: 500; color: var(--text-mid); font-size: 0.82rem; }
.idea-field-value { color: var(--text-dark); margin-top: 0.2rem; }

/* Like & Comment bar */
.idea-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.like-btn.liked, .like-btn:hover { background: rgba(42,127,127,0.1); border-color: var(--teal); color: var(--teal); }

/* Comments */
.comments-section { padding: 1rem 1.5rem 1.5rem; }
.comments-section h4 { font-size: 0.95rem; margin-bottom: 1rem; }

.comment-item {
  padding: 0.75rem;
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}
.comment-author { font-weight: 600; color: var(--teal); font-size: 0.82rem; margin-bottom: 0.25rem; }

.comment-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.comment-input-row input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  direction: rtl;
}
.comment-input-row input:focus { outline: none; border-color: var(--teal); }

/* ---- PROFILE PAGE ---- */
#profile-page { display: none; padding: 2rem; max-width: 900px; margin: 0 auto; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--copper);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.profile-info h2 { font-size: 1.4rem; }
.profile-info p { color: var(--text-light); font-size: 0.85rem; margin-top: 0.2rem; }

.profile-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

/* ---- FOOTER ---- */
#footer {
  background: var(--navy);
  color: rgba(247,244,237,0.75);
  padding: 3rem 2rem 2rem;
  margin-top: 5rem;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(247,244,237,0.12);
}

.footer-section h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.75rem;
}

.footer-section p, .footer-section a {
  font-size: 0.85rem;
  line-height: 1.9;
  color: rgba(247,244,237,0.65);
}
.footer-section a:hover { color: var(--cream); }

.footer-bottom {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(247,244,237,0.4);
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--cream);
  letter-spacing: 2px;
}
.footer-logo span { color: var(--copper); }

/* ---- TOAST ---- */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy);
  color: var(--cream);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: transform 0.3s ease;
  border-right: 3px solid var(--teal);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { border-right-color: var(--copper); }

/* ---- ADMIN BADGE ---- */
.admin-badge {
  background: var(--copper);
  color: var(--white);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---- LOADING ---- */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; }

/* ---- DEMO BANNER ---- */
#demo-banner {
  background: var(--copper);
  color: var(--white);
  text-align: center;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1001;
}
#demo-banner b { font-weight: 700; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  #navbar { padding: 0 1rem; }
  #main { padding: 2rem 1rem; }
  #ideas-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.8rem; }
  .modal-box { max-height: 95vh; }
  .footer-grid { grid-template-columns: 1fr; }
  .sort-bar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
