:root {
  --primary: #4361ee;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f5f7ff;
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* App Card */
.app-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 30px;
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header h1 i {
  color: var(--primary);
}

.subtitle {
  font-size: 1rem;
  color: var(--gray);
  font-weight: 400;
}

/* Control Card */
.control-card,
.output-card {
  background: var(--light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
}

/* Form Controls */
.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-input,
.number-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.3s ease;
  background: white;
  color: var(--dark);
}

.select-input:focus,
.number-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Number Selector */
.number-selector {
  display: flex;
  align-items: center;
  background: var(--light);
  border-radius: 8px;
  overflow: hidden;
  width: 140px;
  border: 1px solid #dee2e6;
}

.selector-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-btn:hover {
  background: var(--primary);
}

.selector-btn.minus {
  border-radius: 8px 0 0 8px;
}

.selector-btn.plus {
  border-radius: 0 8px 8px 0;
}

#recordCount {
  width: 60px;
  height: 40px;
  border: none;
  background: var(--light);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Options */
.toggle-group {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid #dee2e6;
}

.toggle-group h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding-left: 60px;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle-slider {
  position: absolute;
  left: 0;
  width: 50px;
  height: 26px;
  background-color: #adb5bd;
  border-radius: 34px;
  transition: background-color 0.3s ease;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-weight: 500;
  color: var(--dark);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  min-width: 200px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--light);
  color: var(--dark);
  border: 1px solid #dee2e6;
}

.btn-secondary:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Output Card */
.output-card {
  background: var(--light);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e9ecef;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 20px;
}

.output-header h2 {
  font-size: 1.5rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.export-options {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.export-options span {
  font-weight: 500;
  color: var(--gray);
}

.btn-export {
  padding: 10px 18px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  color: var(--dark);
}

.btn-export:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Output Container */
.output-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  color: var(--gray);
  text-align: center;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.2rem;
  font-weight: 500;
}

/* Data Items */
.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.data-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.1);
}

.data-content {
  font-family: "Courier New", monospace;
  font-size: 1rem;
  color: var(--dark);
  word-break: break-all;
  flex: 1;
  margin-right: 20px;
}

.data-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: none;
  background: var(--light);
  color: var(--gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}


/* Responsive Design */
@media (max-width: 768px) {
  .app-card {
    padding: 20px;
  }

  .header h1 {
    font-size: 1.8rem;
    flex-direction: column;
    gap: 5px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    min-width: 100%;
  }

  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .export-options {
    justify-content: flex-start;
  }

  .data-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .data-actions {
    align-self: flex-end;
  }

  .toggle-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .btn-export {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .output-container {
    max-height: 400px;
  }
}

/* Animation for Data Generation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.data-item {
  animation: fadeIn 0.3s ease;
}
