/* Global reset-ish */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f8ff; /* soft sky */
  color: #0f172a;      /* dark blue-gray */
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------------- HEADER ---------------- */

.site-header {
  background: linear-gradient(90deg, #0f4c81, #1d8fe3); /* blue gradient */
  color: #f9fafb;
  border-bottom: 3px solid #fbbf24; /* golden */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
}

.logo-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  color: #fefce8;
}

.logo-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15); /* golden tint */
  border: 1px solid rgba(251, 191, 36, 0.6);
}

.logo-text {
  letter-spacing: 0.03em;
}

.logo-tagline {
  font-size: 12px;
  color: #e5f1ff;
}

.primary-nav {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.nav-link {
  padding: 6px 10px;
  border-radius: 999px;
  color: #e5f1ff;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.12);
}

.nav-active {
  background: #fbbf24;
  color: #111827;
  border-color: rgba(17, 24, 39, 0.2);
}

/* ------------- SUB BAR (All / Popular / Category) ------------- */

.sub-bar {
  background: #0b2640;
  border-top: 1px solid rgba(15, 23, 42, 0.4);
}

.sub-bar-inner {
  display: flex;
  gap: 18px;
  padding: 6px 0;
  font-size: 13px;
  overflow-x: auto;
}

.sub-link {
  color: #cbd5f5;
  white-space: nowrap;
  position: relative;
  padding-bottom: 2px;
}

.sub-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #facc15;
  transition: width 0.15s ease;
}

.sub-link:hover {
  color: #facc15;
}

.sub-link:hover::after {
  width: 100%;
}

/* ---------------- MAIN CONTENT ---------------- */

.page-content {
  padding: 20px 0 32px;
}

/* Hero section */

.hero {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 18px 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
  color: #0f172a;
}

.hero p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
}

/* Sections */

.section-block {
  margin-top: 24px;
}

.section-block h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.section-intro {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 14px;
}

/* --------------- TOOLS LIST --------------- */

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.tool-row.small {
  padding: 8px 10px;
}

.tool-row:hover {
  border-color: #0f4c81;
  box-shadow: 0 3px 10px rgba(15, 76, 129, 0.18);
}

.tool-row:active {
  transform: scale(0.99);
}

.tool-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.tool-main {
  flex: 1;
}

.tool-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.tool-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
}

.tool-cat {
  padding: 1px 6px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.tool-label {
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  border: 1px solid #facc15;
}

/* --------------- CATEGORIES --------------- */

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0f172a;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.category-pill:hover {
  background: #fbbf24;
  border-color: #f59e0b;
}

.category-pill:active {
  transform: scale(0.98);
}

/* --------------- BREADCRUMBS --------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 10px;
  color: #6b7280;
}

.breadcrumb a {
  color: #2563eb;
}

/* --------------- TOOL PAGE --------------- */

.tool-page {
  margin-top: 10px;
}

.tool-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.tool-header-icon {
  font-size: 28px;
}

.tool-subtitle {
  font-size: 13px;
  color: #4b5563;
}

.tool-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  margin-bottom: 20px;
  font-size: 14px;
}

/* Article text for tool pages */

.tool-article {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 16px 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.05);
  font-size: 14px;
}

.tool-article h2 {
  font-size: 18px;
  margin-top: 10px;
}

.tool-article h3 {
  font-size: 15px;
  margin-top: 10px;
}

/* --------------- FOOTER --------------- */

/* FOOTER (COMPACT VERSION) */
.site-footer {
  background: #0c284c;
  color: #e6eef8;
  padding: 16px 14px 10px;  /* ↓ MAIN HEIGHT CONTROL */
  margin-top: 25px;
}

.footer-container {
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px; /* ↓ Space between columns */
  justify-content: space-between;
}

.footer-column {
  flex: 1;
  min-width: 160px; /* ↓ Smaller column width */
}

.footer-title {
  font-size: 18px;  /* ↓ Smaller text */
  color: #ffd54a;
  margin-bottom: 3px;  /* ↓ Less space below title */
  font-weight: 700;
}

.footer-about {
  font-size: 13px;
  line-height: 1.4; /* ↓ Reduced line spacing */
  opacity: 0.9;
}

.footer-subtitle {
  font-size: 14px;
  color: #ffce3d;
  margin-bottom: 4px; /* ↓ Less space */
  font-weight: 600;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 3px;  /* ↓ Less space between links */
}

.footer-links a {
  color: #d9e6ff;
  text-decoration: none;
  font-size: 13px;
  transition: 0.3s;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Footer bottom */
.footer-bottom {
  text-align: center;
  margin-top: 12px;  /* ↓ Reduce top gap */
  padding-top: 6px;  /* ↓ Less padding */
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;  
  opacity: 0.8;
}

/* MOBILE VIEW COMPACT */
@media (max-width: 720px) {
  .footer-container {
    flex-direction: column;
    gap: 10px;
  }

  .footer-column {
    margin-bottom: 4px; /* ↓ Less spacing */
  }

  .footer-title {
    font-size: 16px; /* ↓ Smaller mobile heading */
  }

  .footer-links a {
    font-size: 13px;
  }

  .footer-bottom {
    font-size: 11px;
  }
}

/* --------------- SMALL UTILITY THINGS --------------- */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #0f172a;
  color: #e5e7eb;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 12px;
}

/* Hover/active micro animations */
.hero,
.tool-box,
.tool-article {
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.hero:hover,
.tool-box:hover,
.tool-article:hover {
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.08);
}

/* --------------- MOBILE RESPONSIVE (max 720px) --------------- */

@media (max-width: 720px) {

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .primary-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 13px;
  }

  .sub-bar-inner {
    padding: 6px 0 8px;
    font-size: 12px;
  }

  .hero {
    padding: 14px 12px 16px;
    border-radius: 12px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .hero p {
    font-size: 13px;
  }

  .tool-row {
    padding: 9px 10px;
    border-radius: 9px;
  }

  .tool-title {
    font-size: 13px;
  }

  .tool-meta {
    font-size: 10px;
  }

  .tool-article {
    padding: 14px 12px 18px;
    font-size: 13px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 10px;
  }

  .footer-col {
    width: 100%;
    flex: 1 1 auto;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
/* Shared styles for all image tools UIs */
.tool-ui-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 14px 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    margin-top: 10px;
}

.tool-ui-header {
    margin-bottom: 10px;
    font-size: 14px;
    color: #0f172a;
}

.tool-ui-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: flex-start;
}

.tool-ui-column {
    font-size: 14px;
}

.tool-label {
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.tool-input-file {
    width: 100%;
    padding: 7px 6px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13px;
}

.tool-hint {
    font-size: 12px;
    margin-top: 6px;
    color: #64748b;
}

.tool-btn-primary,
.tool-btn-secondary {
    display: inline-block;
    border-radius: 999px;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
}

.tool-btn-primary {
    background: linear-gradient(90deg, #0b4d9a, #1aa1e6);
    color: #ffffff;
}

.tool-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-btn-secondary {
    background: #0c284c;
    color: #ffffff;
}

.tool-status {
    margin-top: 8px;
    font-size: 13px;
}

.tool-status-info {
    color: #0369a1;
}

.tool-status-success {
    color: #15803d;
}

.tool-status-error {
    color: #b91c1c;
}

.preview-block {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 10px 12px;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.preview-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.preview-item h4 {
    font-size: 13px;
    margin-bottom: 4px;
}

.preview-box {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #dbeafe;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
}

.preview-placeholder {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

@media (max-width: 800px) {
    .tool-ui-grid {
        grid-template-columns: 1fr;
    }
    .preview-inner {
        grid-template-columns: 1fr;
    }
}