/* OptimizED Template Transformer Styles */

:root {
  --optimized-teal: #4D7673;
  --optimized-gold: #C1A76E;
  --optimized-light: #F8F9FA;
  --optimized-dark: #2C3E50;
  --optimized-grey: #6C757D;
  --optimized-white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Lato', sans-serif;
  background-color: var(--optimized-light);
  color: var(--optimized-dark);
  line-height: 1.6;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, var(--optimized-teal) 0%, #5a8a87 100%);
  color: var(--optimized-white);
  padding: 2rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  height: 80px;
  width: auto;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  font-style: italic;
  margin: 0;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Upload Section */
.upload-section {
  background: var(--optimized-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.upload-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--optimized-teal);
  margin-bottom: 1rem;
  text-align: center;
}

.upload-section > p {
  text-align: center;
  color: var(--optimized-grey);
  margin-bottom: 2rem;
}

.upload-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.upload-tab {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--optimized-white);
}

.upload-tab.active {
  border-color: var(--optimized-teal);
  background: rgba(77, 118, 115, 0.05);
}

.upload-tab:hover {
  border-color: var(--optimized-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.upload-tab h3 {
  color: var(--optimized-teal);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-area {
  border: 3px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--optimized-teal);
  background: rgba(77, 118, 115, 0.05);
}

#file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-text p {
  margin: 0.5rem 0;
  color: var(--optimized-grey);
}

.file-types {
  font-size: 0.9rem;
  font-style: italic;
}

#text-input {
  width: 100%;
  height: 150px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.3s ease;
}

#text-input:focus {
  outline: none;
  border-color: var(--optimized-teal);
  box-shadow: 0 0 0 3px rgba(77, 118, 115, 0.1);
}

#google-doc-url {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 1rem;
  transition: border-color 0.3s ease;
}

#google-doc-url:focus {
  outline: none;
  border-color: var(--optimized-teal);
  box-shadow: 0 0 0 3px rgba(77, 118, 115, 0.1);
}

/* Buttons */
.btn-primary, .btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--optimized-teal);
  color: var(--optimized-white);
}

.btn-primary:hover {
  background: #3d605d;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
  background: var(--optimized-grey);
  color: var(--optimized-white);
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#process-btn {
  display: block;
  margin: 0 auto;
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

/* Editor Section */
.editor-section {
  background: var(--optimized-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.editor-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--optimized-teal);
  margin-bottom: 1rem;
  text-align: center;
}

.editor-toolbar {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.format-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.action-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.format-dropdown {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
  margin-right: 1rem;
}

.format-btn {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.format-btn:hover {
  background: var(--optimized-teal);
  color: white;
  border-color: var(--optimized-teal);
}

.format-btn.active {
  background: var(--optimized-teal);
  color: white;
  border-color: var(--optimized-teal);
}

.editor-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  min-height: 500px;
}

.document-outline {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  border-left: 4px solid var(--optimized-teal);
}

.document-outline h3 {
  color: var(--optimized-teal);
  margin: 0 0 1rem 0;
  font-family: 'Playfair Display', serif;
}

.editor-content {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

#document-editor {
  min-height: 500px;
  padding: 2rem;
  background: var(--optimized-white);
  font-size: 1rem;
  line-height: 1.6;
}

/* Document Preview Styles */
.document-preview {
  font-family: 'Lato', sans-serif;
  line-height: 1.8;
  max-width: 8.5in;
  margin: 0 auto;
  padding: 1in;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Editable Elements */
.editable-element {
  position: relative;
  cursor: pointer;
  margin: 0.5rem 0;
  padding: 0.25rem;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.editable-element:hover {
  border-color: var(--optimized-gold);
  background: rgba(193, 167, 110, 0.05);
}

.editable-element.selected {
  border-color: var(--optimized-teal);
  background: rgba(77, 118, 115, 0.05);
}

.editable-element.editing {
  border-color: var(--optimized-teal);
  background: white;
  outline: none;
}

/* 7 Header Level Styles */
.document-preview .header-1 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-teal);
  font-size: 2.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--optimized-gold);
}

.document-preview .header-2 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-teal);
  font-size: 2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--optimized-gold);
}

.document-preview .header-3 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-teal);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
}

.document-preview .header-4 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-dark);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

.document-preview .header-5 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-dark);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem 0;
}

.document-preview .header-6 {
  font-family: 'Lato', sans-serif;
  color: var(--optimized-dark);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.75rem 0 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.document-preview .header-7 {
  font-family: 'Lato', sans-serif;
  color: var(--optimized-grey);
  font-size: 1rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem 0;
  font-style: italic;
}

.document-preview h1 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-teal);
  font-size: 2.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--optimized-gold);
}

.document-preview h2 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-teal);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
}

.document-preview h3 {
  font-family: 'Playfair Display', serif;
  color: var(--optimized-dark);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
}

.document-preview p {
  margin: 1rem 0;
  text-align: justify;
  color: var(--optimized-dark);
}

.document-preview ul, .document-preview ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.document-preview li {
  margin: 0.5rem 0;
  color: var(--optimized-dark);
}

.document-preview ul li::marker {
  color: var(--optimized-teal);
}

/* Image Styles */
.document-image {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
}

.image-container {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.image-caption {
  font-size: 0.9rem;
  color: var(--optimized-grey);
  font-style: italic;
  margin-top: 0.5rem;
}

/* List Styles */
.bullet-list {
  list-style-type: disc;
  margin: 1rem 0;
  padding-left: 2rem;
}

.number-list {
  list-style-type: decimal;
  margin: 1rem 0;
  padding-left: 2rem;
}

.indent-1 { margin-left: 2rem; }
.indent-2 { margin-left: 4rem; }
.indent-3 { margin-left: 6rem; }
.indent-4 { margin-left: 8rem; }

/* Formatting Styles */
.bold-text { font-weight: bold; }
.italic-text { font-style: italic; }
.underline-text { text-decoration: underline; }

/* Loading States */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    padding: 0 1rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .upload-methods {
    grid-template-columns: 1fr;
  }
  
  .editor-container {
    grid-template-columns: 1fr;
  }
  
  .document-outline {
    order: 2;
  }
  
  .editor-toolbar {
    justify-content: flex-start;
  }
  
  .btn-primary, .btn-secondary {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

/* Print Styles */
@media print {
  .header, .upload-section, .editor-toolbar {
    display: none;
  }
  
  .editor-section {
    box-shadow: none;
    padding: 0;
  }
  
  .document-preview {
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
}