﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* 
  Elegant Modern Theme:
  - Clean Soft Lavender-Slate Background: #f3f4f8
  - Regular Normal Font-Weights (No Heavy/Over-Bold Fonts)
  - Refined Colors & Smooth Shadows
  - High Readability & Clean Hierarchy
*/

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f8fafc;
  
  /* User Palette Exact Colors */
  --c-blue: #4285f4;
  --c-blue-hover: #3367d6;
  --c-red: #db4437;
  --c-red-hover: #c53929;
  --c-yellow: #f4b400;
  --c-yellow-hover: #e0a300;
  --c-green: #0f9d58;
  --c-green-hover: #0b8043;
  
  /* Primary Actions map to Palette Blue */
  --primary: var(--c-blue);
  --primary-hover: var(--c-blue-hover);
  --primary-light: #e8f0fe;
  
  /* Secondary / Accents */
  --accent: var(--c-yellow);
  --success: var(--c-green);
  --danger: var(--c-red);
  
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-light: #6b7280;
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;
  --border-hover: #94a3b8;
  --border-focus: var(--c-blue);
  
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 20px;
  
  --shadow-sm: 0 2px 6px rgba(100, 116, 139, 0.08);
  --shadow-md: 0 10px 25px rgba(100, 116, 139, 0.12);
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400; /* Normal weight across all elements */
  color: var(--text-main);
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Header & Navigation */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
}

.nav-wrap {
  max-width: 100%;
  margin: 0;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 500;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.logo-text span {
  color: var(--primary);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  background: var(--primary-light);
  color: var(--primary) !important;
}

/* Main Container */
main {
  flex: 1;
  margin: 0;
  padding: 1rem;
  width: 100%;
}

/* Hero Section */
.hero-box {
  text-align: left;
  margin-bottom: 1.5rem;
}

.hero-box h1 {
  font-size: 2.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #111827;
}

.hero-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 0 1.5rem 0;
}

/* Search Bar */
.search-bar-wrap {
  width: 50%;
  max-width: 540px;
  margin: 0 0 1.5rem 0;
  position: relative;
}

.search-bar-wrap input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: #111827;
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-bar-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-bar-wrap .s-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
  pointer-events: none;
}

/* Workstation Card */
.workstation {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  width: 70%;
  margin: 0 0 1.5rem 0; /* Left-aligned */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
}

/* Feature Tabs */
.feature-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  overflow-x: auto;
}

.f-tab {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
}

.f-tab:hover {
  background: #eef2ff;
  color: var(--primary);
}

.f-tab.active {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
}

/* Upload Dropzone */
.upload-zone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  padding: 3.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.upload-zone:hover, .upload-zone.dragover {
  background: #eef2ff;
  border-color: var(--primary);
}

.upload-icon {
  font-size: 3.2rem;
  color: var(--primary);
}

.upload-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
}

.upload-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.btn-upload {
  margin-top: 0.5rem;
  display: inline-block;
  padding: 10px 26px;
  background: var(--c-blue);
  color: #ffffff !important;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
}

.btn-upload:hover {
  background: var(--c-blue-hover);
}

/* File Badge Card */
.file-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
}

.file-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-thumb-mini {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #ffffff;
}

#loadedFileName {
  color: #111827 !important;
  font-weight: 600;
}

#loadedFileMeta {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
}

/* Multi-Tools Control Panel */
.multi-tools-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.opt-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-card label.heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dimension-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #111827;
  padding: 9px 12px;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: var(--transition);
}

.input-box:focus {
  border-color: var(--border-focus);
}

select.input-box {
  cursor: pointer;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-main);
  cursor: pointer;
  margin-top: 4px;
}

.check-row input[type="checkbox"] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.unit-selector {
  display: flex;
  gap: 6px;
}

.unit-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}
.unit-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}
.unit-btn.active {
  background: var(--c-blue) !important;
  color: #ffffff !important;
  border-color: var(--c-blue) !important;
  box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
}

.unit-btn.active, .unit-btn:hover {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover, .chip.active {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
}

.radio-group {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-main);
  cursor: pointer;
}

.radio-item input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Action Buttons */
.main-btn-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 0;
}

.btn-action-large {
  background: linear-gradient(135deg, #4285f4, #2563eb);
  color: #ffffff !important;
  border: none;
  padding: 14px 42px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
  letter-spacing: 0.3px;
}

.btn-action-large:hover {
  background: linear-gradient(135deg, #3367d6, #1d4ed8);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

/* Result & Live Preview Section */
.result-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.preview-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .preview-two-col {
    grid-template-columns: 1fr;
  }
}

.p-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.badge-tag {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.badge-green {
  background: #ecfdf5;
  color: var(--success);
}

.img-canvas-box {
  width: 100%;
  min-height: 220px;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.img-canvas-box img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

@keyframes downloadPulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(15, 157, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0); }
}

.btn-download-big {
  background: linear-gradient(135deg, #0f9d58, #0b8043);
  color: #ffffff !important;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  margin-top: 15px;
  animation: downloadPulse 2s infinite;
}

.btn-download-big:hover {
  background: linear-gradient(135deg, #0b8043, #085f31);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 157, 88, 0.3);
}

.btn-download-big svg {
  animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
  60% { transform: translateY(-2px); }
}

/* Categorized Tools Directory: Clean Light Cards, Normal Fonts */
.tool-category {
  margin-top: 3.5rem;
}

.cat-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111827;
}

.cat-heading::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 4px;
}

.tools-flex-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 2.5rem;
}

.tool-pill-link {
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.tool-pill-link:hover {
  border-color: var(--c-blue);
  color: var(--c-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(66, 133, 244, 0.3);
}

.tool-pill-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 2.25rem 1.25rem 1.5rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 100%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-inner h4 {
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-credits {
  max-width: 100%;
  margin: 1.5rem 0 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Toast */
#toastBox {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: #ffffff !important;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  display: none;
  z-index: 1000;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hidden {
  display: none !important;
}

/* ============================================================
   Mobile View & Tablet Responsive Optimization
   Desktop design unchanged. Fixes layout and header for mobile screens.
   ============================================================ */
@media (max-width: 992px) {
  .workstation {
    width: 90%;
  }

  .search-bar-wrap {
    width: 80%;
  }
}

@media (max-width: 768px) {
  /* Navigation & Header */
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
  }

  .logo-box {
    width: 100%;
    justify-content: flex-start;
  }

  .logo-icon {
    width: 44px;
    height: 38px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 4px;
  }

  .nav-links::-webkit-scrollbar {
    height: 3px;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
  }

  .nav-links a {
    font-size: 0.82rem;
    padding: 5px 10px;
    flex-shrink: 0;
  }

  /* Main Container & Hero */
  main {
    padding: 0.75rem;
  }

  .hero-box h1 {
    font-size: 1.55rem;
    line-height: 1.25;
  }

  .hero-box p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .search-bar-wrap {
    width: 100%;
    max-width: 100%;
  }

  .search-bar-wrap input {
    font-size: 0.9rem;
    padding: 10px 14px 10px 40px;
  }

  /* Workstation Card */
  .workstation {
    width: 100%;
    padding: 0.85rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
  }

  /* Feature Tabs Horizontal Scroll */
  .feature-tabs {
    gap: 6px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .f-tab {
    font-size: 0.82rem;
    padding: 6px 12px;
  }

  /* Upload Dropzone */
  .upload-zone {
    padding: 2rem 1rem;
    gap: 8px;
  }

  .upload-icon {
    font-size: 2.4rem;
  }

  .upload-title {
    font-size: 1.1rem;
  }

  .upload-desc {
    font-size: 0.82rem;
  }

  .btn-upload {
    padding: 9px 20px;
    font-size: 0.88rem;
  }

  /* Panels & Inputs */
  .multi-tools-panel {
    grid-template-columns: 1fr;
    padding: 0.85rem;
    gap: 1rem;
  }

  .opt-card {
    grid-column: span 1 !important;
  }

  .dimension-inputs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dimension-inputs .input-box {
    min-width: 80px;
  }

  .input-box {
    font-size: 0.9rem;
    padding: 8px 10px;
  }

  .chip-group {
    gap: 5px;
  }

  .chip {
    font-size: 0.78rem;
    padding: 4px 9px;
  }

  .btn-action-large {
  background: linear-gradient(135deg, #4285f4, #2563eb);
  color: #ffffff !important;
  border: none;
  padding: 14px 42px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
  letter-spacing: 0.3px;
}

  .btn-download-big {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.95rem;
  }

  /* Tool Directory Cards Grid */
  .tools-flex-wrap {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 2rem;
  }

  .tool-pill-link {
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.tool-pill-link:hover {
  border-color: var(--c-blue);
  color: var(--c-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(66, 133, 244, 0.3);
}

  .cat-heading {
    font-size: 1.15rem;
  }

  /* Footer */
  footer {
    padding: 1.5rem 0.85rem 1rem 0.85rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.25rem;
  }

  .footer-credits {
    flex-direction: column;
    gap: 8px;
    text-align: left;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .tools-flex-wrap {
    grid-template-columns: 1fr;
  }

  .hero-box h1 {
    font-size: 1.38rem;
  }

  .logo-text {
    font-size: 1rem;
  }
}



.f-input:focus, .f-select:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.15);
  background: #ffffff;
}

* { transition: background-color 0.15s ease, border-color 0.15s ease; }

h1, h2, h3, h4, h5, h6 {
  color: #0f172a;
  letter-spacing: -0.025em;
  font-weight: 700;
}