/* Tool / project pages – aligned with main site (style.css) */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --accent: #5b7c99;
  --accent-light: #7a9bb8;
  --accent-glow: rgba(91, 124, 153, 0.35);
  --surface: rgba(17, 24, 39, 0.72);
  --surface-solid: rgba(10, 12, 18, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(91, 124, 153, 0.4);
  --text-muted: rgba(255, 255, 255, 0.55);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: #e5e7eb;
  background-color: #040404;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* Main content card */
#main .container,
main > .container {
  width: calc(100% - 24px);
  max-width: 1100px;
  margin: 16px auto 40px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #main .container,
  main > .container {
    width: 90%;
    padding: 36px 30px;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 32px;
}

.section-title h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.02em;
  font-family: "Poppins", sans-serif;
  color: #fff;
  line-height: 1.35;
}

.section-title h2,
.section-title p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-family: "Open Sans", sans-serif;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.section-title h2::after {
  content: "";
  width: 120px;
  height: 1px;
  display: block;
  background: var(--accent);
  margin: 16px auto 0;
}

.tool-hero-img {
  max-width: 200px;
  width: 100%;
  height: auto;
}

/* Glass inner panels */
.glass-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 24px;
  margin-bottom: 0;
}

.glass-box p,
.glass-box li {
  line-height: 1.65;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.88);
}

.glass-box h3,
.glass-box h4 {
  color: var(--accent-light);
  margin-top: 20px;
  margin-bottom: 12px;
  font-family: "Poppins", sans-serif;
}

.glass-box h3:first-child,
.glass-box h4:first-child {
  margin-top: 0;
}

/* Buttons */
.btn-cta {
  display: inline-block;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--accent) 0%, #4a6580 100%);
  border: 1px solid var(--border-accent);
  color: #fff;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px var(--accent-glow);
  margin-top: 16px;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  color: #fff;
  text-decoration: none;
}

.btn-cta:active {
  transform: scale(0.98);
}

/* Back to Projects banner – compact */
.portfolio-back-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.portfolio-back-banner-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.portfolio-back-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(91, 124, 153, 0.2);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.portfolio-back-banner-btn:hover {
  background: rgba(91, 124, 153, 0.35);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.portfolio-back-banner-icon {
  font-size: 15px;
  line-height: 1;
}

.portfolio-back-banner-home {
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-back-banner-home:hover {
  color: #fff;
  text-decoration: none;
}

/* Stars background */
#stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(180deg, #060608 0%, #0f1419 50%, #111827 100%);
}

/* PDF Tools */
.pdf-tools-accordion {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-tool-accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.pdf-tool-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.2s ease;
}

.pdf-tool-accordion-trigger:hover,
.pdf-tool-accordion-trigger:focus-visible {
  background: rgba(91, 124, 153, 0.12);
  outline: none;
}

.pdf-tool-accordion-trigger[aria-expanded="true"] {
  background: rgba(91, 124, 153, 0.15);
  border-bottom: 1px solid var(--border);
}

.pdf-tool-accordion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pdf-tool-accordion-text strong {
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-light);
}

.pdf-tool-accordion-text small {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pdf-tool-accordion-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-light);
  border-bottom: 2px solid var(--accent-light);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}

.pdf-tool-accordion-trigger[aria-expanded="true"] .pdf-tool-accordion-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.pdf-tool-accordion-body {
  padding: 18px;
}

.pdf-field-label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
}

.pdf-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.pdf-checkbox-label input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.pdf-tool-result {
  margin-top: 14px;
  font-size: 0.95rem;
}

.pdf-download-link {
  color: var(--accent-light);
  font-weight: 600;
  text-decoration: underline;
}

.pdf-download-link:hover {
  color: #fff;
}

.pdf-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.pdf-preview-thumb {
  max-width: 120px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pdf-reorder-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pdf-reorder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  cursor: grab;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pdf-reorder-item.is-dragging {
  opacity: 0.5;
}

.pdf-reorder-item.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 124, 153, 0.35);
}

.pdf-reorder-thumb {
  display: block;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.pdf-reorder-label {
  font-size: 12px;
  color: var(--text-muted);
}

.pdf-tool-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.04);
}

.pdf-tool-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--accent-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.drop-zone {
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.drop-zone:hover,
.drop-zone.highlight {
  background: rgba(91, 124, 153, 0.12);
  border-color: var(--accent);
  color: #fff;
}

.file-info {
  font-style: italic;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#unlock-result,
#merge-result,
#jpg-result {
  margin-top: 14px;
  font-size: 0.95rem;
}

/* Article / notes */
.glass-box code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #fff;
  word-break: break-word;
}

.note {
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin: 15px 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #e5e7eb;
}

.note em {
  color: var(--accent-light);
  font-style: normal;
  font-weight: 600;
}

.pdf-tool-section .btn-cta,
.pdf-tool-accordion-body .btn-cta {
  margin-top: 14px;
}

input[type="file"] {
  display: none;
}

/* Code Beautifier */
.code-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  resize: vertical;
}

.code-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select,
.form-control {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.form-select:focus,
.form-control:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: #fff;
}

option {
  background: #111827;
  color: #e5e7eb;
}

.cookie-banner {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  z-index: 1000;
  width: 90%;
  max-width: 900px;
  box-sizing: border-box;
  box-shadow: var(--shadow-card);
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-banner a {
  color: var(--accent-light);
}

.cookie-banner button {
  background: rgba(91, 124, 153, 0.25);
  color: #fff;
  border: 1px solid var(--border-accent);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-size: 13px;
  transition: background 0.2s ease;
}

.cookie-banner button:hover {
  background: rgba(91, 124, 153, 0.4);
}

.pdf-progress {
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: none;
}

.pdf-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

@media (max-width: 576px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: center;
  }

  .cookie-actions {
    justify-content: center;
  }

  .portfolio-back-banner-btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  .portfolio-back-banner-home {
    font-size: 12px;
  }
}
