@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #64748b;
  --light: #f8fafc;
  --dark: #0f172a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-800: #1e293b;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
}

/* Header Styles */
header {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Button Styles */
.format-btn, .paper-size-btn, .style-btn {
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.format-btn:hover, .paper-size-btn:hover, .style-btn:hover {
  background: var(--gray-100);
  border-color: var(--primary);
}

.format-btn.active, .paper-size-btn.active, .style-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.style-btn i {
  width: 20px;
  height: 20px;
}

/* Tab Styles */
.editor-tab, .result-tab {
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
}

.editor-tab.active, .result-tab.active {
  background: white;
  border-bottom: 2px solid var(--primary);
}

/* File Upload Area */
.border-dashed {
  border: 2px dashed var(--gray-300);
  transition: all 0.3s;
}

.border-dashed:hover {
  border-color: var(--primary);
  background-color: var(--gray-100);
}

/* Textarea Styles */
textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-family: 'Inter', monospace;
  resize: vertical;
}

textarea:focus {
  outline: none;
  ring: 2px solid var(--primary);
  border-color: var(--primary);
}

/* Select Styles */
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  background-color: white;
  font-family: 'Inter', sans-serif;
}

select:focus {
  outline: none;
  ring: 2px solid var(--primary);
  border-color: var(--primary);
}

/* Button Styles */
button {
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

#generate-btn {
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

#generate-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Results Section */
.result-tab {
  background: var(--gray-100);
  border: none;
  border-bottom: 1px solid var(--gray-300);
}

.result-tab.active {
  background: white;
  border-bottom: 2px solid var(--primary);
}

#html-result {
  background: var(--gray-100);
  min-height: 300px;
  max-height: 500px;
  overflow: auto;
  font-family: monospace;
}

/* Optimization Panel */
#optimize-panel {
  background: #dbeafe;
  border-radius: 0.5rem;
}

/* Dark Mode */
.dark {
  --light: #0f172a;
  --dark: #f8fafc;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-800: #f1f5f9;
}

.dark body {
  background-color: var(--light);
  color: var(--dark);
}

.dark header {
  background: var(--gray-100);
}

.dark .bg-white {
  background: var(--gray-100);
  color: var(--dark);
}

.dark .format-btn, 
.dark .paper-size-btn, 
.dark .style-btn,
.dark select,
.dark textarea {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--dark);
}

.dark .editor-tab, 
.dark .result-tab {
  background: var(--gray-200);
  color: var(--dark);
}

.dark .editor-tab.active, 
.dark .result-tab.active {
  background: var(--gray-100);
}

.dark #html-result {
  background: var(--gray-200);
  color: var(--dark);
}

/* Responsive Design */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  .format-btn, .paper-size-btn, .style-btn {
    padding: 0.75rem;
    font-size: 0.75rem;
  }
  
  .style-btn span {
    font-size: 0.625rem;
  }
}