@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&family=JetBrains+Mono&display=swap");

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
}

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

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 900px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.8s ease-out;
}

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

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  font-size: 1rem;
}

#drop-zone {
  position: relative;
  border: 2px dashed var(--glass-border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  margin-bottom: 1.5rem;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: scale(1.01);
}

#drop-zone i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: block;
}

#file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

button {
  font-family: inherit;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#convert-btn {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

#convert-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

#convert-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

#download-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

#download-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.status-container {
  margin-bottom: 2rem;
  text-align: center;
  min-height: 1.5rem;
}

#status {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.status-success {
  color: var(--success) !important;
}
.status-error {
  color: var(--error) !important;
}

.output-area {
  margin-top: 2rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 2rem;
  display: none;
}

.output-area.visible {
  display: block;
  animation: slideUp 0.5s ease-out;
}

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

pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  max-height: 400px;
  border: 1px solid var(--glass-border);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Output Area Headers and Controls */
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.output-header h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.view-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.toggle-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 400;
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Markdown Preview Styling */
.markdown-body {
  background: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-main);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.3rem;
}

.markdown-body p {
  margin-bottom: 1rem;
}
.markdown-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.markdown-body pre code {
  background: transparent;
}
.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--glass-border);
  padding: 0.5rem;
  text-align: left;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.05);
}

.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
}

.markdown-body .mermaid {
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

/* Security Info Section */
.security-info {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--glass-border);
}

.security-info h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.8rem;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.security-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s;
}

.security-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.04);
}

.security-item i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.security-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

.security-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Custom scrollbar for markdown-body */
.markdown-body::-webkit-scrollbar {
  width: 8px;
}
.markdown-body::-webkit-scrollbar-track {
  background: transparent;
}
.markdown-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Custom scrollbar */
pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
pre::-webkit-scrollbar-track {
  background: transparent;
}
pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
