/* ==== 
 --------- Modern CSS Framework (Bootstrap Replacement) ---------
 ==== */

@use "../abstracts/mixins" as *;
@use "../abstracts/variables" as *;

// Container system
.container {
  @include container();
}

.container-fluid {
  width: 100%;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

// Grid system
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--space-4) * -0.5);
  margin-right: calc(var(--space-4) * -0.5);
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }

// Responsive columns
@media (min-width: 576px) {
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 768px) {
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 992px) {
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 1200px) {
  .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
  .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
  .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-xl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
  .col-xl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 1400px) {
  .col-xxl-12 { flex: 0 0 100%; max-width: 100%; }
  .col-xxl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-xxl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-xxl-9 { flex: 0 0 75%; max-width: 75%; }
  .col-xxl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-xxl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-xxl-6 { flex: 0 0 50%; max-width: 50%; }
  .col-xxl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-xxl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xxl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xxl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-xxl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

// Column padding
[class*="col-"] {
  padding-left: calc(var(--space-4) * 0.5);
  padding-right: calc(var(--space-4) * 0.5);
}

// Display utilities
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

// Responsive display utilities
@media (max-width: 575.98px) {
  .d-xs-none { display: none !important; }
  .d-xs-inline { display: inline !important; }
  .d-xs-inline-block { display: inline-block !important; }
  .d-xs-block { display: block !important; }
  .d-xs-flex { display: flex !important; }
  .d-xs-inline-flex { display: inline-flex !important; }
  .d-xs-grid { display: grid !important; }
}

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
  .d-sm-grid { display: grid !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-inline-flex { display: inline-flex !important; }
  .d-md-grid { display: grid !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
  .d-lg-grid { display: grid !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
  .d-xl-grid { display: grid !important; }
}

// Flexbox utilities
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-wrap-reverse { flex-wrap: wrap-reverse !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-evenly { justify-content: space-evenly !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.align-content-start { align-content: flex-start !important; }
.align-content-end { align-content: flex-end !important; }
.align-content-center { align-content: center !important; }
.align-content-between { align-content: space-between !important; }
.align-content-around { align-content: space-around !important; }
.align-content-stretch { align-content: stretch !important; }

.align-self-auto { align-self: auto !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }
.align-self-center { align-self: center !important; }
.align-self-baseline { align-self: baseline !important; }
.align-self-stretch { align-self: stretch !important; }

// Spacing utilities
@for $i from 0 through 12 {
  .m-#{$i} { margin: var(--space-#{$i}) !important; }
  .mt-#{$i} { margin-top: var(--space-#{$i}) !important; }
  .mr-#{$i} { margin-right: var(--space-#{$i}) !important; }
  .mb-#{$i} { margin-bottom: var(--space-#{$i}) !important; }
  .ml-#{$i} { margin-left: var(--space-#{$i}) !important; }
  .mx-#{$i} { 
    margin-left: var(--space-#{$i}) !important; 
    margin-right: var(--space-#{$i}) !important; 
  }
  .my-#{$i} { 
    margin-top: var(--space-#{$i}) !important; 
    margin-bottom: var(--space-#{$i}) !important; 
  }
  
  .p-#{$i} { padding: var(--space-#{$i}) !important; }
  .pt-#{$i} { padding-top: var(--space-#{$i}) !important; }
  .pr-#{$i} { padding-right: var(--space-#{$i}) !important; }
  .pb-#{$i} { padding-bottom: var(--space-#{$i}) !important; }
  .pl-#{$i} { padding-left: var(--space-#{$i}) !important; }
  .px-#{$i} { 
    padding-left: var(--space-#{$i}) !important; 
    padding-right: var(--space-#{$i}) !important; 
  }
  .py-#{$i} { 
    padding-top: var(--space-#{$i}) !important; 
    padding-bottom: var(--space-#{$i}) !important; 
  }
}

// Text utilities
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-justify { text-align: justify !important; }

.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: none !important; }
.text-capitalize { text-transform: none !important; }

.text-decoration-none { text-decoration: none !important; }
.text-decoration-underline { text-decoration: underline !important; }
.text-decoration-line-through { text-decoration: line-through !important; }

// Font weight utilities
.fw-light { font-weight: var(--font-weight-light) !important; }
.fw-normal { font-weight: var(--font-weight-normal) !important; }
.fw-medium { font-weight: var(--font-weight-medium) !important; }
.fw-semibold { font-weight: var(--font-weight-semibold) !important; }
.fw-bold { font-weight: var(--font-weight-bold) !important; }
.fw-bolder { font-weight: var(--font-weight-bolder) !important; }

// Font size utilities
.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }
.text-2xl { font-size: var(--text-2xl) !important; }
.text-3xl { font-size: var(--text-3xl) !important; }
.text-4xl { font-size: var(--text-4xl) !important; }

// Color utilities
.text-primary { color: var(--primary-600) !important; }
.text-secondary { color: var(--secondary-600) !important; }
.text-success { color: var(--success-600) !important; }
.text-danger { color: var(--danger-600) !important; }
.text-warning { color: var(--warning-600) !important; }
.text-info { color: var(--info-600) !important; }
.text-light { color: var(--light) !important; }
.text-dark { color: var(--dark) !important; }
.text-white { color: var(--white) !important; }
.text-black { color: var(--black) !important; }

// Background utilities
.bg-primary { background-color: var(--primary-600) !important; }
.bg-secondary { background-color: var(--secondary-600) !important; }
.bg-success { background-color: var(--success-600) !important; }
.bg-danger { background-color: var(--danger-600) !important; }
.bg-warning { background-color: var(--warning-600) !important; }
.bg-info { background-color: var(--info-600) !important; }
.bg-light { background-color: var(--light) !important; }
.bg-dark { background-color: var(--dark) !important; }
.bg-white { background-color: var(--white) !important; }
.bg-black { background-color: var(--black) !important; }
.bg-transparent { background-color: transparent !important; }

// Border utilities
.border { border: 1px solid var(--secondary-300) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--secondary-300) !important; }
.border-end { border-right: 1px solid var(--secondary-300) !important; }
.border-bottom { border-bottom: 1px solid var(--secondary-300) !important; }
.border-start { border-left: 1px solid var(--secondary-300) !important; }

.border-primary { border-color: var(--primary-600) !important; }
.border-secondary { border-color: var(--secondary-600) !important; }
.border-success { border-color: var(--success-600) !important; }
.border-danger { border-color: var(--danger-600) !important; }
.border-warning { border-color: var(--warning-600) !important; }
.border-info { border-color: var(--info-600) !important; }
.border-light { border-color: var(--light) !important; }
.border-dark { border-color: var(--dark) !important; }
.border-white { border-color: var(--white) !important; }
.border-black { border-color: var(--black) !important; }

// Border radius utilities
.rounded { border-radius: var(--radius-base) !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded-1 { border-radius: var(--radius-sm) !important; }
.rounded-2 { border-radius: var(--radius-base) !important; }
.rounded-3 { border-radius: var(--radius-lg) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: var(--radius-full) !important; }

.rounded-top { border-top-left-radius: var(--radius-base) !important; border-top-right-radius: var(--radius-base) !important; }
.rounded-end { border-top-right-radius: var(--radius-base) !important; border-bottom-right-radius: var(--radius-base) !important; }
.rounded-bottom { border-bottom-right-radius: var(--radius-base) !important; border-bottom-left-radius: var(--radius-base) !important; }
.rounded-start { border-top-left-radius: var(--radius-base) !important; border-bottom-left-radius: var(--radius-base) !important; }

// Shadow utilities
.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-base) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

// Position utilities
.position-static { position: static !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

// Width and height utilities
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

.mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; }

// Overflow utilities
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }
.overflow-scroll { overflow: scroll !important; }

// Vertical alignment
.align-baseline { vertical-align: baseline !important; }
.align-top { vertical-align: top !important; }
.align-middle { vertical-align: middle !important; }
.align-bottom { vertical-align: bottom !important; }
.align-text-bottom { vertical-align: text-bottom !important; }
.align-text-top { vertical-align: text-top !important; }

// Visibility utilities
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

// Modern button classes (Bootstrap replacement)
.btn {
  @include button-base;
  @include focus-visible;
  
  // Primary button
  &.btn-primary {
    @include button-variant(var(--primary-600), var(--white));
  }
  
  // Secondary button
  &.btn-secondary {
    @include button-variant(var(--secondary-600), var(--white));
  }
  
  // Success button
  &.btn-success {
    @include button-variant(var(--success-600), var(--white));
  }
  
  // Danger button
  &.btn-danger {
    @include button-variant(var(--danger-600), var(--white));
  }
  
  // Warning button
  &.btn-warning {
    @include button-variant(var(--warning-600), var(--white));
  }
  
  // Info button
  &.btn-info {
    @include button-variant(var(--info-600), var(--white));
  }
  
  // Light button
  &.btn-light {
    @include button-variant(var(--light), var(--dark));
  }
  
  // Dark button
  &.btn-dark {
    @include button-variant(var(--dark), var(--white));
  }
  
  // Outline variants
  &.btn-outline-primary {
    @include button-outline(var(--primary-600));
  }
  
  &.btn-outline-secondary {
    @include button-outline(var(--secondary-600));
  }
  
  &.btn-outline-success {
    @include button-outline(var(--success-600));
  }
  
  &.btn-outline-danger {
    @include button-outline(var(--danger-600));
  }
  
  &.btn-outline-warning {
    @include button-outline(var(--warning-600));
  }
  
  &.btn-outline-info {
    @include button-outline(var(--info-600));
  }
  
  &.btn-outline-light {
    @include button-outline(var(--light));
  }
  
  &.btn-outline-dark {
    @include button-outline(var(--dark));
  }
  
  // Size variants
  &.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }
  
  &.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
  }
}

/* ==== 
 --------- Modern CSS Framework End ---------
 ==== */
