/* ==========================================
   Global Reset & CSS Variables
   ========================================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #0f172a;
    --accent-color: #10b981;
    --accent-hover: #059669;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #93c5fd;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ==========================================
   Header & Navigation
   ========================================== */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo .logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
}

/* ==========================================
   Main Layout & Container
   ========================================== */
.main-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

/* ==========================================
   Tool Section & Card Design
   ========================================== */
.tool-section {
    margin-bottom: 3rem;
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ==========================================
   Drag 'n' Drop Upload Zone
   ========================================== */
.upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-normal);
}

.upload-box:hover,
.upload-box.drag-active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.03);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.browse-btn {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

/* ==========================================
   Controls Grid & Inputs
   ========================================== */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.control-group {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.control-group h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-field input[type="number"] {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition-fast);
}

.input-field input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
}

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

/* Range Slider */
.slider {
    width: 100%;
    accent-color: var(--primary-color);
    cursor: pointer;
    margin-top: 0.5rem;
}

/* Preset Buttons */
.preset-buttons {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.preset-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    width: 100%;
    margin-bottom: 0.2rem;
}

.preset-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ==========================================
   Action & Download Buttons
   ========================================== */
.action-wrapper {
    margin-top: 2rem;
    text-align: center;
}

.primary-btn {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.85rem 2.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================
   Preview Grid & Cards
   ========================================== */
.preview-container {
    margin-top: 2rem;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.preview-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-box.highlight-box {
    background: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.preview-box h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.image-wrapper {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    overflow: hidden;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-info strong {
    color: var(--accent-color);
    font-size: 0.95rem;
}

.download-btn {
    display: block;
    background: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: background var(--transition-fast);
}

.download-btn:hover {
    background: var(--accent-hover);
    color: #ffffff;
}

/* ==========================================
   SEO & Guide Content Styling
   ========================================== */
.content-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 3rem 2.5rem;
}

.content-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.content-header h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    line-height: 1.3;
}

.meta-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.content-block {
    margin-bottom: 2.5rem;
}

.content-block h3 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 0.85rem;
}

.content-block p {
    color: #334155;
    margin-bottom: 1rem;
    font-size: 0.98rem;
}

.guide-steps {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.guide-steps li {
    margin-bottom: 0.75rem;
    color: #334155;
}

/* Responsive Table Styling */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.spec-table th {
    background: #f1f5f9;
    color: var(--secondary-color);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.spec-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.spec-table tbody tr:last-child td {
    border-bottom: none;
}

.spec-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* FAQ Accordion Styling */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.faq-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.faq-item h4 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.faq-item p {
    margin-bottom: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* ==========================================
   Footer
   ========================================== */
.site-footer {
    background: var(--secondary-color);
    color: #cbd5e1;
    margin-top: auto;
    padding: 3rem 0 1.5rem 0;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-about h3,
.footer-links h4,
.footer-legal h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-about p {
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-links ul,
.footer-legal ul {
    list-style: none;
}

.footer-links li,
.footer-legal li {
    margin-bottom: 0.5rem;
}

.footer-links a,
.footer-legal a {
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-links a:hover,
.footer-legal a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
}

/* ==========================================
   Mobile Responsiveness (Media Queries)
   ========================================== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-list {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }

    .tool-card {
        padding: 1.5rem 1rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .content-section {
        padding: 1.75rem 1.25rem;
    }

    .content-header h2 {
        font-size: 1.35rem;
    }

    .input-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .preset-buttons {
        justify-content: flex-start;
    }

    .primary-btn {
        width: 100%;
        padding: 0.85rem 1rem;
    }
}

/* Hero Search & Dropdown Styling */
.hero-search-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 60px 20px 70px 20px;
  color: #ffffff;
  text-align: center;
  border-bottom: 1px solid #334155;
}

.hero-search-container {
  max-width: 850px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #94a3b8;
  margin-bottom: 35px;
}

/* Search Box Wrapper */
.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  gap: 8px;
  max-width: 780px;
  margin: 0 auto;
}

/* Category Dropdown Styling */
.category-dropdown-container {
  flex: 0 0 180px;
}

.category-select {
  width: 100%;
  padding: 12px 10px;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #334155;
  font-weight: 600;
  background-color: transparent;
  cursor: pointer;
}

.search-divider {
  width: 1px;
  height: 30px;
  background-color: #cbd5e1;
}

/* Search Input Styling */
.search-input-container {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
  position: relative;
}

.search-icon {
  font-size: 1.1rem;
  margin-right: 8px;
  opacity: 0.6;
}

.search-input-container input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #0f172a;
  background: transparent;
}

.search-input-container input::placeholder {
  color: #94a3b8;
}

.clear-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 5px;
}

.search-btn {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-btn:hover {
  background-color: #1d4ed8;
}

/* Dropdown Results List */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  border: 1px solid #e2e8f0;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  text-align: left;
}

.search-results-dropdown ul {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}

.search-results-dropdown li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}

.search-results-dropdown li:last-child a {
  border-bottom: none;
}

.search-results-dropdown li a:hover {
  background-color: #f8fafc;
  color: #2563eb;
}

.tool-badge {
  font-size: 0.75rem;
  background: #e0e7ff;
  color: #3730a3;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Responsive adjust for mobile screens */
@media (max-width: 680px) {
  .search-box-wrapper {
    flex-direction: column;
    padding: 12px;
  }
  .category-dropdown-container {
    width: 100%;
    flex: none;
  }
  .search-divider {
    display: none;
  }
  .search-input-container {
    width: 100%;
    padding: 10px 0;
  }
  .search-btn {
    width: 100%;
  }
}