/**
 * Lotto Number Generator - Mobile-First Styles
 */

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

:root {
  /* Dark Mode with Neon Purple/Violet Theme */
  --primary-color: #a78bfa;
  --primary-dark: #8b5cf6;
  --primary-bright: #c4b5fd;
  --secondary-color: #ec4899;
  --danger-color: #f43f5e;
  --success-color: #10b981;
  --bg-color: #0f0f23;
  --bg-secondary: #1a1a2e;
  --card-bg: #16162a;
  --text-color: #e5e7eb;
  --text-light: #9ca3af;
  --border-color: #2d2d44;
  --border-glow: #6366f1;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 24px rgba(139, 92, 246, 0.3);
  --glow: 0 0 20px rgba(167, 139, 250, 0.4);
  --glow-intense: 0 0 30px rgba(167, 139, 250, 0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.header {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #ec4899 100%);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  box-shadow: var(--shadow);
  border-bottom: 2px solid var(--border-glow);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(167, 139, 250, 0.1) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  text-shadow: var(--glow);
  position: relative;
  z-index: 1;
}

.subtitle {
  font-size: 0.9rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

/* Main Content */
.main-content {
  padding: 1rem;
}

/* Section Styles */
.form-section,
.output-section,
.info-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.section-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  color: var(--primary-color);
  padding-bottom: 0.5rem;
  flex: 1;
}

/* Clear Output Button */
.clear-output-btn {
  background: linear-gradient(135deg, var(--danger-color), #be123c);
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
  flex-shrink: 0;
}

.clear-output-btn:hover {
  background: linear-gradient(135deg, #be123c, var(--danger-color));
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.5);
  transform: translateY(-2px) rotate(90deg);
}

.clear-output-btn:active {
  transform: scale(0.95) translateY(0) rotate(90deg);
}

/* Combination Row */
.combination-row {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.combination-row:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-hover), var(--glow);
  transform: translateY(-2px);
}

.combination-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
  background: linear-gradient(90deg, var(--primary-dark), var(--secondary-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.combination-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  text-shadow: var(--glow);
}

/* Input Groups */
.input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.input-field {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents overflow on small screens */
  align-items: center; /* Center content horizontally */
}

.input-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
}

.input-field input:not(.num-input) {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
  color: var(--text-color);
  width: 100%;
  min-width: 0;
}

.input-field input:not(.num-input):focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--glow);
  background: var(--card-bg);
}

/* Number Inputs - Lotto Ball Design */
.num-input-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.lotto-ball {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin: 0 auto;
}

.lotto-ball:hover {
  transform: scale(1.05);
}

/* Lotto Ball Color Variants - Flat Design */
.lotto-ball.ball-red {
  background: #ff4444;
}

.lotto-ball.ball-blue {
  background: #4488ff;
}

.lotto-ball.ball-yellow {
  background: #ffdd44;
}

.lotto-ball.ball-green {
  background: #44ff88;
}

.lotto-ball.ball-orange {
  background: #ff8844;
}

.lotto-ball.ball-pink {
  background: #ff44aa;
}

.lotto-ball.ball-purple {
  background: #aa44ff;
}

.lotto-ball.ball-cyan {
  background: #44ddff;
}

.num-input {
  width: 100%;
  height: 100%;
  text-align: center;
  font-weight: bold;
  font-size: 1.75rem;
  background: transparent;
  border: none;
  color: #000000;
  text-shadow: none;
  position: relative;
  z-index: 1;
  padding: 0;
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;
}

/* Hide number input spinners */
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-input:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.num-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.buffer-input,
.amount-input {
  text-align: center;
  font-weight: bold;
  font-size: 1.25rem;
}

/* Adjust input group for very small screens */
@media (max-width: 360px) {
  .input-group {
    gap: 0.5rem;
  }
  
  .input-field input {
    padding: 0.65rem 0.35rem;
    font-size: 1rem;
  }
  
  .lotto-ball {
    width: 65px;
    height: 65px;
  }
  
  .num-input {
    font-size: 1.5rem;
  }
  
  .buffer-input,
  .amount-input {
    font-size: 1.1rem;
  }
  
  .input-field label {
    font-size: 0.75rem;
  }
}

@media (max-width: 340px) {
  .input-group {
    gap: 0.4rem;
  }
  
  .input-field input {
    padding: 0.6rem 0.25rem;
  }
  
  .lotto-ball {
    width: 60px;
    height: 60px;
  }
  
  .num-input {
    font-size: 1.3rem;
  }
  
  .buffer-input,
  .amount-input {
    font-size: 1rem;
  }
}

/* Checkbox Group */
.checkbox-group {
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-right: 0.75rem;
  cursor: pointer;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-secondary);
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.checkbox-label input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.5);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.checkbox-label span {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 600;
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  min-height: 44px;
  min-width: 44px;
}

.add-btn {
  background: linear-gradient(135deg, var(--success-color), #14b8a6);
  color: white;
  width: 100%;
  padding: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.add-btn:hover {
  background: linear-gradient(135deg, #14b8a6, var(--success-color));
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.add-btn:active {
  transform: scale(0.98) translateY(0);
}

.import-btn-header {
  background: linear-gradient(135deg, var(--success-color), #14b8a6);
  color: white;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
  flex-shrink: 0;
}

.import-btn-header:hover {
  background: linear-gradient(135deg, #14b8a6, var(--success-color));
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.import-btn-header:active {
  transform: scale(0.98) translateY(0);
}

.btn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

/* Cost Monitor */
.cost-monitor {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  animation: fadeIn 0.3s ease;
}

.cost-monitor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cost-monitor-row:last-child {
  margin-bottom: 0;
}

.cost-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
}

.cost-value {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
}

.cost-highlight {
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generate-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
  color: white;
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: var(--glow-intense);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.generate-btn:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-dark));
  box-shadow: 0 0 40px rgba(167, 139, 250, 0.8);
  transform: translateY(-2px);
}

.generate-btn:active {
  transform: scale(0.98) translateY(0);
}

.remove-btn {
  background: linear-gradient(135deg, var(--danger-color), #be123c);
  color: white;
  width: 100%;
  padding: 0.625rem;
  font-size: 0.875rem;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

.remove-btn:hover {
  background: linear-gradient(135deg, #be123c, var(--danger-color));
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.5);
  transform: translateY(-2px);
}

/* Output Section */
.output-area {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  color: var(--primary-bright);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.output-area:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), var(--glow);
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.action-btn {
  padding: 0.875rem;
  font-size: 0.9rem;
}

.copy-btn {
  background: linear-gradient(135deg, var(--secondary-color), #f472b6);
  color: white;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.copy-btn:hover {
  background: linear-gradient(135deg, #f472b6, var(--secondary-color));
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
  transform: translateY(-2px);
}

.print-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: white;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.print-btn:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.download-btn {
  background: linear-gradient(135deg, var(--success-color), #14b8a6);
  color: white;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
  background: linear-gradient(135deg, #14b8a6, var(--success-color));
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.export-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.export-btn:hover {
  background: linear-gradient(135deg, #f97316, #f59e0b);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

/* Info Section */
.info-section h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
  text-shadow: var(--glow);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.info-card h4 {
  color: var(--primary-bright);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.info-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.info-card strong {
  color: var(--secondary-color);
  font-weight: 600;
}

.output-example {
  background: var(--bg-secondary);
  border: 2px solid var(--border-glow);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.output-example strong {
  color: var(--primary-color);
  font-size: 0.95rem;
}

.output-example code {
  background: var(--card-bg);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: var(--primary-bright);
  display: inline-block;
  margin: 0.5rem 0;
  border: 1px solid var(--border-color);
}

/* Disclaimer Section */
.disclaimer-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 2px solid var(--danger-color);
}

.disclaimer-section h3 {
  font-size: 1.25rem;
  color: var(--danger-color);
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: var(--glow);
}

.disclaimer-content {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

.disclaimer-content p {
  margin-bottom: 0.75rem;
}

.disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.disclaimer-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.disclaimer-list li::before {
  content: '•';
  position: absolute;
  left: 0.5rem;
  color: var(--danger-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--card-bg);
  border-top: 2px solid var(--border-color);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-copyright {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.app-version {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.8rem;
}

.footer-author {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.footer-author a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer-author a:hover {
  color: var(--primary-bright);
  text-shadow: var(--glow);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 200px;
  justify-content: center;
}

.footer-link:hover {
  border-color: var(--primary-color);
  background: var(--card-bg);
  color: var(--primary-bright);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.link-icon {
  font-size: 1rem;
}

/* Desktop Styles */
@media (min-width: 768px) {
  .header h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .main-content {
    padding: 2rem;
  }

  .form-section,
  .output-section,
  .info-section,
  .disclaimer-section {
    padding: 2rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .combination-row {
    padding: 1.5rem;
  }

  .input-group {
    gap: 1.5rem;
  }

  .action-buttons {
    gap: 1.5rem;
  }

  .output-area {
    font-size: 1rem;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .disclaimer-content {
    font-size: 1rem;
  }

  .footer-links {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .footer-link {
    min-width: 180px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }

  .action-buttons {
    grid-template-columns: repeat(2, minmax(200px, 300px));
    justify-content: center;
  }
}

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

.combination-row {
  animation: fadeIn 0.3s ease;
}

/* Touch Feedback */
@media (hover: none) {
  button:active {
    opacity: 0.8;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .print-content {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 12pt;
    line-height: 1.6;
    padding: 20px;
  }

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10pt;
    padding: 10px;
    border-top: 1px solid #ccc;
    background: white;
  }

  .print-footer p {
    margin: 5px 0;
  }
}

/* Mobile responsive for action buttons */
@media (max-width: 480px) {
  .action-buttons {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .section-header {
    flex-wrap: wrap;
  }

  .section-header h2 {
    flex: 1 1 100%;
    margin-bottom: 0.5rem;
  }

  .import-btn-header {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 360px) {
  .import-btn-header {
    font-size: 0.75rem;
    padding: 0.5rem 0.625rem;
    gap: 0.25rem;
  }
}

