* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  overflow: hidden;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { 
    transform: translateX(-100%) translateY(-100%) rotate(0deg); 
  }
  50% { 
    transform: translateX(0%) translateY(0%) rotate(180deg); 
  }
}

.header h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.header p {
  font-size: 1.1em;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.editor-pane, .preview-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pane-header {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  padding: 15px 20px;
  border-bottom: 2px solid #d1d5db;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pane-header::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 1; 
  }
  50% { 
    transform: scale(1.2); 
    opacity: 0.7; 
  }
}

#editor {
  flex: 1;
  border: none;
  resize: none;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
  background: #1e293b;
  color: #e2e8f0;
  outline: none;
  transition: all 0.3s ease;
}

#editor:focus {
  background: #0f172a;
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

#preview {
  flex: 1;
  padding: 20px;
  background: #ffffff;
  overflow-y: auto;
  border-left: 2px solid #e5e7eb;
  line-height: 1.7;
}

#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 {
  margin: 1.5em 0 0.5em 0;
  color: #1f2937;
  font-weight: 700;
}

#preview h1 {
  font-size: 2.5em;
  border-bottom: 3px solid #4f46e5;
  padding-bottom: 10px;
}

#preview h2 {
  font-size: 2em;
  border-bottom: 2px solid #7c3aed;
  padding-bottom: 8px;
}

#preview h3 {
  font-size: 1.5em;
  color: #4f46e5;
}

#preview p {
  margin: 1em 0;
  color: #374151;
}

#preview code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #dc2626;
}

#preview pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1em 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#preview blockquote {
  border-left: 4px solid #4f46e5;
  padding-left: 20px;
  margin: 1em 0;
  color: #6b7280;
  font-style: italic;
  background: #f8fafc;
  padding: 15px 20px;
  border-radius: 0 10px 10px 0;
}

#preview ul, #preview ol {
  margin: 1em 0;
  padding-left: 2em;
}

#preview li {
  margin: 0.5em 0;
  color: #374151;
}

#preview a {
  color: #4f46e5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

#preview a:hover {
  border-bottom-color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

#preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#preview th, #preview td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

#preview th {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  font-weight: 600;
}

#preview tr:hover {
  background: rgba(79, 70, 229, 0.05);
}

.toolbar {
  padding: 15px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toolbar button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.toolbar button:active {
  transform: translateY(0);
}

.save-indicator {
  margin-left: auto;
  padding: 6px 12px;
  background: #10b981;
  color: white;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-indicator.show {
  opacity: 1;
}

@media (max-width: 768px) {
  .editor-container {
    flex-direction: column;
  }
  
  .editor-pane, .preview-pane {
    flex: none;
    height: 50%;
  }
  
  #preview {
    border-left: none;
    border-top: 2px solid #e5e7eb;
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  font-size: 1.1em;
  text-align: center;
}

.empty-state::before {
  content: '📝';
  font-size: 4em;
  margin-bottom: 20px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-10px); 
  }
}