/* Layout and Grid Fixes */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
}

/* Editor Container - Fixed Height */
.editor-container {
  height: 400px;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.editor-container:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.editor-container .ql-container {
  height: calc(100% - 42px);
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.editor-container .ql-editor {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  line-height: 1.6;
  padding: 1rem;
}

.editor-container .ql-toolbar {
  border: none;
  border-bottom: 1px solid #e5e7eb;
}

/* Output Textarea - Fixed Height */
.output-textarea {
  height: 400px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.output-textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  outline: none;
}

/* Header Gradient */
.header-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Button Styling */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-success {
  background-color: #10b981;
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-linkedin {
  background-color: #0077b5;
  color: white;
}

.btn-linkedin:hover {
  background-color: #005885;
}

/* Emoji Picker Button */
.emoji-picker-button, .divider-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  cursor: pointer;
  font-size: 16px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0;
  transition: all 0.15s ease;
}

.emoji-picker-button:hover, .divider-picker-button:hover {
  background-color: #f3f4f6;
  transform: scale(1.05);
}

/* Divider Dropdown */
.divider-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  width: 280px;
  padding: 16px;
  margin-top: 8px;
}

.divider-dropdown.show {
  display: block;
  animation: fadeInUp 0.2s ease;
}

.divider-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: monospace;
  font-size: 14px;
  text-align: center;
}

.divider-option:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.divider-option .divider-preview {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.divider-option .divider-text {
  font-size: 16px;
  color: #1f2937;
  letter-spacing: 1px;
}

/* Emoji Dropdown */
.emoji-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  width: 350px;
  padding: 16px;
  margin-top: 8px;
}

.emoji-dropdown.show {
  display: block;
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: all 0.15s ease;
}

.emoji-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.emoji-category {
  margin-bottom: 16px;
}

.emoji-category-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 18px;
  transition: all 0.15s ease;
}

.emoji-item:hover {
  background-color: #f3f4f6;
  transform: scale(1.15);
}

/* Stats Panel */
.stats-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn-loading {
  position: relative;
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .emoji-dropdown {
    width: 300px;
    padding: 12px;
  }
  
  .emoji-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .emoji-dropdown, .divider-dropdown {
    background-color: #1f2937;
    border-color: #374151;
  }
  
  .emoji-category-title {
    color: #9ca3af;
  }
  
  .emoji-item:hover {
    background-color: #374151;
  }
  
  .emoji-picker-button, .divider-picker-button {
    background: #1f2937;
    border-color: #374151;
    color: white;
  }
  
  .emoji-search {
    background-color: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
  }
  
  .stats-panel {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #374151;
  }
  
  .divider-option {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }
  
  .divider-option:hover {
    background: #4b5563;
  }
  
  .divider-option .divider-preview {
    color: #9ca3af;
  }
  
  .divider-option .divider-text {
    color: #f3f4f6;
  }
}

/* Custom Scrollbars */
.emoji-dropdown::-webkit-scrollbar,
.output-textarea::-webkit-scrollbar,
.ql-editor::-webkit-scrollbar {
  width: 8px;
}

.emoji-dropdown::-webkit-scrollbar-track,
.output-textarea::-webkit-scrollbar-track,
.ql-editor::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.emoji-dropdown::-webkit-scrollbar-thumb,
.output-textarea::-webkit-scrollbar-thumb,
.ql-editor::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.emoji-dropdown::-webkit-scrollbar-thumb:hover,
.output-textarea::-webkit-scrollbar-thumb:hover,
.ql-editor::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}