/* === Hash Crack Central - Solarized Osaka Night Theme === */

/* CSS Variables (matching main CyberSec cheatsheet) */
:root {
  --bg-main: #0b1720;
  --bg-panel: #001f2a;
  --bg-panel-soft: #022737;
  --fg-primary: #e5f2f7;
  --fg-muted: #8fa1ad;
  --fg-accent: #b3ecff;
  --accent-cyan: #2aa198;
  --accent-blue: #268bd2;
  --accent-magenta: #d33682;
  --accent-yellow: #b58900;
  --accent-orange: #cb4b16;
  --accent-green: #859900;
  --border-subtle: #123345;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --font-mono: "Fira Code", "Courier New", monospace;
  --font-sans: system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Global Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--fg-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  z-index: 1;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.header-content {
  flex-grow: 1;
  min-width: 300px;
}

h1 {
  font-family: var(--font-mono);
  color: var(--fg-primary);
  margin-bottom: 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 900px;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

/* Quick Navigation */
.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
  padding: 1.2rem;
  background-color: var(--bg-panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-link {
  padding: 0.5rem 1rem;
  background-color: var(--bg-panel-soft);
  color: var(--fg-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--accent-cyan);
  color: var(--bg-main);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Section Styling */
.cheat-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cheat-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: -0.01em;
}

.section-title svg {
  color: var(--accent-cyan);
  width: 24px;
  height: 24px;
}

/* Info Blocks */
.info-block {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-block.soft {
  background-color: var(--bg-panel-soft);
}

.info-block h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

label,
legend {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-primary);
  font-family: var(--font-mono);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-main);
  color: var(--fg-primary);
  font-family: var(--font-mono);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(42, 161, 152, 0.2);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

fieldset.charset-field {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.35rem;
}

.charset-field label {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--fg-muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

button {
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-panel-soft);
  color: var(--fg-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

button.primary {
  background-color: var(--accent-cyan);
  color: var(--bg-main);
  border-color: var(--accent-cyan);
  font-weight: 700;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--accent-cyan);
}

.length-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  align-items: center;
}

.length-separator {
  text-align: center;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.result-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.result-row:last-child {
  border-bottom: none;
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-panel-soft);
  color: var(--fg-primary);
}

.tab.active {
  background-color: var(--accent-cyan);
  color: var(--bg-main);
  border-color: var(--accent-cyan);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.generated {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Syntax Block */
.syntax-block {
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-yellow);
  overflow-x: auto;
}

/* Command Groups */
.command-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.command-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg-panel);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}

.command-item:hover {
  border-color: var(--accent-cyan);
}

.command-label {
  font-weight: 500;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.command {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-yellow);
  background-color: var(--bg-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: block;
  width: 100%;
}

.command:hover {
  border-color: var(--accent-cyan);
  background-color: var(--bg-panel-soft);
}

.command:active,
.command.copied {
  background-color: var(--accent-green);
  color: var(--bg-main);
  border-color: var(--accent-green);
  animation: flash-copy 0.4s ease;
}

@keyframes flash-copy {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Tables */
.hash-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.hash-table thead {
  background-color: var(--bg-panel-soft);
}

.hash-table th {
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--fg-primary);
  border-bottom: 2px solid var(--border-subtle);
}

.hash-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-muted);
}

.hash-table tbody tr {
  transition: background-color var(--transition-fast);
}

.hash-table tbody tr:hover {
  background-color: var(--bg-panel-soft);
}

.hash-table code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background-color: var(--bg-main);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

/* Link Grid for Online Tools */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tool-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.tool-card {
  background-color: var(--bg-panel-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: all var(--transition-fast);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.tool-card h4 {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Lists */
.technique-list {
  list-style-position: inside;
  margin-left: 0.5rem;
}

.technique-list li {
  margin-bottom: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.technique-list strong {
  color: var(--fg-primary);
  font-weight: 600;
}

ol.technique-list {
  counter-reset: item;
  list-style-type: none;
}

ol.technique-list li {
  counter-increment: item;
  padding-left: 0.5rem;
}

ol.technique-list li::before {
  content: counter(item) ". ";
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Helper Text */
.helper-text {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-panel-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.helper-text strong {
  color: var(--fg-primary);
  font-weight: 600;
}

.helper-text code {
  font-family: var(--font-mono);
  background-color: var(--bg-main);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--accent-yellow);
}

/* Alert Box */
.alert-box {
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  background-color: rgba(203, 75, 22, 0.1);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.alert-box svg {
  flex-shrink: 0;
  color: var(--accent-orange);
  margin-top: 0.2rem;
  width: 20px;
  height: 20px;
}

.alert-box strong {
  color: var(--fg-primary);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: var(--font-mono);
}

.alert-box p {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.alert-box ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.alert-box li {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

/* Theme Toggle Switch Styles */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-panel-soft);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: var(--fg-primary);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

input:focus-visible + .slider {
  box-shadow: 0 0 0 2px var(--bg-main), 0 0 0 4px var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 28px;
}

.slider.round:before {
  border-radius: 50%;
}

.slider .icon {
  font-size: 12px;
  color: var(--fg-muted);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  z-index: 1;
}

input:checked + .slider .light-icon {
  opacity: 0;
}

input:not(:checked) + .slider .dark-icon {
  opacity: 0;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .command-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .command-label {
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .header-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .subtitle {
        max-width: 90%;
    }

    .quick-nav {
        justify-content: center;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .link-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .command-item {
        padding: 0.6rem 0.8rem;
    }

    .copy-btn {
        width: 100%;
    }

    .quick-nav {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

body[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-900);
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}
