:root {
  --bg:#f7fafc;
  --card:#ffffff;
  --accent:#0f172a;
  --muted:#475569;
  --accent-2:#1f2937;
  --radius:12px;
  --maxw:900px;
  --gradient: linear-gradient(135deg,#111827,#0ea5a9);
  font-family: Inter, "Noto Sans Sinhala", "Noto Sans", "Segoe UI", Roboto, system-ui, -apple-system, "Segoe UI Emoji", "Helvetica", Arial, sans-serif;
}
html,body{
  height:100%;
  margin:0;
  background:var(--bg);
  color:var(--accent-2);
}
/* ✅ HEADER with Gradient */
.header {
  background: var(--gradient);
  width: 100%;
  margin: 0;
  border-bottom: 2px solid #cfd6ce;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
.main-menu {
  background: var(--gradient);
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}
a.logo { color: #0ea5a9; text-decoration:none; }
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  background-color: #fafafa;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
}
.sidenav a, .sidenav h3 {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 20px;
  color: #222;
  display: block;
  transition: 0.3s;
}
.sidenav a:hover { color: #0ea5a9; }
.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
}
.wrap{
  max-width:var(--maxw);
  margin:36px auto;
  padding:24px;
}
header.page-header{
  display:flex;
  gap:18px;
  align-items:center;
  margin-bottom:20px;
}
.logo-box {
  width:72px;
  height:72px;
  background:var(--gradient);
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  font-weight:700;
  font-size:20px;
  box-shadow:0 6px 18px rgba(2,6,23,0.12);
}
img {
  width: 100%;
  max-width: 1000px;
  margin: 0px auto;
  border: 0px;
}
.container1 {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
}
.container {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
}
h1 {
  color: #2a80b9;
  font-size: 20px;
  color: #222;
}
a.logo {
  color: #28A745;
}
a.logo:hover{color:#28A745; }

body {
  font-family: sans-serif;
  background: #f4f4f4;
  padding: 0px;
}
.section {
  background: #fff;
  border: 0px solid #28a745;
  padding: 15px;
  border-radius: 10px;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
}
.section h2 {
  color: #222;
  margin: -15px -15px 15px;
  padding: 10px 15px;
}
.font-controls, .typing-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  justify-content: center;
}
input[type="text"], textarea {
  flex: 1;
  padding: 10px;
  font-size: 18px;
  min-width: 200px;
}
select, input[type="color"], button {
  padding: 6px 10px;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  margin:5px;
}
button:hover {
  background: #eee;
}
button.active {
  background: #28a745;
  color: white;
}
.font-preview-wrapper {
  margin-bottom: 20px;
}
.preview-item {
  background: #fff;
  padding: 10px;
  border-radius: 0px;
  border: 1px solid #ccc;
  direction: ltr;
  text-align: center;
  min-height: 300px;
}
.font-name {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
  direction: ltr;
  text-align: left;
}
.font-text {
  display: inline-block;
  padding: 80px 0;
  line-height: 1.2;
  width: calc(100% - 20px);
  box-sizing: border-box;
}
.button-group {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  justify-content: flex-end;
}
.button-group button {
  font-size: 16px;
  padding: 5px 10px;
  background:#E0E0E0;
  color: #222;
}
.color-controls {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.color-controls input[type="color"],
.color-controls button {
  margin: 5px;
}
@media (max-width: 768px) {
  .font-controls, .typing-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .font-controls > div {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .color-controls {
    flex-direction: row;
    justify-content: space-around;
    gap: 5px;
  }
  .color-controls input[type="color"],
  .color-controls button {
    flex: 1;
    min-width: 60px;
  }
  input[type="text"], textarea {
    min-width: unset;
    width: 100%;
  }
  .button-group {
    flex-direction: row;
    gap: 3px;
    justify-content: center;
  }
  .main-menu {
    padding: 0.5rem;
  }
  .main-menu a:first-child {
    font-size: 18px;
  }
}
@media (max-width: 480px) {
  .section {
    padding: 10px;
    margin: 10px;
  }
  .preview-item {
    min-height: 200px;
    padding: 5px;
  }
  .font-text {
    padding: 40px 0;
  }
  .color-controls {
    flex-direction: column;
    align-items: center;
  }
  .font-controls .color-controls {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }
}
/* ✅ FOOTER with White Text */
.site-footer {
  background: var(--gradient);
  color: #ffffff;
  padding: 40px 20px 20px;
  font-family: 'Segoe UI', sans-serif;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  max-width: 1100px;
  margin: auto;
}
.footer-content h3,
.footer-content h4,
.footer-left p,
.footer-links a,
.footer-social a,
.footer-links ul li,
.footer-social li {
  color: #ffffff !important;
}
.footer-links ul, .footer-social li { list-style: none; padding: 0; }
.footer-links a, .footer-social a {
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.footer-links a:hover, .footer-social a:hover {
  opacity: 1;
  text-decoration: underline;
  color: #fff;
}
.footer-bottom {
  text-align: center;
  margin-top: 30px;
  font-size: 0.9em;
  color: #ffffff !important;
  border-top: 1px solid rgba(255,255,255,0.3);
  padding-top: 15px;
}
.footer-bottom p {
  color: #ffffff !important;
  margin: 0;
}
a{ color:#0f172a; text-decoration:none; font-weight:600; }
.pagination {
  text-align: center;
  margin:30px auto;
  font-family: sans-serif;
}
.pagination a {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 4px;
  text-decoration: none;
  color: #222;
  border: 1px solid #222;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.pagination a:hover {
  background-color: #E0E0E0;
  color: #222;
  text-decoration: none;
}
.pagination a.active {
  background-color: #E0E0E0;
  color: #222;
  pointer-events: none;
  cursor: default;
}
/* -------------------------------------------------
   1. GLOBAL RESET & MOBILE-FIRST FOUNDATION
   ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin:0; padding:0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: Inter, "Noto Sans Sinhala", "Noto Sans", system-ui, sans-serif;
  background: var(--bg, #f7fafc);
  color: var(--accent-2, #1f2937);
  line-height: 1.5;
}
/* Fluid typography */
h1 { font-size: clamp(1.8rem, 5vw, 2.2rem); }
h2 { font-size: clamp(1.5rem, 4vw, 1.8rem); }
p, input, button, select { font-size: clamp(0.95rem, 2.5vw, 1rem); }
/* -------------------------------------------------
   2. LAYOUT CONTAINERS
   ------------------------------------------------- */
.container,
.wrap,
.section,
.container1 {
  width: min(100% - 2rem, var(--maxw, 1200px));
  margin-inline: auto;
  padding: 1rem;
}
@media (min-width: 640px) { .container, .container1, .section { padding: 1.5rem; } }
@media (min-width: 1024px){ .container, .container1, .section { padding: 2rem; } }
/* -------------------------------------------------
   3. HEADER & SIDEBAR
   ------------------------------------------------- */
.header {
  background: var(--gradient, linear-gradient(135deg,#111827,#0ea5a9));
  color:#fff;
}
.main-menu {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0.75rem 1rem;
  max-width: var(--maxw,1200px);
  margin:auto;
}
.main-menu a.logo {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  color:#0ea5a9;
  text-decoration:none;
}
.menu-toggle {
  font-size:1.8rem;
  cursor:pointer;
  padding:0.25rem;
}
/* Sidebar */
.sidenav {
  height:100%; width:0; position:fixed; top:0; left:0;
  background:#fafafa; overflow-x:hidden; transition:width .4s;
  padding-top:4rem; z-index:99999;
}
.sidenav.open { width: min(80vw, 300px); }
.sidenav a, .sidenav h3 {
  padding:0.75rem 1rem 0.75rem 2rem;
  display:block; font-size:1.1rem;
}
.sidenav .closebtn {
  position:absolute; top:0.5rem; right:1rem; font-size:2rem;
}
/* -------------------------------------------------
   5. PREVIEW GRID
   ------------------------------------------------- */
#previews {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
@media (min-width: 480px) { #previews { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 768px) { #previews { grid-template-columns: repeat(3,1fr); } }
.font-preview-wrapper {
  background:#fff;
  border:1px solid #ddd;
  border-radius:8px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.font-name {
  padding:0.5rem 0.75rem;
  font-size:0.85rem;
  background:#f8f9fa;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-weight: bold;
}
.preview-box {
  flex-grow:1;
  padding:1rem;
  text-align:center;
  direction:ltr;
  min-height:250px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: white;
  border: 1px solid #e0e0e0;
  margin: 10px;
  border-radius: 4px;
}
.button-group {
  display:flex;
  gap:0.4rem;
  padding:0.5rem;
  justify-content:center;
  flex-wrap:wrap;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}
.button-group button {
  font-size:0.85rem;
  padding:0.35rem 0.6rem;
  background: #e0e0e0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
}
.button-group button:hover {
  background: #d0d0d0;
}
/* -------------------------------------------------
   6. PAGINATION & FOOTER
   ------------------------------------------------- */
.pagination {
  display:flex;
  flex-wrap:wrap;
  gap:0.4rem;
  justify-content:center;
  margin:2rem 0;
}
.pagination a {
  min-width:2.2rem;
  padding:0.4rem 0.6rem;
  text-align:center;
  border:1px solid #222;
  border-radius:4px;
}
/* Footer stays full-width */
.site-footer {
  background:var(--gradient);
  color:#fff;
  padding:2rem 1rem;
}
.footer-content {
  display:flex;
  flex-wrap:wrap;
  gap:2rem;
  max-width:var(--maxw,1200px);
  margin:auto;
}
.footer-content > div { flex:1 1 200px; }
/* -------------------------------------------------
   7. IMAGES & MEDIA
   ------------------------------------------------- */
img, picture, canvas {
  max-width:100%;
  height:auto;
  display:block;
}
/* -------------------------------------------------
   8. UTILITIES (optional)
   ------------------------------------------------- */
.text-center { text-align:center; }
.mt-1 { margin-top:0.5rem; }
.mt-2 { margin-top:1rem; }
@media (max-width: 768px) {
  #previews {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .preview-box {
    min-height: 200px;
    padding: 0.5rem;
    margin: 5px;
  }
  .button-group {
    gap: 0.2rem;
  }
  .button-group button {
    min-width: 70px;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
  .footer-content {
    gap: 1rem;
  }
  .footer-content > div {
    flex: 1 1 100%;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .container, .container1, .section {
    padding: 0.5rem;
    margin: 0.5rem;
  }
  .pagination a {
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
  }
}
h1, h2, h3 {
  color: #2c3e50;
}
ul {
  padding-left: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-x: auto;
  display: block;
}
table, th, td {
  border: 1px solid #ccc;
}
th, td {
  padding: 10px;
  text-align: left;
}
.highlight {
  background-color: #f9f9f9;
  border-left: 5px solid #007bff;
  padding: 10px;
  margin: 20px 0;
}
#how-to-use, #faq {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}
#how-to-use ol, #faq ul {
  list-style: none;
  padding: 0;
}
#how-to-use ol li, #faq ul li {
  margin-bottom: 20px;
  background: #ffffff;
  border: 1px solid #e3f2fd;
  border-left: 4px solid #2196f3;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#how-to-use ol li h4, #faq ul li h4 {
  margin: 0 0 10px 0;
  color: #1976d2;
  font-size: 1.1em;
  font-weight: bold;
}
#how-to-use ol li p, #faq ul li p {
  margin: 0;
  color: #333;
  line-height: 1.6;
  text-align: justify;
}