/* Thai Lottery Widget - Neon Luxe Edition (Black-Red-White) */
/* CSS Variables */
.thai-lottery-container {
  --tl-bg: #000000;
  --tl-card-bg: rgba(20, 20, 20, 0.8);
  --tl-card-border: rgba(255, 255, 255, 0.15);
  --tl-text-base: #ffffff;
  --tl-text-muted: #b0b0b0;

  /* Palette: Black, Red, White */
  --tl-accent-red: #FF0000;
  --tl-accent-dark-red: #8B0000;
  --tl-accent-white: #FFFFFF;

  --tl-radius: 16px;
  --tl-gap: 1rem;
  --tl-transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

  --tl-shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
  --tl-glow-red: 0 0 15px rgba(255, 0, 0, 0.4), 0 0 30px rgba(255, 0, 0, 0.1);
  --tl-glow-white: 0 0 10px rgba(255, 255, 255, 0.3);
}

.thai-lottery-container * {
  box-sizing: border-box;
}

.thai-lottery-container {
  background: var(--tl-bg);
  color: var(--tl-text-base);
  font-family: 'Outfit', 'Inter', sans-serif;
  line-height: 1.5;
  border-radius: var(--tl-radius);
  overflow: hidden;
  position: relative;
}

/* Background Ambient Glow */
.thai-lottery-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 0, 0, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.thai-lottery-wrapper {
  display: grid;
  max-width: 1140px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--tl-gap);
  position: relative;
  z-index: 1;
  padding: 1rem;
}

.thai-lottery-card {
  background: var(--tl-card-bg);
  border: 1px solid var(--tl-card-border);
  border-radius: var(--tl-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  box-shadow: var(--tl-shadow-card);
  transition: transform var(--tl-transition), box-shadow var(--tl-transition), border-color var(--tl-transition);
}

.thai-lottery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.3);
}

/* Primary Results Card */
.thai-lottery-card.thai-lottery-primary {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(145deg, rgba(30, 30, 30, 0.9), rgba(10, 10, 10, 0.95));
  border: 1px solid rgba(255, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* Top glow line for primary card */
.thai-lottery-card.thai-lottery-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--tl-accent-red), transparent);
  opacity: 0.9;
}

.thai-lottery-primary .thai-lottery-title {
  color: var(--tl-text-base);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.thai-lottery-primary .thai-lottery-draw-date {
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0;
  font-weight: 500;
}

.thai-lottery-primary-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--tl-accent-white);
  margin: 1rem 0;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.thai-lottery-label {
  font-size: 0.85rem;
  color: var(--tl-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.thai-lottery-sub-prizes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  margin-top: 1.5rem;
}

.thai-lottery-sub-prize {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.25rem;
  border-radius: var(--tl-radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s, border-color 0.3s;
}

.thai-lottery-sub-prize:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--tl-accent-red);
}

.thai-lottery-sub-prize .thai-lottery-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tl-text-base);
  margin-bottom: 0.25rem;
}

.thai-lottery-sub-prize .thai-lottery-num .thai-lottery-separator {
  color: var(--tl-accent-red);
  margin: 0 0.25rem;
  opacity: 0.8;
}

.thai-lottery-sub-prize:last-child {
  grid-column: 1 / -1;
}

/* Search & History Card */
.thai-lottery-card.thai-lottery-search {
  display: flex;
  flex-direction: column;
  gap: var(--tl-gap);
}

.thai-lottery-search .thai-lottery-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--tl-text-base);
  border-left: 3px solid var(--tl-accent-red);
  padding-left: 0.75rem;
}

.thai-lottery-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Inputs */
.thai-lottery-controls input,
.thai-lottery-controls select {
  flex: 1 1 140px;
  padding: 0.85rem 1.25rem !important;
  border-radius: 50px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(0, 0, 0, 0.6) !important;
  color: var(--tl-text-base) !important;
  font-size: 0.95rem !important;
  font-family: inherit !important;
  transition: all 0.3s ease !important;
}

.thai-lottery-controls input:focus,
.thai-lottery-controls select:focus {
  outline: none;
  border-color: var(--tl-accent-red);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.8);
}


.thai-lottery-controls input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.thai-lottery-controls select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FFFFFF' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 1.5rem) center;
  padding-right: 2.5rem;
}

.thai-lottery-controls select option {
  background: #000;
  color: #fff;
}

/* Button */
.thai-lottery-controls button {
  width: 100%;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--tl-accent-red), var(--tl-accent-dark-red));
  color: #ffffff;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.thai-lottery-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
  filter: brightness(1.1);
}

/* Result Box */
.thai-lottery-check-result {
  padding: 1.25rem;
  border-radius: var(--tl-radius);
  margin-top: 1rem;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(10px);
}

.thai-lottery-check-result.thai-lottery-win {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #fff;
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.thai-lottery-check-result.thai-lottery-no-win {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid var(--tl-accent-red);
  color: var(--tl-accent-red);
}

/* History List */
.thai-lottery-history {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.thai-lottery-history-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--tl-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: border-color 0.3s;
}

.thai-lottery-history-item:hover {
  border-color: var(--tl-accent-red);
}

.thai-lottery-history-item .thai-lottery-date-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.thai-lottery-history-item .thai-lottery-content {
  padding: 1rem;
}

.thai-lottery-prizes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.thai-lottery-prize-item .thai-lottery-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tl-text-base);
}

.thai-lottery-prize-item .thai-lottery-value.thai-lottery-primary-prize {
  color: var(--tl-accent-white);
}

/* Responsive Design */
@media (min-width: 768px) and (max-width: 1024px) {
  .thai-lottery-wrapper {
    grid-template-columns: 1fr;
    max-width: 800px;
    gap: 1.5rem;
  }

  .thai-lottery-card {
    padding: 2.5rem;
  }

  .thai-lottery-primary-number {
    font-size: 4rem;
  }

  .thai-lottery-sub-prizes {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .thai-lottery-history {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .thai-lottery-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
  }

  .thai-lottery-modal-content {
    max-width: 600px;
    padding: 1.5rem;
  }
}

@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
  .thai-lottery-wrapper {
    max-width: 700px;
  }

  .thai-lottery-history {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .thai-lottery-wrapper {
    grid-template-columns: 1fr;
    padding: 0.5rem;
    gap: 1rem;
  }

  .thai-lottery-card {
    padding: 1.5rem;
  }

  .thai-lottery-primary-number {
    font-size: 2.5rem;
  }

  .thai-lottery-sub-prizes {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .thai-lottery-sub-prize:last-child {
    grid-column: 1 / -1;
  }

  .thai-lottery-history {
    grid-template-columns: 1fr;
  }

  .thai-lottery-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .thai-lottery-controls input,
  .thai-lottery-controls select,
  .thai-lottery-controls button {
    flex: 0 0 auto;
    width: 100%;
    min-width: auto;
    max-width: none;
  }

  .thai-lottery-modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }
}

/* WordPress Theme Compatibility */
.thai-lottery-container p,
.thai-lottery-container h1,
.thai-lottery-container h2,
.thai-lottery-container h4,
.thai-lottery-container h5,
.thai-lottery-container h6 {
  margin: 0;
}

.thai-lottery-container a {
  text-decoration: none;
  color: inherit;
}

/* Elementor Widget Specific */
.elementor-widget-html .thai-lottery-container {
  margin: 0;
}

.elementor-widget .thai-lottery-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}