/* toolstack.icu – Global Styles */

:root {
  --teal-700: #0F766E;
  --teal-600: #0D9488;
  --teal-100: #CCFBF1;
  --amber-500: #F59E0B;
  --amber-600: #D97706;
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --white: #FFFFFF;
  --green-500: #22C55E;
  --red-500: #EF4444;

  --font-primary: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--slate-50);
  color: var(--slate-600);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  height: 56px;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--slate-900);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--teal-600);
  font-size: 1rem;
}

.header-nav a {
  color: var(--slate-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: background 150ms ease-out;
}

.header-nav a:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

/* Main Layout */
.main-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  gap: 32px;
  flex: 1;
}

.main-content {
  flex: 1;
  max-width: 720px;
}

.sidebar {
  width: 320px;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
  .site-header { height: 64px; }
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-bottom: 16px;
}

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

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

.breadcrumb-sep {
  margin: 0 6px;
  color: var(--slate-400);
}

.breadcrumb-current {
  color: var(--slate-900);
  font-weight: 500;
}

/* Tool Header */
.tool-header {
  margin-bottom: 24px;
}

.tool-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.tool-subtitle {
  font-size: 1rem;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.tool-meta {
  font-size: 0.875rem;
  color: var(--slate-400);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  padding: 24px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 4px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate-900);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-100);
}

.form-input::placeholder {
  color: var(--slate-400);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--slate-700);
  padding: 6px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: border-color 150ms, background 150ms;
}

.radio-item:hover {
  border-color: var(--teal-600);
}

.radio-item input[type="radio"] {
  accent-color: var(--teal-600);
  cursor: pointer;
}

/* AdSense Container */
.ad-container {
  position: relative;
  min-height: 90px;
  background: var(--slate-100);
  border-radius: var(--radius-md);
  padding: 8px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slate-400);
}

@media (max-width: 640px) {
  .ad-container {
    min-height: 50px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 150ms ease-out;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--amber-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.9;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.btn-ghost:hover {
  background: var(--slate-100);
}

/* Results */
.result-section {
  display: none;
  animation: fadeInUp 300ms ease-out forwards;
}

.result-section.is-visible {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-primary {
  text-align: center;
  padding: 24px;
  background: var(--teal-100);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.result-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.result-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal-700);
  line-height: 1.1;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
  .result-value {
    font-size: 2.25rem;
  }
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
}

.result-item-label {
  font-size: 0.875rem;
  color: var(--slate-500);
}

.result-item-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--slate-900);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--slate-400);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

/* Sidebar */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 12px;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 8px;
}

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-600);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 0;
  transition: color 150ms;
}

.sidebar-list a:hover {
  color: var(--teal-600);
}

.sidebar-list a svg {
  flex-shrink: 0;
  color: var(--teal-600);
}

/* Related Tools */
.related-tools {
  margin-top: 32px;
}

.related-tools h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 16px;
}

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

.tool-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 200ms, transform 200ms;
}

.tool-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  transform: scale(1.01);
}

.tool-card-icon {
  width: 24px;
  height: 24px;
  color: var(--teal-600);
  margin-bottom: 8px;
}

.tool-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Blog Teaser */
.blog-teaser {
  background: var(--teal-100);
  border-left: 4px solid var(--teal-600);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px;
  margin-top: 24px;
}

.blog-teaser h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-teaser p {
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 12px;
}

/* FAQ */
.faq-section {
  margin-top: 32px;
}

.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 16px;
}

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

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.faq-question:hover {
  color: var(--teal-700);
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--slate-400);
  transition: transform 200ms;
  flex-shrink: 0;
}

.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease-out, padding 300ms ease-out;
  font-size: 1rem;
  color: var(--slate-600);
  line-height: 1.6;
}

.faq-item.is-open .faq-answer {
  max-height: 500px;
  padding-bottom: 16px;
}

/* Footer */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 32px 16px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  color: var(--white);
  font-weight: 800;
  font-size: 1.125rem;
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--slate-400);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--white);
}

/* Error States */
.form-input.is-error {
  border-color: var(--red-500);
}

.form-input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-msg {
  font-size: 0.75rem;
  color: var(--red-500);
  margin-top: 4px;
  display: none;
}

.error-msg.is-visible {
  display: block;
}

/* Spinner */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
