/* -------------------------------------------------------------
   LingoAfrica  – refined UI
-------------------------------------------------------------- */
:root{
  --bg:#FAF6F1;
  --card-bg:#f4e9d8;
  --earth:#8B572A;       /* burnt umber */
  --leaf:#1E6F4D;        /* deep green */
  --accent:#E07C12;      /* golden orange */
  --muted:#70695C;
  --hero-gold:#D9C28F;  
  --hero-orange:#F2A24C;
  --radius:22px;
  --shadow:0 4px 20px rgba(0,0,0,.08);
  font-family:"Inter",sans-serif;
  color-scheme:light;
}
*,*:before,*:after{box-sizing:border-box}

/* -----  Layout shell  ------------------------------------- */
body{
  margin:0;
  /* 1) fallback colour | 2) your hero image */
  background: var(--bg) url("../img/hero-bg1.png") center/cover fixed no-repeat;
  /* Optional dimming layer for text legibility (see step 3) */
  position: relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
body::before{
  content:"";
  position:absolute;
  inset:0;
  /* adds a faint warm tint instead of pure black */
  background:rgba(47,42,27,.55);
  z-index:-1;
  pointer-events:none;
}
header,footer{ text-align:center }
header{
  padding:2.5rem 1rem 1rem;
}
header h1{
  margin:0;
  font-size:clamp(1.8rem,3vw,2.4rem);
  color:var(--hero-gold);
  letter-spacing:-.5px;
}
header .tagline{ color:var(--hero-gold); opacity:.8; margin-top:.25rem }

main{   
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: calc(100vh - 5rem);}
.container{
  max-width:1520px;
  margin-inline:auto;
  padding:0 1rem 4rem;
}

/* -------------------------------------------------------
   NAVIGATION HEADER
-------------------------------------------------------- */
.site-header {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  padding: 0.9rem 0;              /* tighter height */
  margin-bottom: 2rem;
  color: #f4e9d8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* subtle bottom line */
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 2rem;
  width: 100%;             /* full width of header */
  max-width: none;         /* remove restriction */
  margin: 0 auto;   
}

.logo {
  font-size: 2.0rem;
  font-weight: 700;
  color: #f2c175;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.25px;
  line-height: 1.1;
}

.logo-img {
  height: 80px;          
  width: auto;
  border-radius: 6px;
  margin-right: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); 
}

.logo span {
  font-size: 1.5rem;
  vertical-align: middle;
}

.main-nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.main-nav a {
  color: #f4e9d8;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: #f2c175;
}

/* Card wrapper */
.card{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  background:var(--card-bg);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:3rem 2.5rem;
  animation: fadeInUp 0.8s ease-out;
}

/* -----  Selector grid  ------------------------------------ */
.selector{
  display:grid;
  gap:1rem 2rem;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  margin-bottom:1.5rem;
}
.selector label{
  font-weight:600;
  display:block;
  margin-bottom:.3rem;
}
.selector select{
  width:100%;
  padding:.5rem .8rem;
  border-radius:var(--radius);
  border:2px solid transparent;
  background:#F4F1EC;
  font-size:1rem;
  transition:border-color .2s;
}
.selector select:focus{
  outline:none;
  border-color:var(--accent);
}

/* -----  Panels  ------------------------------------------- */
.panels{
  display:grid;
  grid-template-columns:1fr 40px 1fr;
  align-items:start;
  gap:4rem;
  margin-bottom:2rem;
}
textarea{
  width:100%;
  min-height:18rem;
  resize:vertical;
  padding:1.5rem;
  border-radius:var(--radius);
  border:2px solid #E4E0DA;
  font-size:1.25rem;
  transition:box-shadow .2s,border-color .2s;
}
textarea:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(224,124,18,.25);
  border-color:var(--accent);
}
.arrow{
  font-size:1.8rem;
  color:var(--leaf);
  padding-top:.5rem;
  user-select:none;
}

/* -----  Buttons  ------------------------------------------ */
#translateBtn{
  display:block;
  margin:1.5rem auto;
  padding:1rem 4rem;
  font-size:1.15rem;
  border:none;
  border-radius:var(--radius);
  background:linear-gradient(135deg,var(--hero-orange) 80%,#FFB547 100%);
  color:#fff;
  cursor:pointer;
  transition:transform .15s,box-shadow .15s;
}
#translateBtn:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 18px rgba(224,124,18,.3);
}
#translateBtn:disabled{
  filter:grayscale(.6);
  cursor:wait;
  transform:none;
}

.share{
  display:flex;
  justify-content:center;
  gap:1rem;
}
.share button{
  all:unset;
  padding:.5rem .9rem;
  border:2px solid var(--leaf);
  border-radius:var(--radius);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:.4rem;
  font-size:.95rem;
  color:var(--leaf);
  transition:background .2s;
}
.share button:hover{ background:rgba(30,111,77,.1) }

/* -----  Footer  ------------------------------------------- */
.site-footer {
  background: rgba(0, 0, 0, 0.4);
  color: var(--hero-gold);
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 2rem;
  gap: 1rem;
}

.footer-left {
  flex-shrink: 0;
}

.footer-logo {
  height: 100px;   /* nice small logo */
  width: auto;
}

.footer-right {
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
}

.footer-right p {
  margin: 0;
  line-height: 1.5;
}

.site-footer a {
  color: var(--hero-orange);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Mobile tweak */
@media (max-width: 640px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-right {
    text-align: center;
  }
}


/* Toast */
#toast{
  position:fixed;
  bottom:1rem;
  left:50%;
  transform:translateX(-50%) translateY(100%);
  background:var(--hero-orange);
  color:#fff;
  padding:.6rem 1.2rem;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  opacity:0;
  pointer-events:none;
  transition:opacity .3s,transform .3s;
}
#toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
#funFact {
  margin-top: 2rem;
  text-align: center;
  font-size: 1rem;
  color: #130f0f;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive tweak */
@media (max-width:600px){
  .panels{ grid-template-columns:1fr }
  .arrow{ display:none }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: fadeInUp 0.8s ease-out;
}

form label {
  font-weight: 600;
  display: block;
  margin-top: 1rem;
}

form textarea, form select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 2px solid #ddd;
  font-size: 1rem;
  margin-top: 0.5rem;
  resize: vertical;
}

form button {
  margin-top: 2rem;
}

.action-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--hero-orange) 80%, #FFB547 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(224, 124, 18, 0.3);
}

.table-scroll {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid #000;
  border-radius: 12px;
}

/* Round the corners of the actual table too */
.table-scroll table {
  width: 100%;
  border-collapse: separate;  /* enable rounded corners */
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Define all table cell borders and appearance */
.table-scroll th,
.table-scroll td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #000;
  background-color: #fff;
}

/* Sticky headers with border */
.table-scroll thead th {
  background: #f4e9d8;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 2px solid #000;
}

/* Optional: add zebra stripes */
.table-scroll tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.action-button.danger {
  background: #c0392b;
}
.action-button.danger:hover {
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.3);
}

.flash {
  margin: 1rem 0;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease;
}

.flash.success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.flash.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}