@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

:root{
  --footer-height: 120px;
}

/* Page layout */
body {
  font-family: 'Cairo', sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #e8faff, #d0e7ff);
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* make room for fixed footer */
main, .container {
  padding-bottom: calc(var(--footer-height) + 30px);
}

/* container card */
.container {
  background: rgba(255,255,255,0.75);
  width: 90%;
  max-width: 980px;
  border-radius: 18px;
  margin-top: 28px;
  box-shadow: 0 12px 40px rgba(9,30,66,0.08);
  padding: 28px;
}

/* header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lion { width: 78px; height: 78px; }
.title { text-align: center; flex: 1; }
.title h1 { margin: 0; color: #0078d7; font-size: 1.9rem; }
.title p { margin: 6px 0 0; color: #4a4a4a; }

/* input/output areas */
.input-area, .output-area {
  margin-top: 22px;
}
textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  border: none;
  padding: 14px;
  font-size: 1rem;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
  resize: vertical;
  background: rgba(255,255,255,0.95);
  direction: auto;
}
.buttons { display:flex; gap:12px; margin-top:12px; }
button {
  flex:1;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg,#0078d7,#00a1ff);
  color: #fff;
  font-weight: 700;
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
button:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,120,215,0.18); }
.note { margin-top:10px; color:#444; font-size:0.92rem; }

/* output area style */
.output-area { margin-top:18px; }

/* fixed footer containing explanation boxes */
.explain-section{
width: 100%;
  position: relative;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 18px;
  align-items: center;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(230,240,255,0.9));
  box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
  z-index: 80;
}

/* explain boxes */
.explain-box {
  width: 360px;
  max-width: calc(50% - 30px);
  background: #f0f7ff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 6px 18px rgba(8,80,155,0.06);
  cursor: pointer;
  transition: transform .18s ease;
  text-align: center;
}
.explain-box:hover { transform: translateY(-6px); }

/* modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.45);
  z-index: 200;
  overflow: auto;
}
.modal-content {
  background: #fff;
  margin: 48px auto;
  max-width: 920px;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.modal .modal-body { max-height: 65vh; overflow: auto; padding-right: 8px; line-height: 1.6; }
.modal .close { float:right; font-size:26px; cursor:pointer; color:#333; }

/* responsive */
@media (max-width: 860px){
  .explain-box { width: 45%; }
}
@media (max-width: 560px){
  .explain-box { width: 92%; }
  .container { padding-bottom: calc(var(--footer-height) + 20px); }
}