/* JSON Formatter Tool Specific Styles */

/* Tool Hero Section */
.tool-hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tool-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%2319F57" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.03;
  pointer-events: none;
}

.tool-hero-content {
  position: relative;
  z-index: 1;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #2563EB 0%, #6366F1 100%);
  color: white;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.tool-title {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.tool-description {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: #475569;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.tool-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2563EB;
}

.feature-icon {
  width: 20px;
  height: 20px;
  color: #2563EB;
}

/* Tool Section */
.tool-section {
  padding: 4rem 0;
  background: #F8FAFC;
}

.json-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* JSON Grid Layout */
.json-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.json-input,
.json-output {
  background: white;
  border-radius: 1rem;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.json-actions {
  display: flex;
  gap: 0.5rem;
}

.json-input textarea {
  width: 100%;
  height: 400px;
  padding: 1.5rem;
  border: none;
  resize: vertical;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  background: white;
  color: #374151;
}

.json-input textarea:focus {
  outline: none;
}

.json-code {
  height: 400px;
  margin: 0;
  padding: 1.5rem;
  background: white;
  overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-all;
}

.json-code.error {
  color: #EF4444;
  background: #FEF2F2;
}

/* Formatting Options */
.format-options {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.option-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-group label {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  color: #374151;
  min-width: 120px;
}

.option-group select {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #E2E8F0;
  border-radius: 0.5rem;
  font-family: 'Outfit', sans-serif;
  background: white;
  transition: all 0.3s ease;
}

.option-group select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2563EB;
}

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

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  min-width: 180px;
}

/* JSON Statistics */
.json-stats {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #F8FAFC;
  border-radius: 0.75rem;
  border: 1px solid #E2E8F0;
}

.stat-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  color: #64748B;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: #2563EB;
}

/* Features Section */
.features-section {
  padding: 4rem 0;
  background: white;
}

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

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #2563EB;
}

.feature-icon-wrapper {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.feature-icon-wrapper svg {
  width: 32px;
  height: 32px;
  color: #2563EB;
}

.feature-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 1rem;
}

.feature-card p {
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  color: #64748B;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tool-hero {
    padding: 3rem 0;
  }
  
  .tool-title {
    font-size: 2.5rem;
  }
  
  .tool-description {
    font-size: 1.125rem;
    padding: 0 1rem;
  }
  
  .tool-features {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .json-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .json-input textarea,
  .json-code {
    height: 300px;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .option-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .option-group label {
    min-width: auto;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-lg {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tool-title {
    font-size: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card {
    padding: 1.5rem 1rem;
  }
  
  .json-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .json-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .json-input textarea,
  .json-code {
    height: 250px;
    padding: 1rem;
  }
}

/* Scrollbar Styling */
.json-code::-webkit-scrollbar,
.json-input textarea::-webkit-scrollbar {
  width: 8px;
}

.json-code::-webkit-scrollbar-track,
.json-input textarea::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.json-code::-webkit-scrollbar-thumb,
.json-input textarea::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.json-code::-webkit-scrollbar-thumb:hover,
.json-input textarea::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Syntax Highlighting */
.json-code {
  counter-reset: line;
}

.json-code.error {
  background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
  border-left: 4px solid #EF4444;
  padding-left: 1rem;
}

/* Button Hover Effects */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #2563EB;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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