/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  border-radius: var(--border-radius);
  padding: 6px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  background: var(--gray-100);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.tab-content {
  display: none;
}

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

/* Output Section */
.output-section {
  margin-top: 16px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.output-header label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.base64-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-700);
  background: var(--gray-50);
  resize: vertical;
  word-break: break-all;
}

.base64-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-textarea {
  min-height: 200px;
}

.input-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.input-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Preview Container */
.preview-container {
  margin-bottom: 16px;
}

.preview-wrapper {
  max-width: 300px;
  margin: 0 auto 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.preview-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.checkerboard-bg {
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  padding: 8px;
}

.image-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.download-section {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.copy-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.copy-btn.copied {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.info-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.info-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.info-item p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 600px) {
  .tabs {
    flex-direction: column;
  }
  
  .input-actions {
    flex-direction: column;
  }
  
  .input-actions .btn {
    width: 100%;
  }
  
  .image-info {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}