/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f0f0 !important;
  color: #333;
  line-height: 1.6;
}

/* Header */
.header {
  background-color: #fff;
  width: 100%;
  margin: 0px;
  border-bottom: 2px solid #cfd6ce;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-menu {
  background-color: #fff;
  overflow: hidden;
  margin: 0px auto;
  width: 100%;
  max-width: 1200px;
  color: #555;
}

/* Side Navigation */
.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: 18px;
  color: #222222;
  display: block;
  transition: 0.3s;
  text-align: left;
}

.sidenav a:hover {
  color: #2a80b9;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

.logo {
  color: #2aa1a9;
}

/* Navigation Strip */
.scroll-ribbon {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px;
  gap: 15px;
  scrollbar-width: thin;
  border-bottom: 1px solid #e5e5e5;
  background-color: #fff;
  max-width: 1100px;
  margin: 10px auto;
}

.scroll-ribbon::-webkit-scrollbar {
  height: 6px;
}

.scroll-ribbon::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.scroll-ribbon a {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: #e6e6e6;
  color: #333;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.scroll-ribbon a:hover {
  background: #d0d0d0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1 {
  font-size: 20px;
  color: #222;
  margin-bottom: 20px;
  padding-bottom: 10px;
}

h2 {
  font-size: 20px;
  color: #333;
  margin: 30px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
}

/* Input */
textarea {
  width: 100%;
  height: 100px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: "Noto Sans Malayalam", sans-serif;
  margin-bottom: 15px;
}

/* Controls Wrapper */
.controls-wrapper {
  width: 100%;
  transition: all 0.3s ease;
}

.controls-wrapper.fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999999;
  background-color: #fff;
  padding: 10px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Controls */
.controls {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 15px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
  max-width: 1000px;
  margin: 0 auto;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #555;
  white-space: nowrap;
  font-weight: 500;
}

.controls input[type="color"] {
  width: 28px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.controls input[type="range"] {
  width: 150px;
}

/* Font Grid */
#font-grid {
  margin-bottom: 25px;
  gap: 20px;
  margin-top: 20px;
}

/* Font Card */
.font-card {
  background: #fff;
  border: 1.5px solid #e5e5e5;
  overflow: hidden;
  transition: box-shadow 0.3s;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
}

.font-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Font Header - NAME OUTSIDE */
.font-header {
  padding: 0 0 8px 0;
  background: transparent;
  border-bottom: none;
  font-weight: 700;
  color: #333;
  margin-bottom: -5px;
}

.font-name {
  color: #333;
  font-size: 16px;
  font-weight: 700;
}

/* Font Preview - FIXED FOR MOBILE */
.font-preview {
  padding: 30px 15px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 48px;
  background: #fff;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.no-text {
  color: #999;
  font-style: italic;
  font-size: 16px;
  font-family: sans-serif;
}

/* Download buttons */
.download-buttons {
  padding: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  background: transparent;
  border-top: none;
}

.download-btn {
  padding: 8px 16px;
  background: #808080;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.download-btn:hover {
  background: #333;
}

/* General Buttons */
button {
  padding: 5px 10px;
  margin: 2px;
  cursor: pointer;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
}

button:hover {
  background-color: #e0e0e0;
}

/* Pagination */
.pagination {
  text-align: center;
  margin: 40px 0 20px;
}

.pagination button {
  padding: 8px 14px;
  margin: 0 4px;
  background: #fff;
  color: #2aa1a9;
  border: 1px solid #2aa1a9;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover,
.pagination button.active {
  background: #2aa1a9;
  color: #fff;
}

/* Footer */
.site-footer {
  background-color: #333;
  color: #ecf0f1;
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-content h3,
.footer-content h4 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-left p {
  max-width: 300px;
  font-size: 0.95em;
  line-height: 1.6;
  margin-top: 10px;
}

.footer-links ul,
.footer-social ul {
  list-style: none;
  padding: 0;
}

.footer-links ul li,
.footer-social ul li {
  margin-bottom: 8px;
}

.footer-links ul li a,
.footer-social ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links ul li a:hover,
.footer-social ul li a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #34495e;
  color: #95a5a6;
}

/* FAQ Items */
.faq-item {
  background: #f9f9f9;
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 8px;
  border-left: 4px solid #333;
}

.faq-item h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 16px;
}

.faq-item p {
  margin: 0;
  line-height: 1.6;
  color: #666;
}

/* Loading States */
.font-card.font-loading {
  opacity: 0.7;
}

.font-card.font-failed {
  opacity: 0.5;
}

.font-status {
  font-size: 11px;
  margin-left: 5px;
  color: #666;
}

/* Simple overflow fix */
html,
body {
  overflow-x: hidden;
}

/* Mobile Responsive */
@media screen and (max-height: 450px) {
  .sidenav {
    padding-top: 15px;
  }
  .sidenav a {
    font-size: 16px;
  }
}
@media (max-width: 768px) {
  .container {
    margin: 10px auto;
    padding: 15px;
    width: 100%;
  }
  .controls {
    gap: 10px;
    padding: 8px 10px;
  }
  .controls input[type="range"] {
    width: 120px;
  }
  .font-preview {
    font-size: 32px;
    padding: 20px 10px;
    min-height: 100px;
    width: 100%;
    max-width: 100%;
  }
  .download-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 20px;
  }
  .controls-wrapper.fixed {
    padding: 8px 0;
  }
  .controls-wrapper.fixed .controls {
    padding: 6px 8px;
    gap: 8px;
  }
  .controls-wrapper.fixed label {
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .font-preview {
    font-size: 24px;
    padding: 16px 10px;
    min-height: 80px;
    width: 100%;
    max-width: 100%;
  }
  h1 {
    font-size: 18px;
  }
  .scroll-ribbon {
    padding: 5px;
    gap: 8px;
  }
  .scroll-ribbon a {
    padding: 6px 12px;
    font-size: 13px;
  }
  .download-buttons {
    gap: 6px;
    padding: 10px;
  }
  .controls {
    gap: 8px;
  }
  .controls label {
    font-size: 13px;
  }
  .controls input[type="range"] {
    width: 100px;
  }
  .font-name {
    font-size: 14px;
  }
}
@media (max-width: 360px) {
  .font-preview {
    font-size: 20px;
    padding: 12px 6px;
    width: 100%;
    max-width: 100%;
  }
  .controls input[type="range"] {
    width: 80px;
  }
}