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

html,
body {
  direction: rtl;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 800px;
  margin-top: 20px;
}

h1 {
  text-align: center;
  color: #4a5568;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 300;
  color: #667eea;
}

.input-section {
  margin-bottom: 30px;
  overflow-x: scroll;
}

textarea {
  direction: ltr;
  width: 100%;
  min-height: 200px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  background: #f8fafc;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

textarea::placeholder {
  color: #a0aec0;
  font-style: italic;
}

.button-group {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.options-section {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.options-section label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.options-section input {
  margin-left: 0;
}

.options-section input[type="number"] {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.options-section input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

button {
  padding: 15px 30px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

button:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

button:hover:before {
  left: 100%;
}

button:first-child {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
}

button:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
}

#copyPrompt {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

#copyPrompt:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#saveModel {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
}

#saveModel:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
}

#loadModel {
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
}

#loadModel:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(66, 153, 225, 0.3);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.result-section {
  background: #f8fafc;
  border-radius: 15px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  min-height: 100px;
  line-height: 1.6;
}

.result-section:empty {
  display: none;
}

.result-section:not(:empty) {
  border-color: #48bb78;
  background: #f0fff4;
}

.success-message {
  background: #48bb78;
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  text-align: center;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInUp 0.3s ease;
  max-width: 300px;
  font-weight: 500;
}

.error-message {
  background: #f56565;
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  text-align: center;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInUp 0.3s ease;
  max-width: 400px;
  font-weight: 500;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  padding-right: 20px;
}

.error-close-button {
  position: absolute !important;
  top: 3px !important;
  right: 3px !important;
  background: #e53e3e !important;
  color: white !important;
  border: none !important;
  border-radius: 50% !important;
  width: 14px !important;
  height: 14px !important;
  cursor: pointer !important;
  font-size: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 1001 !important;
  line-height: 1 !important;
  font-weight: bold !important;
  min-width: 14px !important;
  max-width: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.error-close-button:hover {
  background: #c53030 !important;
  transform: scale(1.1) !important;
}

.error-result {
  background: white;
  border: 2px solid #f56565;
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  direction: rtl;
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
}

.error-result h3 {
  color: #c53030;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 600;
}

.error-result pre {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
  direction: ltr;
  color: #2d3748;
  font-weight: 500;
}

.copy-error-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.copy-error-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.copy-error-btn:active {
  transform: translateY(0);
}

.copy-error-btn span {
  font-size: 16px;
}

.warning-message {
  background: #ed8936;
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  text-align: center;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInUp 0.3s ease;
  max-width: 400px;
  font-weight: 500;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  padding-right: 20px;
}

.warning-close-button {
  position: absolute !important;
  top: 3px !important;
  right: 3px !important;
  background: #dd6b20 !important;
  color: white !important;
  border: none !important;
  border-radius: 50% !important;
  width: 14px !important;
  height: 14px !important;
  cursor: pointer !important;
  font-size: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 1001 !important;
  line-height: 1 !important;
  font-weight: bold !important;
  min-width: 14px !important;
  max-width: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.warning-close-button:hover {
  background: #c05621 !important;
  transform: scale(1.1) !important;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Lottery results styles */
.lottery-result {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  font-family: "Courier New", monospace;
  font-size: 14px;
}

.lottery-result h3 {
  color: #4a5568;
  margin-bottom: 15px;
  font-size: 1.3rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
}

.actual-numbers {
  color: #2d3748;
  font-weight: 600;
  background: #e6fffa;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #81e6d9;
}

.predictions {
  margin-top: 10px;
  padding: 10px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.8;
}

.prediction {
  color: #718096;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
  transition: all 0.2s ease;
}

.prediction.hit {
  background: #fed7d7;
  color: #c53030;
  font-weight: 600;
  border: 1px solid #feb2b2;
}

.prediction:hover {
  background: #edf2f7;
  color: #4a5568;
}

.prediction-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.prediction-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.prediction-number {
  color: #718096;
  font-weight: 600;
  min-width: 25px;
  margin-left: 8px;
}

/* Notification section styles */
.notification-section {
  margin-bottom: 20px;
  text-align: center;
}

/* Notification button styles */
#enableNotifications {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: white !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 10px !important;
  min-width: 180px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2) !important;
}

#enableNotifications:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3) !important;
}

#enableNotifications:before {
  display: none !important;
}

/* Progress bar styles */
.progress-container {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #48bb78, #38a169);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.progress-text {
  font-size: 16px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
    margin-top: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
  }

  button {
    width: 100%;
    max-width: 300px;
  }

  #enableNotifications {
    width: auto !important;
    max-width: none !important;
  }

  textarea {
    min-height: 150px;
    padding: 15px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .container {
    background: #1a202c;
    color: #e2e8f0;
  }

  textarea {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  textarea:focus {
    background: #2d3748;
  }

  .result-section {
    background: #2d3748;
    border-color: #4a5568;
  }

  .result-section:not(:empty) {
    background: #22543d;
    border-color: #48bb78;
  }

  .lottery-result {
    background: #2d3748;
    border-color: #4a5568;
  }

  .actual-numbers {
    background: #22543d;
    border-color: #48bb78;
    color: #e2e8f0;
  }

  .predictions {
    background: #2d3748;
    border-color: #4a5568;
  }

  .prediction {
    color: #a0aec0;
  }

  .prediction.hit {
    background: #742a2a;
    color: #fed7d7;
    border-color: #c53030;
  }

  .prediction:hover {
    background: #4a5568;
    color: #e2e8f0;
  }

  .prediction-row {
    border-bottom-color: #4a5568;
  }

  .prediction-number {
    color: #a0aec0;
  }

  .progress-container {
    background: #2d3748;
    border-color: #4a5568;
  }

  .progress-bar {
    background: #4a5568;
  }

  .progress-text {
    color: #e2e8f0;
  }

  .parameters-section {
    background: #2d3748;
    border-color: #4a5568;
  }

  .parameters-header {
    background: #4a5568;
  }

  .parameters-header:hover {
    background: #2d3748;
  }

  .parameters-header h3 {
    color: #e2e8f0;
  }

  .parameters-toggle {
    color: #e2e8f0;
  }

  .parameters-toggle:hover {
    color: #f7fafc;
  }

  .parameter-row label {
    color: #e2e8f0;
  }

  .parameter-constraints span {
    background: #4a5568;
    color: #a0aec0;
  }

  .parameter-actions {
    border-top-color: #4a5568;
  }
}

.parameters-section {
  margin: 20px 0;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.parameters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: #e9ecef;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
}

.parameters-header:hover {
  background: #dee2e6;
}

.parameters-header h3 {
  margin: 0;
  color: #495057;
  font-size: 1.1em;
  font-weight: 600;
}

.parameters-toggle {
  background: none;
  border: none;
  font-size: 18px;
  color: #495057;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  min-width: 24px;
}

.parameters-toggle:hover {
  color: #212529;
}

.parameters-toggle.collapsed {
  transform: rotate(-90deg);
}

.parameters-content {
  padding: 20px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.parameters-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.parameter-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 15px;
  flex-wrap: wrap;
}

.parameter-row label {
  min-width: 120px;
  font-weight: 500;
  color: #495057;
}

.parameter-row input {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  min-width: 100px;
}

.parameter-row input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.parameter-constraints {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 5px;
  margin-left: 135px;
}

.parameter-constraints span {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #6c757d;
  white-space: nowrap;
}

.parameter-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.reset-params-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-params-btn:hover {
  background: #5a6268;
}

.reset-params-btn:active {
  background: #545b62;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .parameter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .parameter-row label {
    min-width: auto;
  }

  .parameter-constraints {
    margin-left: 0;
  }
}
