/* Scoped Layout and Styling for Integrated Tools in WebStudioLabs */

/* 1. Reset conflicts & box-sizing */
.tool-interface, .tool-header, .related-tools-section {
  box-sizing: border-box;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif !important;
}

.tool-interface *, .tool-header *, .related-tools-section * {
  box-sizing: border-box;
}

/* 2. Grid & Layout (replaces Bootstrap Grid) */
.container {
  width: 100%;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * 1.5rem);
  margin-right: calc(-.5 * 1.5rem);
  margin-left: calc(-.5 * 1.5rem);
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(.5 * 1.5rem);
  padding-left: calc(.5 * 1.5rem);
  margin-top: 1.5rem;
}

.g-2 {
  margin-top: -0.5rem;
  margin-right: -0.25rem;
  margin-left: -0.25rem;
}
.g-2 > * {
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  margin-top: 0.5rem;
}

.g-4 {
  margin-top: -1.5rem;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}
.g-4 > * {
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-top: 1.5rem;
}

/* Column sizes */
.col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 768px) {
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
}
@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
}

.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* 3. Cards & Containers (Glassmorphic) */
.tool-box, .tool-card-interface, .card {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04) !important;
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: rgba(14, 165, 233, 0.2) !important;
  box-shadow: 0 10px 30px -10px rgba(14, 165, 233, 0.08) !important;
}

.card-body {
  padding: 12px 0 0 0;
}

/* 4. Form Styling (replaces Bootstrap forms) */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input.form-control, textarea.form-control, select.form-select, .form-control, .form-select {
  display: block !important;
  width: 100% !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 10px !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}

input.form-control:focus, textarea.form-control:focus, select.form-select:focus, .form-control:focus, .form-select:focus {
  border-color: #0ea5e9 !important;
  outline: 0 !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12) !important;
  background-color: #ffffff !important;
}

.form-control::placeholder {
  color: #94a3b8;
}

/* Checkboxes and Radios */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
}

.form-check-label {
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

/* 5. Buttons (Gradient theme to match main site) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.btn-primary:hover {
  opacity: 0.93;
  transform: scale(0.98);
}

.btn-secondary {
  color: #475569 !important;
  background-color: #f1f5f9 !important;
  border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.btn-secondary:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.btn-outline-secondary {
  color: #475569 !important;
  background-color: transparent !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.btn-outline-secondary:hover {
  background-color: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

.btn-sm {
  padding: 8px 16px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* 6. Alerts & Information blocks */
.alert {
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.alert-info {
  background-color: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.15);
  color: #0369a1;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #047857;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: #b45309;
}

/* 7. Typography Helpers */
.h4, h4 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; color: #0f172a; }
.h5, h5 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; color: #0f172a; }
.text-muted { color: #64748b !important; }
.small { font-size: 12px; }

/* 8. Text manipulators & Pre boxes */
.result-box, .result-area {
  background-color: #f8fafc !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  border-radius: 10px !important;
  padding: 16px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 13px !important;
  color: #1e293b !important;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

pre {
  margin-bottom: 0;
  font-family: inherit;
}

/* Case Converter cards specific styling */
.case-card {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 10px !important;
  padding: 16px !important;
  cursor: pointer;
  background-color: #ffffff;
  transition: all 0.2s;
  text-align: left;
}

.case-card:hover {
  background-color: rgba(14, 165, 233, 0.04);
  transform: translateY(-2px);
  border-color: #0ea5e9 !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.05);
}

.case-example {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.case-preview {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 20px;
}

/* Info Box block list */
.info-box {
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.info-box ul {
  list-style: none;
  padding-left: 0;
}

.info-box li {
  font-size: 13px;
  color: #475569;
  margin-bottom: 8px;
}

.info-box li strong {
  color: #0f172a;
}

/* Fancy fonts previews */
.font-preview {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
  min-height: 28px;
}

/* Hide helper fields */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Related tools widget */
.related-tools-section {
  padding: 60px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 14px;
  color: #64748b;
  text-align: center;
  margin-bottom: 32px;
}

/* Tool specific layout headers */
.tool-header {
  padding: 80px 0 40px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 40px;
}

.tool-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tool-info-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.tool-info-content h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.tool-info-content p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 0;
}

/* Breadcrumbs link layout */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0 0 16px 0;
  margin-bottom: 0;
  list-style: none;
}

.breadcrumb-item {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.breadcrumb-item + .breadcrumb-item {
  padding-left: 8px;
}

.breadcrumb-item + .breadcrumb-item::before {
  float: left;
  padding-right: 8px;
  color: #cbd5e1;
  content: var(--bs-breadcrumb-divider, "/");
}

.breadcrumb-item a {
  color: #0ea5e9;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #94a3b8;
}

/* 9. Additional Bootstrap Utility Fallbacks */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

@media (max-width: 768px) {
  .w-50, .w-75 {
    width: 100% !important;
  }
}

.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

.btn-outline-primary {
  color: #0ea5e9 !important;
  background-color: transparent !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
}

.btn-outline-primary:hover {
  background-color: rgba(14, 165, 233, 0.08) !important;
  border-color: #0ea5e9 !important;
}

.btn-outline-danger {
  color: #ef4444 !important;
  background-color: transparent !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-outline-danger:hover {
  background-color: rgba(239, 68, 68, 0.08) !important;
  border-color: #ef4444 !important;
}
