/* Main styles */
:root {
  --primary: #4e73df;
  --primary-dark: #224abe;
  --primary-light: #eaedff;
  --secondary: #858796;
  --success: #1cc88a;
  --info: #36b9cc;
  --warning: #f6c23e;
  --danger: #e74a3b;
  --light: #f8f9fc;
  --dark: #5a5c69;
  --white: #ffffff;
  --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  --transition: all 0.25s ease-in-out;
  --border-radius: 0.35rem;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  --gradient-success: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
  --gradient-warning: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%);
  --gradient-danger: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
  --gradient-info: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
  --gradient-cosmic: linear-gradient(135deg, #614385 0%, #516395 100%);
  --gradient-cosmic-new: linear-gradient(135deg, #f8d7da 0%, #f8d7da 100%);
  
  /* Shopee and TikTok colors */
  --shopee: #ee4d2d;
  --shopee-light: #fff0ec;
  --tiktok: #000000;
  --tiktok-light: #f4f4f4;
}

/* Main page layout */
body {
  background-color: #f8f9fc;
  color: #5a5c69;
}

.container {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* Alert ticker for recent purchases */
.alert-ticker {
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  color: white;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.alert-ticker marquee {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Page title styling */
h3 {
  color: #333;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h3:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

/* Service filter styling */
.service-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.btn-check {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.btn-filter {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-radius: 30px;
  background: white;
  color: var(--secondary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid #e3e6f0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-filter:hover {
  background: #f8f9fc;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.btn-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-filter img {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.btn-filter i {
  margin-right: 8px;
}

/* Section header styling */
.section-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: white;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(78, 115, 223, 0.25);
}

.section-header img {
  margin-right: 0.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.section-header span {
  font-weight: 700;
  font-size: 1.2rem;
}

/* Service card styling */
.service-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.2);
}

.top-part-service-normal {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.top-part-service {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  max-height: 400px;
  min-height: 400px;
}

.top-part-service.expanded {
  max-height: unset; /* Set a reasonable max height */
  min-height: unset; /* Set a reasonable min height */
}

.top-part-service.expanded:after {
  display: none;
}


.card-header {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  padding: 1rem 1.25rem;
  align-items: center;
  border-bottom: none;
}

.card-header img {
  margin-right: 0.75rem;
}

.card-body {
  padding: 0.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.description {
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  line-height: 1.4;
}



.description-toggle {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 0;
    margin-top: 5px;
    padding-right: 5px;
    text-decoration: underline;
    width: 100%;
    text-align: right;

}

.description-toggle:hover {
    color: #0056b3;
}

.description-toggle.show {
    display: block;
}

.description ul{
  padding-left: 1rem;
}

/* Service statistics */
.service-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: end;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.badge-available {
  font-size : 1em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  display: inline-block;
}

.price-old {
  color: var(--secondary);
  text-decoration: line-through;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.price-current {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.quantity-input {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid #e3e6f0;
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 600;
}

/* Buy button styling */
.btn-buy {
  background: var(--gradient-success);
  color: white;
  border: none;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(28, 200, 138, 0.25);
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(28, 200, 138, 0.35);
}

.btn-buy i {
  margin-right: 0.5rem;
}

.btn-buy.btn-sold-out {
  background: var(--gradient-danger);
  opacity: 0.9;
  box-shadow: 0 4px 10px rgba(231, 74, 59, 0.25);
}

.btn-buy.btn-sold-out:hover {
  transform: none;
  opacity: 1;
}

/* Recent orders section */
.orders-header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.orders-header i {
  margin-right: 0.75rem;
  font-size: 1.15rem;
}

.table-orders {
  background: white;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.table-orders td {
  vertical-align: middle;
  border-color: #f0f0f0;
  font-size: 0.95rem;
}

.table-orders tr:hover {
  background-color: #f8f9fc;
}

.table-orders td i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.time-badge {
  background: var(--light);
  color: var(--secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Custom styling for service types */
.service-card[data-type="Sop Pi"] .card-header {
  background: linear-gradient(135deg, #fc5a23 0%, #fc5a23 100%);
  box-shadow: 0 4px 12px rgba(245, 61, 45, 0.2);
}

.service-card[data-type="Sop Pi"] .price-current {
  color: var(--shopee);
}

.service-card[data-type="Tóp Tóp"] .card-header {
  background: linear-gradient(135deg, #7e5f5f 0%, #7e5f5f 100%);
}

.service-card[data-type="Tóp Tóp"] .price-current {
  color: var(--tiktok);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .service-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .service-stats .stat-item:last-child {
    grid-column: span 2;
    margin-top: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .service-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  
  .btn-filter {
    scroll-snap-align: start;
    min-width: max-content;
  }
  
  .section-header {
    margin-top: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .service-stats {
    grid-template-columns: 1fr;
  }
  
  .service-stats .stat-item {
    margin-bottom: 0.5rem;
  }
  
  .service-stats .stat-item:last-child {
    grid-column: span 1;
  }
  
  .card-body {
    padding: 1.25rem 1rem;
  }
}

/* Animation effects */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}


/* Loading spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}