/**
 * Bootstrap Compatibility CSS
 *
 * Minimal CSS implementing ONLY Bootstrap classes used in TECHi theme.
 * This file is temporary - classes will be replaced with BEM components.
 *
 * @package TECHi
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Custom Properties (matching Bootstrap defaults)
   ========================================================================== */

:root {
  /* Spacing scale (Bootstrap's default) */
  --bs-spacer-0: 0;
  --bs-spacer-1: 0.25rem;
  --bs-spacer-2: 0.5rem;
  --bs-spacer-3: 1rem;
  --bs-spacer-4: 1.5rem;
  --bs-spacer-5: 3rem;

  /* Colors */
  --bs-primary: #0d6efd;
  --bs-secondary: #6c757d;
  --bs-danger: #dc3545;
  --bs-light: #f8f9fa;
  --bs-muted: #6c757d;
  --bs-black: #000;

  /* Border radius */
  --bs-border-radius: 0.375rem;
  --bs-border-radius-pill: 50rem;

  /* Breakpoints */
  --bs-breakpoint-sm: 576px;
  --bs-breakpoint-md: 768px;
  --bs-breakpoint-lg: 992px;
  --bs-breakpoint-xl: 1200px;
  --bs-breakpoint-xxl: 1400px;
}

/* ==========================================================================
   Grid System
   ========================================================================== */

.container,
.container-fluid {
  width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-right: auto;
  margin-left: auto;
}

.container {
  max-width: 1320px;
}

@media (max-width: 575.98px) {
  .container { max-width: 100%; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .container { max-width: 540px; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .container { max-width: 720px; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .container { max-width: 960px; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
  .container { max-width: 1320px; }
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

/* Base columns */
.col-3 { flex: 0 0 auto; width: 25%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-12 { flex: 0 0 auto; width: 100%; }
.col-auto { flex: 0 0 auto; width: auto; }

/* SM breakpoint (>=576px) */
@media (min-width: 576px) {
  .col-sm-3 { flex: 0 0 auto; width: 25%; }
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
  .col-sm-9 { flex: 0 0 auto; width: 75%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

/* MD breakpoint (>=768px) */
@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
}

/* LG breakpoint (>=992px) */
@media (min-width: 992px) {
  .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }
}

/* XL breakpoint (>=1200px) */
@media (min-width: 1200px) {
  .col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-xl-3 { flex: 0 0 auto; width: 25%; }
  .col-xl-9 { flex: 0 0 auto; width: 75%; }
}

/* ==========================================================================
   Display Utilities
   ========================================================================== */

.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }

@media (min-width: 576px) {
  .d-sm-block { display: block; }
}

@media (min-width: 768px) {
  .d-md-block { display: block; }
  .d-md-none { display: none; }
}

/* ==========================================================================
   Flexbox Utilities
   ========================================================================== */

.flex-column { flex-direction: column; }
.flex-grow-1 { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }

@media (min-width: 576px) {
  .flex-sm-row { flex-direction: row; }
}

@media (min-width: 768px) {
  .flex-md-row { flex-direction: row; }
}

@media (min-width: 992px) {
  .flex-lg-row { flex-direction: row; }
}

/* Justify content */
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }

@media (min-width: 576px) {
  .justify-content-sm-between { justify-content: space-between; }
}

@media (min-width: 768px) {
  .justify-content-md-start { justify-content: flex-start; }
}

/* Align items */
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }

@media (min-width: 992px) {
  .align-items-lg-center { align-items: center; }
}

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

@media (min-width: 768px) {
  .gap-md-4 { gap: 1.5rem; }
}

/* Row gap (gutter) utilities - Bootstrap uses g-* for gutters */
.g-0 { --bs-gutter-x: 0; --bs-gutter-y: 0; }
.g-1 { --bs-gutter-x: 0.25rem; --bs-gutter-y: 0.25rem; }
.g-2 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.g-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
.g-5 { --bs-gutter-x: 3rem; --bs-gutter-y: 3rem; }

.row.g-0 { margin-right: 0; margin-left: 0; }
.row.g-0 > * { padding-right: 0; padding-left: 0; }

.row.g-1 { margin-right: -0.125rem; margin-left: -0.125rem; }
.row.g-1 > * { padding-right: 0.125rem; padding-left: 0.125rem; }

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

.row.g-3 { margin-right: -0.5rem; margin-left: -0.5rem; }
.row.g-3 > * { padding-right: 0.5rem; padding-left: 0.5rem; }

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

.row.g-5 { margin-right: -1.5rem; margin-left: -1.5rem; }
.row.g-5 > * { padding-right: 1.5rem; padding-left: 1.5rem; }

/* Row gap (y-axis) - gy-* */
.gy-4 > * { margin-top: 1.5rem; }
.gy-4 > *:first-child { margin-top: 0; }

/* ==========================================================================
   Spacing Utilities
   ========================================================================== */

/* Margin */
.m-0 { margin: 0; }
.m-2 { margin: 0.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.ms-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

@media (min-width: 576px) {
  .my-sm-5 { margin-top: 3rem; margin-bottom: 3rem; }
}

@media (min-width: 768px) {
  .mb-md-0 { margin-bottom: 0; }
  .my-md-5 { margin-top: 3rem; margin-bottom: 3rem; }
}

@media (min-width: 992px) {
  .m-lg-0 { margin: 0; }
  .mb-lg-0 { margin-bottom: 0; }
  .mt-lg-0 { margin-top: 0; }
}

/* Padding */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-5 { padding-bottom: 3rem; }

.pt-5 { padding-top: 3rem; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

@media (min-width: 768px) {
  .p-md-0 { padding: 0; }
  .py-md-5 { padding-top: 3rem; padding-bottom: 3rem; }
}

@media (min-width: 992px) {
  .p-lg-2 { padding: 0.5rem; }
}

@media (min-width: 1200px) {
  .p-xl-4 { padding: 1.5rem; }
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

.small,
small {
  font-size: 0.875em;
}

.text-black { color: var(--bs-black); }
.text-center { text-align: center; }
.text-danger { color: var(--bs-danger); }
.text-decoration-none { text-decoration: none; }
.text-end { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--bs-muted); }
.text-nowrap { white-space: nowrap; }
.text-primary { color: var(--bs-primary); }
.text-secondary { color: var(--bs-secondary); }
.text-start { text-align: left; }
.text-uppercase { text-transform: uppercase; }

@media (min-width: 576px) {
  .text-sm-end { text-align: right; }
  .text-sm-start { text-align: left; }
}

@media (min-width: 768px) {
  .text-md-start { text-align: left; }
}

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }

.fs-3 { font-size: calc(1.3rem + 0.6vw); }

@media (min-width: 1200px) {
  .fs-3 { font-size: 1.75rem; }
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn {
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: var(--bs-border-radius);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
  color: #212529;
}

.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn:disabled,
.btn.disabled {
  pointer-events: none;
  opacity: 0.65;
}

.btn-primary {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-primary:hover {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-outline-secondary {
  color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  border-radius: 0.5rem;
}

/* ==========================================================================
   Image Utilities
   ========================================================================== */

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Border Utilities
   ========================================================================== */

.rounded { border-radius: var(--bs-border-radius); }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: var(--bs-border-radius-pill); }
.rounded-4 { border-radius: 0.5rem; }

.border-bottom { border-bottom: 1px solid #dee2e6; }

/* ==========================================================================
   Shadow Utilities
   ========================================================================== */

.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }

/* ==========================================================================
   Sizing Utilities
   ========================================================================== */

.w-50 { width: 50%; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }

@media (min-width: 768px) {
  .w-md-100 { width: 100%; }
}

/* ==========================================================================
   Position Utilities
   ========================================================================== */

.position-absolute { position: absolute; }
.position-relative { position: relative; }

/* ==========================================================================
   Order Utilities
   ========================================================================== */

.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }

@media (min-width: 768px) {
  .order-md-1 { order: 1; }
  .order-md-2 { order: 2; }
}

/* ==========================================================================
   Background Utilities
   ========================================================================== */

.bg-light { background-color: var(--bs-light); }
.bg-bright-gray { background-color: #f5f5f5; }

/* ==========================================================================
   Accessibility
   ========================================================================== */

.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Miscellaneous Components
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--bs-border-radius);
}

.list-unstyled {
  padding-left: 0;
  list-style: none;
}

.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: -0.125em;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

/* Pagination (basic) */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
}

/* Nav pills (basic - used in tabs) */
.nav-pills {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

/* ==========================================================================
   Search Panel Component (replaces Bootstrap Offcanvas)
   ========================================================================== */

.c-search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1045;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  max-height: 100vh;
  visibility: hidden;
  background-color: #fff;
  background-clip: padding-box;
  outline: 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.c-search-panel.is-open {
  visibility: visible;
  transform: translateY(0);
}

.c-search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
}

.c-search-panel__body {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
}

.c-search-panel__close {
  padding: 0.5rem 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.5;
  font-size: 1.5rem;
  line-height: 1;
}

.c-search-panel__close:hover {
  opacity: 1;
}

.c-search-panel__close::before {
  content: '\00d7';
}

/* Backdrop */
.c-search-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.c-search-panel-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Search toggle button */
.c-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   Accordion Component (replaces Bootstrap Accordion)
   ========================================================================== */

.c-accordion {
  border-radius: var(--bs-border-radius);
}

.c-accordion__item {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.c-accordion__item:first-of-type {
  border-top-left-radius: var(--bs-border-radius);
  border-top-right-radius: var(--bs-border-radius);
}

.c-accordion__item:last-of-type {
  border-bottom-left-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}

.c-accordion__item:not(:first-of-type) {
  border-top: 0;
}

.c-accordion__header {
  margin-bottom: 0;
}

.c-accordion__trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  background-color: #fff;
  border: 0;
  border-radius: 0;
  overflow-anchor: none;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-radius 0.15s ease;
}

.c-accordion__trigger:not(.is-collapsed) {
  color: #0c63e4;
  background-color: #e7f1ff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.c-accordion__trigger::after {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  content: "";
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: 1.25rem;
  transition: transform 0.2s ease-in-out;
}

.c-accordion__trigger.is-collapsed::after {
  transform: rotate(-180deg);
}

.c-accordion__panel {
  overflow: hidden;
  transition: height 0.35s ease;
}

.c-accordion__panel[aria-hidden="true"] {
  height: 0;
}

.c-accordion__content {
  padding: 1rem 1.25rem;
}

/* ==========================================================================
   Tabs Component (replaces Bootstrap Tabs/Pills)
   ========================================================================== */

.c-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  border-bottom: 1px solid #dee2e6;
}

.c-tabs__item {
  margin-bottom: -1px;
}

.c-tabs__trigger {
  display: block;
  padding: 0.5rem 1rem;
  color: #0d6efd;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-top-left-radius: var(--bs-border-radius);
  border-top-right-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.c-tabs__trigger:hover,
.c-tabs__trigger:focus {
  border-color: #e9ecef #e9ecef #dee2e6;
  isolation: isolate;
}

.c-tabs__trigger[aria-selected="true"],
.c-tabs__trigger.is-active {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
}

.c-tabs__panels {
  padding: 1rem 0;
}

.c-tabs__panel {
  display: none;
}

.c-tabs__panel.is-active,
.c-tabs__panel[aria-hidden="false"] {
  display: block;
}
