/* ── .htaccess Rewrite Generator Styles ── */

/* Tabs Navigation */
.htaccess-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 2px solid #e5e7eb;
}

[data-theme="dark"] .htaccess-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.htaccess-tab {
  padding: 12px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -2px;
}

.htaccess-tab:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
  border-bottom-color: #bfdbfe;
}

.htaccess-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

[data-theme="dark"] .htaccess-tab {
  color: #9ca3af;
}

[data-theme="dark"] .htaccess-tab:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  border-bottom-color: rgba(96, 165, 250, 0.5);
}

[data-theme="dark"] .htaccess-tab.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* Tab Panels */
.htaccess-tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1f2937;
  font-size: 0.95rem;
}

[data-theme="dark"] .form-group label {
  color: #f3f4f6;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  color: #1f2937;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .form-control {
  background: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

[data-theme="dark"] .form-control:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Checkboxes and Radio Buttons */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
}

.form-group label input[type="checkbox"],
.form-group label input[type="radio"] {
  cursor: pointer;
}

/* Small Text */
.form-group small {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.85rem;
}

[data-theme="dark"] .form-group small {
  color: #d1d5db;
}

/* Options (hidden by default) */
.redirect-option,
.rewrite-option,
.security-option,
.performance-option {
  margin-bottom: 20px;
  padding: 0;
}

.redirect-option:not([style*="display: none"]),
.rewrite-option:not([style*="display: none"]),
.security-option:not([style*="display: none"]),
.performance-option:not([style*="display: none"]) {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

/* Code Output Section */
.code-preview {
  background: #1f2937;
  color: #f3f4f6;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 20px 0;
  border: 1px solid #374151;
}

[data-theme="dark"] .code-preview {
  background: #111827;
  border-color: #1f2937;
}

.code-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Output Actions */
.output-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  padding: 11px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

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

.btn-secondary {
  background: #e5e7eb;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

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

[data-theme="dark"] .btn-secondary {
  background: #374151;
  color: #f3f4f6;
  border-color: #4b5563;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #4b5563;
}

/* Info Section */
.info-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
}

[data-theme="dark"] .info-section {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.info-section h2 {
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: #1f2937;
}

[data-theme="dark"] .info-section h2 {
  color: #f3f4f6;
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tip-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
}

.tip-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-4px);
}

[data-theme="dark"] .tip-card {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .tip-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

.tip-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .tip-card h3 {
  color: #f3f4f6;
}

.tip-card h3 i {
  color: #2563eb;
  font-size: 1.2rem;
}

[data-theme="dark"] .tip-card h3 i {
  color: #60a5fa;
}

.tip-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
}

[data-theme="dark"] .tip-card p {
  color: #d1d5db;
}

/* Form Card Specific Styling */
.form-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 20px;
}

[data-theme="dark"] .form-card {
  background: #111827;
  border-color: #1f2937;
}

.form-card h2 {
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: #1f2937;
}

[data-theme="dark"] .form-card h2 {
  color: #f3f4f6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .htaccess-tabs {
    gap: 4px;
  }

  .htaccess-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .form-card {
    padding: 20px;
  }

  .output-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

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

  .code-preview {
    font-size: 0.85rem;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .htaccess-tab {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .htaccess-tab i {
    display: none;
  }

  .form-card {
    padding: 15px;
  }

  .info-section {
    margin-top: 30px;
  }
}
