/* filename: assets/css/styles.css */

/* Reset & base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: #111827;
    background-color: #f3f4f6;
}

body {
    margin: 0;
}

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

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 520px) {
  .container { padding: 0 1rem; }
}

/* Header & navigation */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
}

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

.logo-text .dotcom {
    color: #4b5563;
    font-weight: 500;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
}

.nav-link {
    text-decoration: none;
    color: #374151;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
}

.nav-link:hover {
    background: #e5e7eb;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

/* Hero */

.hero {
    padding: 2.75rem 0 2.25rem;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr);
    gap: 2.5rem;
    align-items: flex-start; /* keep left and right aligned to the top */
}

/* prevent the growing Popular tools list from pushing the hero extremely tall */
.hero-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.4rem 1.3rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    max-height: 440px;
    overflow-y: auto;
}

.hero-text h1 {
    font-size: clamp(2.25rem, 3.2vw, 3rem);
    margin: 0 0 0.75rem;
}

.hero-text p {
    margin: 0 0 1.25rem;
    color: #4b5563;
    max-width: 32rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hero-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #4b5563;
}

.hero-bullets li {
    margin-bottom: 0.25rem;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.96rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #ec4899;
    color: #ffffff;
}

.btn-primary:hover {
    background: #db2777;
}

.btn-secondary {
    background: #020617;
    color: #f9fafb;
}

.btn-secondary:hover {
    background: #000000;
}

.btn-full {
    width: 100%;
    margin-top: 0.75rem;
}

/* Hero side card */



/* Popular tools list */

.tool-list {
    display: grid;
    gap: 0.8rem;
}

.tool-card {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    background: #f9fafb;
    transition:
        border-color 0.12s ease-out,
        background-color 0.12s ease-out,
        box-shadow 0.12s ease-out,
        transform 0.08s ease-out;
}

.tool-card:hover,
.tool-card.active {
    border-color: #10b981;
    background: #e6fdf4;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.20);
    transform: translateY(-1px);
}

.tool-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Ad section */

.ad-section {
    padding: 0.5rem 0 2.25rem;
}

.ad-slot {
    border-radius: 0.75rem;
    border: 1px dashed #d1d5db;
    padding: 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
}

/* Feature grid */

.feature-grid-section {
    padding: 0 0 2.5rem;
}

.feature-grid-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.feature-item {
    background: #ffffff;
    padding: 1.1rem;
    border-radius: 0.9rem;
    border: 1px solid #e5e7eb;
}

.feature-item h3 {
    margin-top: 0;
}

.more-tools-section {
    padding: 0 0 2.75rem;
}

.more-tools-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.more-tools-section p {
    text-align: center;
    color: #4b5563;
    margin-bottom: 1rem;
}

.tool-pill-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.tool-pill {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 0.85rem;
    color: #374151;
}

/* Tool pages */

.tool-hero {
    padding: 1.75rem 0 0.75rem;
}

.tool-hero h1 {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.7rem;
}

.tool-hero p {
    margin: 0;
    color: #4b5563;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #4b5563;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.tool-layout {
    padding: 0.75rem 0 2.5rem;
}

.tool-layout-inner {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1.2fr);
    gap: 1.75rem;
}

/* Upload box & form */

.upload-box {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.tool-form {
    display: block;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    border: 2px dashed #d1d5db;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    background: #f9fafb;
    margin-bottom: 0.75rem;
}

.upload-label strong {
    margin-bottom: 0.15rem;
}

.upload-label span {
    font-size: 0.9rem;
    color: #6b7280;
}

.tool-form input[type="file"] {
    display: none;
}

.file-list {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Options & notes */

.tool-options {
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
}

.checkbox-label,
.radio-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: #374151;
}

.checkbox-label input,
.radio-row input {
    margin-top: 0.15rem;
}

.tool-options label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: #374151;
}

.tool-options input[type="number"],
.tool-options input[type="password"],
.tool-options input[type="text"],
.tool-options select {
    width: 100%;
    padding: 0.38rem 0.55rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    margin-top: 0.15rem;
    font-size: 0.9rem;
}

.tool-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* SEO copy block */

.tool-seo-copy {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: #374151;
}

.tool-seo-copy h2 {
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

/* Sidebar */

.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-slot-sticky {
    position: sticky;
    top: 4.25rem;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 0.9rem;
    border: 1px solid #e5e7eb;
    padding: 0.9rem;
    font-size: 0.9rem;
}

/* Footer */

.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 1.1rem 0 1.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-meta a {
    color: #4b5563;
    text-decoration: none;
}

.footer-meta a:hover {
    text-decoration: underline;
}

/* Responsive */

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .tool-layout-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-slot-sticky {
        position: static;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 56px;
        right: 0;
        background: #ffffff;
        border-bottom-left-radius: 0.75rem;
        border-left: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        min-width: 180px;
    }

    .site-nav.nav-open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }
}


/* Drag/drop highlight */
.upload-label.is-dragover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

/* File list actions */
.file-item {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.file-item em { font-style: normal; }

.file-remove {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: .7;
}
.file-remove:hover { opacity: 1; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.3);
}

.btn-small {
  padding: .4rem .7rem;
  font-size: .9rem;
}

/* Simple form fields */
.field-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:12px;
}
.field-label{
  display:block;
  font-weight:600;
  margin-top:12px;
}
.field-input, .field-select{
  width:100%;
  margin-top:6px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: inherit;
}
.field-input:focus, .field-select:focus{
  outline:none;
  border-color: rgba(34,197,94,0.65);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* Selected files list */
.file-table{
  width:100%;
  border-collapse: collapse;
  margin-top: 12px;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
}
.file-table th, .file-table td{
  padding: 10px 12px;
  text-align:left;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  vertical-align: middle;
}
.file-table th{
  font-weight: 700;
  opacity: 0.9;
  background: rgba(255,255,255,0.04);
}
.file-table tr:last-child td{
  border-bottom:none;
}
.outname-input{
  width:100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: inherit;
}

/* Single output filename row (used by Merge). */
.output-name{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.output-name input{
  flex:1 1 260px;
}
.upload-box.is-dragover .upload-label{
  outline: 2px dashed rgba(34,197,94,0.65);
  outline-offset: 6px;
}


/* Compress PDF UI font normalization */

.pdf-tool-card,
.pdf-tool-card * {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.pdf-tool-card select {
  font-size: 15px;
  padding: 6px 10px;
  line-height: 1.4;
}

/* Split PDF thumbnails */
.split-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 12px;
}
.split-actions .btn{ padding: 8px 10px; font-size: 14px; }

.pw-thumb-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  max-height: 360px;
  overflow:auto;
}

@media (min-width: 1100px){
  .pw-thumb-grid{ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 420px; }
}

.pw-thumb{
  position: relative;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 12px;
  overflow:hidden;
  cursor:pointer;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.06);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}
.pw-thumb:hover{ transform: translateY(-1px); box-shadow: 0 6px 18px rgba(2,6,23,0.10); }
.pw-thumb.selected{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), 0 6px 18px rgba(2,6,23,0.10); }

.pw-thumb-badge,
.pw-thumb-order{
  position:absolute;
  top:8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  background: rgba(15,23,42,0.85);
  color: #fff;
  user-select:none;
  pointer-events:none;
}

.pw-thumb-badge{ right:8px; }
.pw-thumb-order{
  left:8px;
  top:8px;
  width:18px;
  height:18px;
  padding:0;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.92);
  display:none;
  align-items:center;
  justify-content:center;
  user-select:none;
  pointer-events:none;
}
.pw-thumb.selected .pw-thumb-order{ display:flex; }
.pw-thumb-order::after{
  content:"✓";
  color:#fff;
  font-size:12px;
  font-weight:700;
  line-height:1;
}

.pw-thumb canvas{ width:100%; height:auto; display:block; background:#fff; }

.pw-thumb .pw-thumb-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid rgba(15,23,42,0.06);
}

.pw-range-hint{ color: var(--muted); font-size: 13px; margin-top: 6px; }


/* === Tool Action Pane (TAP) === */
#toolActionPane[data-mode="1"] .tap-file-info,
#toolActionPane[data-mode="1"] .tap-selection-tools,
#toolActionPane[data-mode="1"] .tap-thumbnails,
#toolActionPane[data-mode="1"] .tap-actions,
#toolActionPane[data-mode="1"] .tap-result { display:none; }

#toolActionPane[data-mode="2"] .tap-dropzone { display:none; }

#toolActionPane[data-mode="3"] .tap-dropzone,
#toolActionPane[data-mode="3"] .tap-file-info,
#toolActionPane[data-mode="3"] .tap-selection-tools,
#toolActionPane[data-mode="3"] .tap-thumbnails,
#toolActionPane[data-mode="3"] .tap-actions { display:none; }

.tap-thumbnails .pw-thumb-grid{
  max-height: calc(4 * 120px);
  overflow-y:auto;
}
.pw-thumb{ max-width:95px; }


/* === TAP v1.1 polish === */
#toolActionPane {
  transition: all .2s ease;
}

.tap-dropzone,
.tap-file-info,
.tap-selection-tools,
.tap-thumbnails,
.tap-actions,
.tap-result {
  transition: opacity .2s ease, transform .2s ease;
}

#toolActionPane[data-mode="2"] .tap-file-info {
  margin-bottom: 10px;
}

.tap-result {
  text-align: center;
  padding: 20px 0;
}
