/* Global Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  color: #333;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #9333ea);
  flex-wrap: wrap; /* allows wrapping for mobile */
}

.logo a {
  font-size: 22px;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  justify-self:start;   /* stick left */
}

/* Basic menu layout */
.header-container {
  display:grid;
  grid-template-columns: 1fr auto 1fr;  /* left, center, right */
  align-items:center;
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
}

/* Center the main nav horizontally between logo and right side */
.main-nav {
  justify-self:center;
}

.header-right {
  justify-self:end;     /* stick right (empty for now) */
}


/* Menu items */
.main-nav .menu {
  list-style:none;
  display:flex;
  gap:24px;
  margin:0;
  padding:0;
}

/* Top-level menu links */
.main-nav .menu > li > a {
  text-decoration:none;
  color:#fff;           /* white on gradient header */
  font-weight:500;
  padding:8px 12px;
  transition:color .2s;
}

.main-nav .menu > li > a:hover {
  color:#e0e7ff;        /* lighter hover */
}

/* Submenu dropdown */
.submenu {
  display:none;
  position:absolute;
  top:100%;
  left:0;
  background:#fff;      /* white background */
  border-radius:8px;
  box-shadow:0 8px 16px rgba(0,0,0,0.1);
  min-width:200px;
  padding:10px 0;
  z-index:1000;
}

/* Submenu links (dark text on white) */
.submenu li a {
  display:block;
  padding:8px 16px;
  color:#1f2937;        /* dark text */
  text-decoration:none;
  white-space:nowrap;
}

.submenu li a:hover {
  background:#f3f4f6;
}

/* Show submenu on hover */
.has-submenu:hover > .submenu {
  display:block;
}



/* Menu */
.menu {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.menu > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}

/* Every submenu (nested <ul>) */
.menu ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  padding: 8px 0;
  z-index: 100;

  /* animation setup */
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

/* Submenu links */
.menu ul ul li a {
  color: #374151;
  font-size: 14px;
  padding: 10px 16px;
}

.menu ul ul li a:hover {
  background: #f3f4f6;
  color: #2563eb;
}

/* Show submenu only on hover */
.menu li:hover > ul {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.menu ul li {
  position: relative;
}

.menu a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

/* Active page highlight */
.menu a.active {
  background: rgba(255,255,255,0.25);
  font-weight: 600;
}

/* Hover effect */
.menu a:hover {
  background: rgba(255,255,255,0.2);
}

/* Submenu */
.submenu {
  display: none;               /* hidden by default */
  position: absolute;          /* relative to parent li */
  top: 100%;                   /* appear below parent */
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  padding: 8px 0;
  z-index: 100;
}

.submenu li {
  display: block;
}

.submenu li a {
  display: block;
  padding: 10px 16px;
  color: #374151;
  font-size: 14px;
}

.submenu li a:hover {
  background: #f3f4f6;
  color: #2563eb;
}

/* Show submenu on hover */
.dropdown:hover .submenu {
  display: block;
}


/* --- RESPONSIVE --- */
.hamburger {
  display: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

@media (max-width: 768px) {
  .menu {
    width: 100%;
    display: none; /* hidden by default */
    flex-direction: column;
    background: linear-gradient(90deg, #06b6d4, #3b82f6, #9333ea);
    padding: 10px 0;
  }

  .menu > ul {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .menu ul ul {
    position: static; /* submenu inline in mobile */
    box-shadow: none;
    background: rgba(255,255,255,0.1);
    border: none;
    opacity: 1;
    transform: none;
    display: none;
    width: 100%;
  }

  .menu li:hover > ul {
    display: block;
  }

  .hamburger {
    display: block;
  }
}


/* Intro */
.intro {
  text-align: center;
  padding: 60px 20px 30px;
}
.intro h1 {
  font-size: 32px;
  margin-bottom: 10px;
}
.intro p {
  font-size: 18px;
  color: #555;
}

/* Tool Grid */
/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.tool-card {
  background: linear-gradient(135deg, #ffffff, #f9fafb); /* Light base */
  border-radius: 16px;
  text-align: center;
  padding: 30px 20px;
  text-decoration: none;
  color: #111827;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

/* Add gradient accent strip */
.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #9333ea);
  border-radius: 16px 16px 0 0;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(59,130,246,0.25);
}

.tool-card img {
  width: 64px;
  height: 64px;
  margin: 20px auto;
  display: block;
}

.tool-card h2 {
  font-size: 18px;
  margin: 0;
  color: #1f2937;
}

/* Subtle hover text glow */
.tool-card:hover h2 {
  color: #2563eb;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  color: white;
  margin-top: 40px;
}



/* Tool Page */
.tool-page {
  padding: 40px 20px;
  display: flex;
  justify-content: center;
}

/* Tool Page Layout */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px; /* content + ads */
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.tool-container {
  width: 100%;
  max-width: 900px;
}

.tool-container h1 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #1f2937;
}

.tool-container .intro {
  color: #4b5563;
  margin-bottom: 20px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 30px 20px;
  min-height: 120px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.dropzone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.dropzone strong {
  font-size: 15px;
  color: #1f2937;
}

.dropzone small {
  color: #6b7280;
  font-size: 13px;
}
.dropzone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* Settings */
.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /*align-items: flex-end;*/
}
.setting {
  flex: 1;
  min-width: 180px;
}
.setting label {
  font-size: 14px;
  color: #374151;
}
.setting input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-top: 6px;
}

/* Preview */
.preview .image-preview {
  min-height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  margin-bottom: 16px;
}
.preview img {
  max-width: 100%;
  border-radius: 8px;
}

/* Stats */
.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stat {
  background: #f9fafb;
  flex: 1;
  min-width: 120px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}
.stat small {
  display: block;
  color: #6b7280;
  font-size: 12px;
}
.stat strong {
  display: block;
  font-size: 16px;
  margin-top: 6px;
}

/* Buttons */
.btn {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.btn:hover {
  opacity: 0.9;
}


/* Ad SPace in image compression */
/* Ads Sidebar */
.ads-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ad-box p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr; /* stack vertically */
  }
  .ads-sidebar {
    order: 2; /* ads go below tool */
  }
}


/* How to Use Section */
.how-to {
  margin-top: 30px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 16px;
}

.step-card {
  background: linear-gradient(135deg,#06b6d4,#3b82f6,#9333ea);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.step-card:hover {
  transform: translateY(-4px);
}

.step-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.step-card p {
  font-size: 14px;
  margin: 0;
  line-height: 1.4;
}
