/* ===========================
   SKRYPTYONLINE.PL - Style
   =========================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #16a34a;
  --accent-light: #dcfce7;
  --text: #1e293b;
  --text-muted: #64748b;
  --muted: #64748b;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.logo span {
  color: #93c5fd;
}

/* ===== NAVIGATION ===== */
nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

nav ul li a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

nav ul li a:hover,
nav ul li a.active {
  background: rgba(255,255,255,0.18);
  color: white;
}

/* hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: white;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: 0.3s;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.page-hero h1 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 700px;
}

/* ===== CARDS GRID (index) ===== */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
  will-change: transform;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== TOOL PAGE LAYOUT ===== */
.tool-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.tool-main {}

.tool-sidebar {}

/* ===== TOOL CARD ===== */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.tool-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== FORM ELEMENTS ===== */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}

label:first-child { margin-top: 0; }

textarea, input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 160px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.9rem;
}

textarea.large { min-height: 250px; }
textarea.small { min-height: 80px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

.btn-success {
  background: var(--accent);
  color: white;
}

.btn-success:hover { background: #15803d; }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ===== CHECKBOX / RADIO ===== */
.checkbox-group, .radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.checkbox-group label,
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  margin-top: 0;
}

.checkbox-group input,
.radio-group input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

/* ===== RESULT BOX ===== */
.result-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  min-height: 60px;
  word-break: break-word;
  white-space: pre-wrap;
}

.result-box.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.result-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

/* ===== INFO / DESCRIPTION ===== */
.tool-description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.tool-description h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.tool-description p, .tool-description li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tool-description ul, .tool-description ol {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.tool-description li { margin-bottom: 0.25rem; }

/* ===== SIDEBAR WIDGETS ===== */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.sidebar-widget h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-links a {
  font-size: 0.84rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.sidebar-links a:hover { background: var(--primary-light); }

/* ===== TABLE ===== */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.result-table th {
  background: var(--primary);
  color: white;
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-weight: 600;
}

.result-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.result-table tr:nth-child(even) td { background: var(--bg); }

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* ===== SECTION SEPARATOR ===== */
.section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

/* ===== FOOTER ===== */
footer {
  background: #1e293b;
  color: #cbd5e1;
  margin-top: auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

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

.footer-col h5 {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col h5 a {
  color: #ffffff;
  text-decoration: none;
}

.footer-col h5 a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 0.4rem; }

.footer-col ul li a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: #f1f5f9; }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
}

/* ===== NOTICE ===== */
.notice {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #854d0e;
  margin-bottom: 1rem;
}

/* ===== COPY BUTTON ===== */
.copy-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-wrapper:hover .copy-btn,
.copy-btn.visible { opacity: 1; }

.copy-btn.copied { background: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .tool-page {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    order: -1;
  }
}

@media (max-width: 700px) {
  .hamburger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }

  nav.open { display: block; }

  nav ul {
    flex-direction: column;
    gap: 0.25rem;
  }

  nav ul li a {
    display: block;
    padding: 0.6rem 1rem;
  }

  .header-inner { position: relative; }

  .page-hero h1 { font-size: 1.4rem; }

  .section-row {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  main { padding: 1.25rem 1rem; }
  .tool-card { padding: 1.25rem; }
  .page-hero { padding: 1.25rem; }
}

/* ===== EXAMPLE BOX ===== */
.example-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.92rem;
}
.example-box + .example-box {
  margin-top: 0.5rem;
}
.example-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.25rem 0;
}
.example-row + .example-row {
  border-top: 1px solid var(--border);
  margin-top: 0.4rem;
  padding-top: 0.4rem;
}
.example-arrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.example-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

/* ===== FAQ ===== */
.faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.faq-section h2 {
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.9rem 2rem 0.9rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.faq-q:hover { color: var(--primary); }

.faq-q::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.25s;
}

.faq-q.open::after {
  content: '−';
}

.faq-a {
  display: none;
  padding: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== UTILITY ===== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.flex-gap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
