/**
 * @file
 * EGR Layout component styles.
 */

/* Base component styles */
.egr-layout {
  position: relative;
  width: 100%;
}

/* Title styles */
.egr-layout__title {
  margin-bottom: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Separator styles */
.egr-layout__separator {
  width: 100%;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

/* Layout styles */
.egr-layout--boxed .container {
  margin: 0 auto;
}

.egr-layout--edge_to_edge .container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

.egr-layout--full_width {
  width: 100%;
  padding: 0;
}

/* Vertical padding variations */
.egr-layout--padding-none {
  padding-top: 0;
  padding-bottom: 0;
}

.egr-layout--padding-small {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.egr-layout--padding-medium {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.egr-layout--padding-large {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.egr-layout--padding-extra-large {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

/* Column inner wrapper */
.egr-layout__column-inner {
  height: 100%;
  position: relative;
}

/* Background color support */
.egr-layout.has-bg-color {
  transition: background-color 0.3s ease;
}

/* Column hover effects */
.egr-layout [class*="col"]:hover .egr-layout__column-inner {
  z-index: 1;
}

/* Animation support */
.egr-layout--animated .egr-layout__column--animated {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.egr-layout--animated .egr-layout__column--animated.aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .egr-layout--padding-small {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  .egr-layout--padding-medium {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  .egr-layout--padding-large {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .egr-layout--padding-extra-large {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .egr-layout--edge_to_edge .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Print styles */
@media print {
  .egr-layout {
    page-break-inside: avoid;
  }
  
  .egr-layout--animated .egr-layout__column--animated {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Accessibility improvements */
.egr-layout:focus-within {
  outline: 2px solid #00c24e;
  outline-offset: 2px;
}

/* Column-specific utilities */
.egr-layout [class*="col"] {
  min-height: 1px; /* Prevent collapse of empty columns */
}

/* Nested layouts support */
.egr-layout .egr-layout {
  padding: 0;
}

/* Common column patterns */
.egr-layout .col-equal-height {
  display: flex;
  flex-direction: column;
}

.egr-layout .col-equal-height .egr-layout__column-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Shadow utilities for columns */
.egr-layout .shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.egr-layout .shadow {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.egr-layout .shadow-lg {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Border utilities */
.egr-layout [class*="col"].border-start {
  border-left: 1px solid #dee2e6;
}

.egr-layout [class*="col"].border-end {
  border-right: 1px solid #dee2e6;
}

@media (max-width: 768px) {
  .egr-layout [class*="col"].border-start,
  .egr-layout [class*="col"].border-end {
    border-left: none;
    border-right: none;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
  }
  
  .egr-layout [class*="col"]:first-child.border-start,
  .egr-layout [class*="col"]:first-child.border-end {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }
}

/* MSU brand colors for quick use */
.egr-layout .bg-msu-green {
  background-color: #18453b;
  color: #ffffff;
}

.egr-layout .bg-msu-light-gray {
  background-color: #f5f5f5;
}

.egr-layout .text-msu-green {
  color: #18453b;
}

/* Debugging helper (remove in production) */
.egr-layout--debug [class*="col"] {
  border: 1px dashed #dc3545;
  min-height: 100px;
  position: relative;
}

.egr-layout--debug [class*="col"]::before {
  content: attr(class);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 10px;
  background: #dc3545;
  color: white;
  padding: 2px 5px;
  z-index: 10;
}