/* ======================================================
   assets/styles.css
   Main stylesheet for Marouane Tools (merged + footer + pages)
   - Supports dark mode via .dark on body
   - Footer, header, page-content, home-button styles added
   - Keep comments for easier reading
   ====================================================== */

/* ---------- Root theme variables ---------- */
:root {
  --bg: #f5f7fb;
  --card: #fff;
  --muted: #6b7280;
  --text: #0b1220;
  --accent: #06b6d4;
  --glass: rgba(11, 18, 32, 0.04);
  --radius: 12px;
  --maxw: 1200px;
  --shadow: 0 8px 30px rgba(16, 24, 40, 0.06);

  /* footer/page colors */
  --bg-secondary: rgba(6, 182, 212, 0.03);
  --text-primary: var(--text);
  --text-link: var(--accent);
  --accent-color: #7c3aed;
  --border-color: rgba(0, 0, 0, 0.06);
}

/* Dark theme overrides */
.dark {
  --bg: #071026;
  --card: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  --muted: #94a3b8;
  --text: #e6eef6;
  --accent: #06b6d4;
  --glass: rgba(255, 255, 255, 0.03);
  --shadow: 0 8px 36px rgba(2, 6, 23, 0.6);

  --bg-secondary: rgba(255, 255, 255, 0.02);
  --text-primary: #e6eef6;
  --text-link: #7dd3fc;
  --border-color: rgba(255, 255, 255, 0.04);
}

/* --------- base reset & layout --------- */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
body {
  background: radial-gradient(
      1200px 400px at 10% 10%,
      rgba(6, 182, 212, 0.04),
      transparent
    ),
    var(--bg);
  color: var(--text);
  padding: 28px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}
.wrap {
  width: 100%;
  max-width: var(--maxw);
}

/* header (original look) */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #052022;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.08);
}
.logo .fa-solid {
  font-size: 30px;
  color: #dadbdc;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
}
.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* controls / theme toggle */
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 576px) {
  .controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: column;
  }
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.switch {
  width: 48px;
  height: 28px;
  background: var(--glass);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}
.knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.12);
}
.switch.light .knob {
  transform: translateX(20px);
}

/* tabs */
nav.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.tab.active {
  background: linear-gradient(
    90deg,
    rgba(6, 182, 212, 0.12),
    rgba(124, 58, 237, 0.08)
  );
  color: var(--text);
  box-shadow: 0 10px 26px rgba(6, 182, 212, 0.04);
  border: none;
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .side {
    order: 2;
  }
  nav.tabs {
    justify-content: flex-start;
    overflow: auto;
    padding-bottom: 8px;
  }
}

/* cards and tools */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.tool-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.tool-title h2 {
  margin: 0;
  font-size: 16px;
}
.tool-desc {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 13px;
}

/* form elements */
textarea,
input[type="text"],
input[type="date"],
select,
input[type="number"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
textarea {
  min-height: 120px;
  resize: vertical;
}

/* buttons */
.btn {
  background: var(--accent);
  border: none;
  color: #052022;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.btn:active {
  background-color: #06b6d4;
  padding: 8px 10px;
}
.btn:hover {
  color: #c1c1c3;
}

/* utility */
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.small {
  font-size: 13px;
  color: var(--muted);
}

/* stats */

/* stats */
.stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.stat {
  background: var(--glass);
  padding: 10px;
  border-radius: 10px;
  min-width: 110px;
  text-align: center;
}
.stat .n {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* result box */
.result-box {
  background: rgba(0, 0, 0, 0.03);
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
}

/* preview area */
.preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}
.preview img {
  max-width: 110px;
  max-height: 90px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.file-info {
  font-size: 13px;
  color: var(--muted);
}

/* footer base (new unified footer) - dark gray variant */
.site-footer {
  background-color: #1f2937; /* dark gray background as requested */
  color: var(--text-primary);
  text-align: center;
  padding: 28px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.3s, color 0.3s;
}
body.dark .site-footer {
  background-color: #111827; /* slightly darker in dark mode */
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.footer-text {
  font-size: 14px;
  opacity: 0.85;
  color: #9ca3af;
}

/* contact form tweaks for dark */
.contact-section {
  max-width: 700px;
  margin: 40px auto;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.contact-form .form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.contact-form label {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  padding: 12px;
  font-size: 15px;
  border: 1px solid #e1e4ea;
  border-radius: var(--radius);
  outline: none;
  background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}
body.dark .contact-section {
  background: #1e293b;
}
body.dark .contact-form input,
body.dark .contact-form textarea {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
}
body.dark .contact-form input::placeholder,
body.dark .contact-form textarea::placeholder {
  color: #64748b;
}
body.dark .contact-form label {
  color: #cbd5e1;
}
body.dark .btn-accent {
  background: var(--accent);
  color: #fff;
}

/* spinner */
.loader {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: rotation 1s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* hidden helper */
.hidden {
  display: none !important;
}

/* ===== Page layout for about/services/privacy pages ===== */
/* header for subpages - container removed because index keeps a complex header */
.main-header {
  text-align: center;
  padding: 28px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

/* big page container */
.page-content {
  padding: 28px 18px;
  max-width: 900px;
  margin: 0 auto 30px;
  color: var(--text-primary);
}
.content-section h2 {
  color: var(--accent);
  margin-bottom: 12px;
}
.content-section p,
.content-section li {
  line-height: 1.7;
  font-size: 16px;
  opacity: 0.95;
}
.content-section ul {
  padding-left: 20px;
  margin-bottom: 20px;
}

/* ========== Home button in header for subpages ========== */
/* this button is part of subpage header */
.home-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--card);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  transition: transform 0.12s, opacity 0.12s ,background-color 0.4s;
}
.home-button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
  background-color: var(--accent);
}
body.dark .home-button {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text);
}

/* small responsive tweaks */
@media (max-width: 600px) {
  .footer-links {
    gap: 12px;
    flex-wrap: wrap;
  }
  .home-button {
    padding: 8px 10px;
    font-size: 14px;
  }
}


#toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.toast {
  opacity: 0;
  transform: translateY(20px);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
}
.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.toast.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

