/* Clean CSS - Lucky Number System */
:root {
  --primary-pink: #e91e63;
  --secondary-red: #f44336;
  --accent-orange: #ff9800;
  --background: #fafafa;
  --white: #ffffff;
  --text-primary: #212121;
  --text-secondary: #757575;
  --border-color: #e0e0e0;
  --success-bg: #4caf50;
  --error-bg: #f44336;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 0;
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red), var(--accent-orange));
  color: var(--white);
  border-radius: 16px;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

header .subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Sections */
section {
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

section h2 {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Number Checker Section */
.number-checker-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid var(--primary-color);
  margin-bottom: 2rem;
}

.number-checker-section h2 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checker-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checker-input-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.checker-input-row input {
  flex: 1;
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.checker-input-row button {
  white-space: nowrap;
}

.input-help {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.checker-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

.checker-result.found {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.checker-result.not-found {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.checker-result.not-found .result-icon {
  color: #dc3545;
}

.checker-result.not-found .result-title {
  color: #721c24;
}

.not-found-help {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f5c6cb;
}

.not-found-help p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.checker-result.error {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.checker-result.checking {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Card Result Styles (restored) */
.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #c3e6cb;
}

.result-icon {
  font-size: 2rem;
  line-height: 1;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #155724;
}

.result-patterns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pattern-match {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #28a745;
}

.pattern-number {
  background: #28a745;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.pattern-details {
  flex: 1;
}

.pattern-line-card {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #333;
}

/* Simple Result Styles (kept for other uses) */
.result-header-simple {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.result-header-simple .result-icon {
  font-size: 1.2rem;
}

.result-header-simple .result-title {
  color: #155724;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pattern-line {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #333;
}

.pattern-line:not(:last-child) {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
}

/* Beautiful Result Styles for Not Found */
.result-header-beautiful {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  border: 1px solid #e3f2fd;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
}

.result-header-beautiful::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}

.result-icon-beautiful {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  width: 4rem;
  height: 4rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon {
  font-size: 1.5rem;
  opacity: 0.7;
}

.cross-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1rem;
  background: #ff4757;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.result-content-beautiful {
  flex: 1;
  color: white;
}

.result-title-beautiful {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.result-subtitle-beautiful {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
  font-weight: 500;
}

.result-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.suggestion-item {
  font-size: 0.9rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-weight: 400;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .result-header-beautiful {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .result-icon-beautiful {
    align-self: center;
    width: 3.5rem;
    height: 3.5rem;
  }
  
  .result-title-beautiful {
    font-size: 1.2rem;
  }
  
  .result-subtitle-beautiful {
    font-size: 0.9rem;
  }
  
  .suggestion-item {
    font-size: 0.8rem;
    justify-content: center;
  }
}
/* Buttons */
.btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red));
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-red), var(--accent-orange));
  color: var(--white);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 67, 54, 0.3);
}

/* Numbers Grid */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.number-item {
  background: var(--white);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.number-item:hover {
  border-color: var(--primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

/* Badge Styles */
.main-result-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
  border: 2px solid #fff;
}

.number-item.premium-baramee {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  color: #e65100;
  border-color: #FFD700;
  font-weight: bold;
}

/* Loading Screen */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
  color: var(--white);
  max-width: 400px;
  padding: 2rem;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.loading-message {
  font-size: 1rem;
  opacity: 0.9;
}
/* Lucky Number Popup */
.lucky-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.lucky-overlay.show {
  opacity: 1;
  visibility: visible;
}

.lucky-popup {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.lucky-header {
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red), var(--accent-orange));
  color: var(--white);
  padding: 1.5rem 2rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lucky-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(244, 67, 54, 0.8);
  transform: rotate(90deg);
}

.lucky-body {
  padding: 2rem;
}

.selected-number {
  text-align: center;
  margin-bottom: 2rem;
}

.selected-number label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.account-number-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-pink);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.1), rgba(255, 152, 0, 0.1));
  border-radius: 15px;
  border: 2px solid rgba(233, 30, 99, 0.2);
  position: relative;
}

/* Lucky Analysis Sections */
.lucky-analysis {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sum-section, .zodiac-section, .career-section, .personality-section, .lucky-info-section, .star-ratings-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary-pink);
}

.sum-section h4, .zodiac-section h4, .career-section h4, .personality-section h4, .lucky-info-section h4, .star-ratings-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* Circular Badge */
.circular-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 1rem;
}

.circular-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red), var(--accent-orange));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.3);
  margin-bottom: 1rem;
}

.badge-label {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 0.2rem;
}

.digit-sum-large {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.rating-badge-floating {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--white);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--primary-pink);
  z-index: 10;
}

.rating-description-center {
  text-align: center;
  margin-top: 0.5rem;
}

.rating-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}
/* Star Ratings */
.star-ratings-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rating-category {
  background: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.rating-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.category-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.stars-container {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.star-rating {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.star {
  font-size: 1.5rem;
  transition: all 0.2s ease;
  cursor: default;
  user-select: none;
}

.star.filled {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.star.empty {
  color: #e0e0e0;
  opacity: 0.7;
}

/* Rating Level Colors */
.rating-badge-floating.supreme {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #ffffff;
  border-color: #FFD700;
}

.rating-badge-floating.excellent {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: #ffffff;
  border-color: #4caf50;
}

.rating-badge-floating.good {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: #ffffff;
  border-color: #2196f3;
}

.rating-badge-floating.fair {
  background: linear-gradient(135deg, #9c27b0, #ba68c8);
  color: #ffffff;
  border-color: #9c27b0;
}

.rating-badge-floating.poor {
  background: linear-gradient(135deg, #f44336, #e57373);
  color: #ffffff;
  border-color: #f44336;
}

/* Zodiac Display */
.zodiac-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.zodiac-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  padding: 0.8rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  flex: 1;
  min-width: 120px;
}

.zodiac-icon {
  font-size: 1.2rem;
}

.zodiac-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* Career Tags */
.career-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.career-tag {
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red));
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Personality Display */
.personality-display, .lucky-info-display {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.personality-item, .meaning-item, .lucky-item, .warning-item, .color-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.personality-item strong, .meaning-item strong, .lucky-item strong, .warning-item strong, .color-item strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.personality-item span, .meaning-item span, .lucky-item span, .warning-item span, .color-item span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Footer */
.lucky-footer {
  padding: 1.5rem 2rem;
  border-radius: 0 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.button-row {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

.attribution {
  text-align: center;
}

.attribution small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
/* Form Elements */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group label {
  font-weight: 600;
  color: var(--text-primary);
}

select, input {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-pink);
}

small {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Error Messages */
.error-message {
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #f44336;
  margin-top: 1rem;
  display: none;
}

.error-message.error {
  background: #ffebee;
  color: #c62828;
  border-left-color: #f44336;
}

.error-message.info {
  background: #e3f2fd;
  color: #1565c0;
  border-left-color: #2196f3;
}

.error-message.show {
  display: block;
}

/* Pattern List - Compact */
.pattern-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 300px; /* Limit height */
  overflow-y: auto; /* Add scroll */
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fafafa;
}

/* Custom Scrollbar for Pattern List */
.pattern-list::-webkit-scrollbar {
  width: 6px;
}

.pattern-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.pattern-list::-webkit-scrollbar-thumb {
  background: var(--primary-pink);
  border-radius: 3px;
}

.pattern-list::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-red);
}

.pattern-item {
  background: var(--white);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.pattern-item:hover {
  border-color: var(--primary-pink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
}

.pattern-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
}

.pattern-text {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  min-width: 120px;
}

.pattern-type {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red));
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  white-space: nowrap;
}

.pattern-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-shrink: 0;
}

.pattern-count {
  background: linear-gradient(135deg, var(--accent-orange), #ff7043);
  color: var(--white);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(255, 152, 0, 0.3);
}

.remove-pattern-btn {
  background: linear-gradient(135deg, #f44336, #e57373);
  color: var(--white);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.remove-pattern-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

/* Empty Pattern List State - Compact */
.pattern-list:empty::after {
  content: "ยังไม่มี Pattern ที่เพิ่ม\A🎯 เลือก Pattern แล้วกดปุ่ม 'เพิ่ม Pattern'";
  white-space: pre-line;
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem 1rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  line-height: 1.4;
  font-size: 0.9rem;
}

/* Pattern List Section Header - Compact */
.pattern-list-section {
  margin-bottom: 1.5rem;
}

.pattern-list-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.pattern-list-section h2::before {
  content: "📋";
  font-size: 1rem;
}

/* Results Header with Export Buttons */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Export Buttons Group */
.export-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-export {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-export-csv {
  background: linear-gradient(135deg, var(--secondary-red), var(--accent-orange));
  color: var(--white);
}

.btn-export-csv:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-export-excel {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: var(--white);
}

.btn-export-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.results-display {
  min-height: 100px;
  max-height: 600px; /* Limit height */
  overflow-y: auto; /* Add scroll */
  padding-right: 0.5rem; /* Space for scrollbar */
}

/* Custom Scrollbar */
.results-display::-webkit-scrollbar {
  width: 8px;
}

.results-display::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.results-display::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-pink), var(--secondary-red));
  border-radius: 4px;
}

.results-display::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary-red), var(--accent-orange));
}

.result-group {
  margin-bottom: 1.5rem;
  background: var(--white);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-group h3 {
  color: var(--primary-pink);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0;
  border: none;
}

/* Numbers Grid - Compact */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
  max-height: 400px; /* Limit grid height */
  overflow-y: auto; /* Add scroll to grid */
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fafafa;
}

/* Custom Scrollbar for Numbers Grid */
.numbers-grid::-webkit-scrollbar {
  width: 6px;
}

.numbers-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.numbers-grid::-webkit-scrollbar-thumb {
  background: var(--primary-pink);
  border-radius: 3px;
}

.numbers-grid::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-red);
}

.number-item {
  background: var(--white);
  padding: 0.8rem;
  border-radius: 8px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-item:hover {
  border-color: var(--primary-pink);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.2);
}

.number-item.clickable {
  cursor: pointer;
}

.number-item.premium {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  color: #e65100;
  border-color: #FFD700;
  font-weight: bold;
}

.number-item.premium-baramee {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  color: #e65100;
  border-color: #FFD700;
  font-weight: bold;
}

/* Pagination - Compact */
.pagination-section {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.pagination-range-info {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
}

.page-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.page-input {
  width: 60px;
  padding: 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
  font-size: 0.8rem;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-pagination {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.btn-pagination:hover {
  background: var(--primary-pink);
  color: var(--white);
  border-color: var(--primary-pink);
}

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

/* Performance Display */
.performance-display {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

footer p {
  margin: 0.5rem 0;
}

footer .version {
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .numbers-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
  }

  /* Pattern List Mobile - Compact */
  .pattern-list {
    max-height: 250px;
    padding: 0.3rem;
  }

  .pattern-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .pattern-info {
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }

  .pattern-text {
    font-size: 0.8rem;
    min-width: auto;
  }

  .pattern-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .pattern-actions {
    justify-content: space-between;
    width: 100%;
    gap: 0.6rem;
  }

  .pattern-count {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .remove-pattern-btn {
    flex-shrink: 0;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

/* Mobile Export Buttons */
@media (max-width: 768px) {
  .export-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-export {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
  }

  /* Results Header Mobile - Compact */
  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .results-header h2 {
    text-align: center;
    font-size: 1.2rem;
  }

  /* Results Display Mobile - Compact */
  .results-display {
    max-height: 400px;
  }

  /* Numbers Grid Mobile - Compact */
  .numbers-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    max-height: 300px;
    padding: 0.3rem;
  }

  .number-item {
    padding: 0.6rem;
    font-size: 0.8rem;
    min-height: 40px;
  }

  /* Result Group Mobile - Compact */
  .result-group {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .result-group h3 {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.8rem;
  }

  /* Pagination Mobile - Compact */
  .pagination-section {
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding-top: 0.6rem;
  }

  .pagination-range-info {
    font-size: 0.7rem;
  }

  .page-input-container {
    font-size: 0.7rem;
    gap: 0.3rem;
  }

  .page-input {
    width: 50px;
    padding: 0.3rem;
    font-size: 0.7rem;
  }

  .btn-pagination {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .lucky-popup {
    width: 95%;
    margin: 1rem;
  }
  
  .lucky-header {
    padding: 1rem 1.5rem;
  }
  
  .lucky-body {
    padding: 1.5rem;
  }
  
  .circular-badge {
    width: 100px;
    height: 100px;
  }
  
  .digit-sum-large {
    font-size: 2rem;
  }
  
  .rating-badge-floating {
    top: -8px;
    right: -8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .sum-section, .zodiac-section, .career-section, .personality-section, .lucky-info-section, .star-ratings-section {
    padding: 1rem;
  }
  
  .zodiac-display {
    gap: 0.5rem;
  }
  
  .zodiac-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .career-list {
    gap: 0.4rem;
  }
  
  .career-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  
  .lucky-footer {
    padding: 1rem 1.5rem;
  }
  
  .button-row {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }

  .pagination-controls {
    justify-content: center;
  }

  .pagination-section {
    gap: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  section {
    padding: 1rem;
  }
  
  /* Number Checker Mobile */
  .checker-input-row {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .checker-input-row input {
    font-size: 1rem;
  }
  
  .checker-result {
    font-size: 0.9rem;
    padding: 0.8rem;
  }

  header {
    padding: 2rem 1rem;
  }

  .numbers-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .number-item {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  /* Pattern List Extra Small Mobile */
  .pattern-text {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
  }

  .pattern-type {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
  }

  .pattern-count {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .remove-pattern-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .view-toggle-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Desktop Table Enhancements */
@media (min-width: 769px) {
  .table-mobile-cards {
    display: none;
  }
  
  .results-table {
    display: table;
  }
}
/* Export Buttons Group */
.export-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-export {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-export-csv {
  background: linear-gradient(135deg, var(--secondary-red), var(--accent-orange));
  color: var(--white);
}

.btn-export-csv:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-export-excel {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: var(--white);
}

.btn-export-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Mobile Export Buttons */
@media (max-width: 768px) {
  .export-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-export {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
  }
}