/* ========== GRID SYSTEMS ========== */

/* Base Grid Container */
.ui-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.ui-card-grid .ui-card {
  border: 1px solid transparent;
  padding: 7px 5px;
  font-size: var(--font-md);
  border-radius: 6px;
  background-color: var(--secondary-light-color);
  color: var(--text-color);
  width: 100%;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s ease;
  box-sizing: border-box;
  min-width: 0;
}

.ui-card-grid .ui-card:hover {
  background-color: var(--primary-light-color) !important;
  color: var(--primary-color) !important;
}

.ui-card.active {
  border-color: var(--primary-color) !important;
  background-color: var(--primary-light-color) !important;
  color: var(--primary-color) !important;
}

/* Main Grid */
.ui-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.ui-items {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  font-size: var(--font-md);
  display: block;
  overflow-wrap: break-word;
}

/* Equal Column Grids */
.ui-grid-2-equal {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 100%;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-3-equal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 100%;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-4-equal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 100%;
  margin: auto;
  box-sizing: border-box;
}

/* Auto-fill Grids */
.ui-grid-50 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, auto));
  gap: 5px;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-100 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, auto));
  gap: 20px;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-150 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-200 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-200-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-250 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-300-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-400 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-ads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-items-ads {
  min-height: 20px;
  box-sizing: border-box;
  position: relative;
  font-size: var(--font-md);
  transition: box-shadow 0.5s ease-in-out;
  animation: fadeIn 0.50s ease-in-out;
  display: flow-root;
}

/* Special Purpose Grids */
.ui-grid-button {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 5px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid_voucher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  gap: 0px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.ui-grid-mobile-1item {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-2item {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  margin: auto;
  box-sizing: border-box;
}

.ui-grid-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  gap: 0px 20px;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

/* ========== SCROLL COMPONENTS ========== */

.vehicle-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

.vehicle-scroll::-webkit-scrollbar {
  display: none;
}

.vehicle-card {
  min-width: 100px;
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f3f3;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: 0.2s;
}

.vehicle-card.active {
  border-color: var(--primary-color) !important;
  background-color: var(--primary-light-color) !important;
  color: var(--primary-color) !important;
}

/* Scroll Wrapper */
.scroll-wrapper {
  position: relative;
  width: 100%;
}

.grid-overflow {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  display: flex;
  gap: 5px;
  scroll-behavior: smooth;
  padding: 0px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  box-sizing: border-box;
}

.grid-overflow::-webkit-scrollbar {
  display: none;
}

.grid-overflow .ui-items {
  display: inline-block;
  min-width: 80px;
  text-align: center;
  white-space: normal;
}

/* Scroll Arrows */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.scroll-wrapper:hover .scroll-arrow {
  opacity: 1;
}

.scroll-arrow.left {
  left: 5px;
}

.scroll-arrow.right {
  right: 5px;
}

/* ========== CONTAINERS ========== */

.container_roots {
  min-height: calc(100vh - 47px);
  margin: 0px;
  display: flow-root;
  background: var(--layout-background-color);
}

.container_size {
  max-width: var(--maxwidth);
  margin: auto;
  padding: 0px 5px;
  display: flow-root;
  clear: both;
  min-height: 10px;
  width: 100%;
  box-sizing: border-box;
}

.container_contant {
  max-width: var(--maxwidth-contant);
  margin: auto;
  padding: 0px;
  display: flow-root;
  clear: both;
  min-height: 20px;
  width: 100%;
  box-sizing: border-box;
}

.container_size_info {
  max-width: 1100px;
  margin: auto;
  padding: 0px;
  display: flow-root;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

.container_size_info2 {
  max-width: 600px;
  margin: auto;
  padding: 0px;
  display: flow-root;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

.container_size_mobile {
  max-width: 600px;
  margin: auto;
  padding: 0px;
  display: flow-root;
  clear: both;
  min-height: 20px;
  width: 100%;
  box-sizing: border-box;
}

/* ========== POST CONTAINER (DESKTOP LAYOUT) ========== */

.post-container {
  max-width: 100%;
  display: flex;
  margin: 5px 10px;
  gap: 10px;
  box-sizing: border-box;
  align-items: flex-start;
}

.post-container > div {
  box-sizing: border-box;
}

.post-container .post_div {
  flex: 1;
  min-width: 0;
  min-height: 20px;
  position: relative;
}

.post-container .post_category {
  flex: 0 0 70px;
  max-width: 70px;
}

.post-container .post_updates {
  flex: 0 0 400px;
  max-width: 400px;
  min-width: 0;
  position: relative;
}

.post-container .post_pos {
  flex: 0 0 300px;
  max-width: 300px;
  min-width: 0;
  position: relative;
}

/* ========== TABLE STYLES ========== */

.voucher-table-desktop {
  width: 100%;
  border-collapse: collapse;
  box-sizing: border-box;
}

.voucher-table-desktop th {
  padding: 6px 5px;
  text-align: left;
  background-color: var(--secondary-light-color);
}

.voucher-table-desktop td {
  padding: 4px 1px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.table_padding tr:nth-child(even) {
  background-color: var(--secondary-light-color) !important;
}

.child tr:nth-child(odd) {
  background-color: var(--body-background-color) !important;
}

.child tr:nth-child(even) {
  background-color: var(--secondary-light-color) !important;
}

.table_padding tr:nth-child(odd) {
  background-color: var(--body-background-color) !important;
}

/* ========== IMAGE STYLES ========== */

.brand-thumbnail {
  width: 100%;
  height: 130px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  object-fit: cover;
  background-color: #fff;
}

/* ========== BACKGROUND UTILITIES ========== */

.items-back {
  background-color: var(--layout-background-color);
}

.items-back-fill {
  background-color: var(--secondary-light-color) !important;
}

.items-back-fill-light {
  background-color: var(--primary-light-color) !important;
}

.items-back-fill-dark {
  background-color: var(--secondary-dark-color) !important;
}

.fill {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.ui-items.active {
  border: solid 1px var(--green);
}

/* ========== SCROLL TO TOP BUTTON ========== */

.scroll-to-top-btn {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--layout_background);
  text-align: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--icon-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}

/* ========== COLOR UTILITIES ========== */

.border-color {
  color: var(--border-color) !important;
}

.orange {
  color: var(--orange) !important;
}

.orange-back {
  background-color: var(--orange) !important;
  color: #fff !important;
}

.green {
  color: var(--green) !important;
}

.green-back {
  background-color: var(--green) !important;
  color: #fff !important;
}

.yellow-back {
  background-color: var(--yellow) !important;
  color: #000 !important;
}

.blue-back {
  background-color: var(--blue-color) !important;
  color: #fff !important;
}

.blue-light-back {
  background-color: var(--blue-light-color) !important;
}

.blue {
  color: var(--blue-color) !important;
}

.black {
  color: #000 !important;
}

.red {
  color: var(--red) !important;
}

.red-back-light {
  background-color: var(--red-light) !important;
  color: var(--red) !important;
}

.green-back-light {
  background-color: var(--green-light) !important;
}

.red-back {
  background-color: var(--red) !important;
}

.primary {
  color: var(--primary) !important;
}

.primary-back {
  background-color: var(--primary) !important;
  color: var(--white) !important;
}

.secondary {
  color: var(--secondary-color) !important;
}

.color_light {
  color: var(--light-text) !important;
}

.secondary-back {
  background-color: var(--secondary-color) !important;
  color: var(--white) !important;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet and Medium Screens */
@media only screen and (max-width: 1200px) {
  .post-container .post_updates {
    flex: 0 0 350px;
    max-width: 350px;
  }
  
  .post-container .post_pos {
    flex: 0 0 280px;
    max-width: 280px;
  }
}

/* Small Desktop / Large Tablet */
@media only screen and (max-width: 1024px) {
  .post-container .post_updates {
    flex: 0 0 300px;
    max-width: 300px;
  }
  
  .post-container .post_pos {
    flex: 0 0 260px;
    max-width: 260px;
  }
}

/* Mobile Devices */
@media only screen and (max-width: 768px) {
  /* Container Adjustments */
  .mobile_body {
    padding: 10px 10px 5px 10px;
  }
  
  .container_roots {
    min-height: calc(100vh - 100px);
    overflow-y: auto;
    margin: 0px;
  }
  
  .container_size {
    max-width: 100%;
    margin: auto;
    padding: 0px;
    margin: 0px 0px auto;
  }
  
  .container_size_mobile {
    max-width: 100%;
    margin: auto;
    padding: 0px;
    display: flow-root;
    clear: both;
    min-height: 20px;
  }
  
  /* Grid Adjustments */
  .ui-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    padding: 2px 5px;
  }
  
  .ui-grid-2-equal,
  .ui-grid-3-equal,
  .ui-grid-4-equal {
    grid-template-columns: repeat(1, 1fr);
    gap: 10px 0px;
  }
  
  .ui-grid-2item {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .ui-grid-150,
  .ui-grid-200 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .ui-grid-200-2,
  .ui-grid-300-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ui-grid-250 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .ui-grid-button {
    grid-template-columns: 1fr;
  }
  
  .ui-grid-mobile-1item {
    grid-template-columns: repeat(1, 1fr);
    gap: 10px 0px;
  }
  
  .ui-grid-ads {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  /* Table Adjustments */
  .voucher-table-desktop th,
  .voucher-table-desktop td {
    padding: 5px 5px;
    border-bottom: 1px solid #ddd;
    text-align: left;
  }
  
  /* Post Container - Stack Vertically */
  .post-container {
    display: block;
    margin: 5px;
    gap: 10px;
  }
  
  .post-container .post_div {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin-bottom: 15px;
  }
  
  .post-container .post_updates,
  .post-container .post_pos,
  .post-container .post_category {
    flex: none;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  
  /* Scroll to Top Button - Mobile */
  .scroll-to-top-btn {
    bottom: 70px;
    right: 0;
    left: 0;
    margin: auto;
    width: 30px;
    height: 30px;
    visibility: hidden;
    opacity: 0.6;
  }
}

/* Extra Small Devices */
@media only screen and (max-width: 480px) {
  .ui-grid-150,
  .ui-grid-200 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ui-grid-2item {
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
  }
  
  .ui-grid-200-2,
  .ui-grid-300-2 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .vehicle-card {
    min-width: 80px;
    padding: 6px 8px;
    font-size: 14px;
  }
}

/* ========== ANIMATIONS ========== */

.ease-in-out {
  transition: all 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}