/* Xperto Magic Tables - Main Stylesheet */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  padding: 20px;
}

.converter-container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 10%);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #003473 0%, #425500 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.1rem;
  opacity: .9;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 600px;
}

.input-section, .output-section {
  padding: 30px;
}

.input-section {
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #003473;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-description {
  font-size: .95rem;
  color: #6c757d;
  margin-bottom: 20px;
  line-height: 1.5;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.config-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.config-item label {
  display: block;
  font-weight: 500;
  color: #425500;
  margin-bottom: 8px;
}

.config-item input[type='checkbox'] {
  transform: scale(1.2);
  margin-right: 8px;
}

.config-item input[type='text'] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.config-item input[type='text']:focus {
  border-color: #84bd00;
  outline: none;
  box-shadow: 0 0 0 2px rgb(132 189 0 / 20%);
}

.format-selector {
  margin-bottom: 20px;
}

.format-tabs {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e9ecef;
  margin-top: 10px;
}

.format-tab {
  flex: 1;
  padding: 12px 20px;
  background: #f8f9fa;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  color: #6c757d;
}

.format-tab:hover {
  background: #e9ecef;
  color: #495057;
}

.format-tab.active {
  background: linear-gradient(135deg, #84bd00 0%, #425500 100%);
  color: white;
}

.data-input {
  width: 100%;
  height: 300px;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color .2s ease;
}

.data-input:focus {
  border-color: #84bd00;
  outline: none;
  box-shadow: 0 0 0 3px rgb(132 189 0 / 10%);
}

.convert-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #84bd00 0%, #425500 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
  margin-top: 20px;
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgb(132 189 0 / 30%);
}

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

.output-textarea {
  width: 100%;
  height: 400px;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: #f8f9fa;
  resize: vertical;
}

.copy-btn {
  padding: 12px 24px;
  background: #003473;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  margin-top: 15px;
}

.copy-btn:hover {
  background: #002556;
  transform: translateY(-1px);
}

.copy-success {
  background: #84bd00 !important;
}

.example-section {
  background: #e8f5d8;
  padding: 20px;
  margin: 20px;
  border-radius: 8px;
  border-left: 4px solid #84bd00;
}

.example-section h3 {
  color: #425500;
  margin-bottom: 10px;
}

.example-table {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #003473;
  background: white;
  padding: 10px;
  border-radius: 4px;
  white-space: pre-line;
}

.footer {
  background: #f8f9fa;
  padding: 20px 30px;
  text-align: center;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
}

/* Loading animation */
.converting {
  background: linear-gradient(45deg, #84bd00, #425500, #84bd00);
  background-size: 300% 300%;
  animation: gradient-shift 1.5s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }

  50% { background-position: 100% 50%; }

  100% { background-position: 0% 50%; }
}

/* Collapsible sections */
.collapsible-section {
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.collapsible-header {
  background: #f8f9fa;
  padding: 15px 20px;
  cursor: pointer;
  user-select: none;
  transition: background-color .2s ease;
  border-bottom: 1px solid #e9ecef;
}

.collapsible-header:hover {
  background: #e9ecef;
}

.collapsible-header.active {
  background: #e8f5d8;
  border-bottom-color: #84bd00;
}

.collapsible-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #425500;
  font-size: 1.1rem;
}

.collapsible-toggle {
  font-size: 1.2rem;
  transition: transform .2s ease;
}

.collapsible-header.active .collapsible-toggle {
  transform: rotate(180deg);
}

.collapsible-content {
  padding: 20px;
  display: none;
}

.collapsible-content.active {
  display: block;
}

/* Color customization */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.color-group label {
  font-weight: 600;
  color: #425500;
  margin-bottom: 8px;
  display: block;
}

/* Responsive Design */
@media (width <= 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
    
  .input-section {
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }
    
  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (width <= 640px) {
  .header h1 {
    font-size: 2rem;
  }
    
  .main-content {
    padding: 15px;
  }
    
  .input-section, .output-section {
    padding: 20px;
  }
}