:root {
    --bg-primary: #000000;
    --bg-secondary: rgba(28, 28, 30, 0.72);
    --bg-tertiary: rgba(44, 44, 46, 0.5);
    --bg-card: rgba(28, 28, 30, 0.8);
    --bg-input: rgba(44, 44, 46, 0.6);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;
    --divider: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-blue: #0a84ff;
    --accent-purple: #5e5ce6;
    --accent-violet: #bf5af2;
    --gradient-start: #5e5ce6;
    --gradient-end: #bf5af2;
    --success: #30d158;
    --warning: #ff9f0a;
    --error: #ff375f;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background: var(--bg-secondary);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--divider);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 22px;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-violet);
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
}

.user-name {
    font-size: 12px;
    font-weight: 400;
}

.btn-login, .btn-logout {
    padding: 4px 12px;
    border-radius: 980px;
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.2s;
    cursor: pointer;
    border: none;
    font-size: 12px;
}

.btn-login {
    background: var(--accent-blue);
    color: white;
}

.btn-login:hover {
    opacity: 0.9;
}

.btn-logout {
    background: transparent;
    border: 0.5px solid var(--glass-border);
    color: var(--text-secondary);
    opacity: 0.8;
}

.btn-logout:hover {
    opacity: 1;
}

/* Landing Page */
.landing-page {
    background: var(--bg-primary);
}

.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.07;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: var(--accent-blue);
    color: white;
    border-radius: 980px;
    font-weight: 400;
    font-size: 17px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-cta:hover {
    opacity: 0.9;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
}

.visual-mockup {
    background: var(--bg-card);
    border-radius: 18px;
    border: 0.5px solid var(--glass-border);
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.mockup-header {
    margin-bottom: 1rem;
}

.mockup-dots {
    display: flex;
    gap: 0.5rem;
}

.mockup-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.mockup-dots span:nth-child(1) { background: #ff5f57; }
.mockup-dots span:nth-child(2) { background: #febc2e; }
.mockup-dots span:nth-child(3) { background: #28c840; }

.mockup-body {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mockup-slide {
    flex: 1;
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: 12px;
    border: 0.5px solid var(--glass-border);
}

.mockup-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.mockup-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mockup-lines span {
    height: 8px;
    background: var(--divider);
    border-radius: 4px;
}

.mockup-lines span:nth-child(1) { width: 100%; }
.mockup-lines span:nth-child(2) { width: 85%; }
.mockup-lines span:nth-child(3) { width: 70%; }

.mockup-arrow {
    font-size: 2rem;
    color: var(--accent-purple);
}

.mockup-slide-result {
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.15), rgba(191, 90, 242, 0.15));
    border: 0.5px solid var(--accent-purple);
}

.mockup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.mockup-block {
    height: 24px;
    background: var(--accent-purple);
    border-radius: 4px;
    opacity: 0.4;
}

.mockup-block:nth-child(3) {
    grid-column: span 2;
}

/* Features */
.features {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 18px;
    border: 0.5px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 15px;
}

/* How it Works */
.how-it-works {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 3rem;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.step {
    text-align: center;
    flex: 1;
}

.step-number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--divider);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 0.5px solid var(--divider);
}

/* App Page */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    height: calc(100vh - 44px);
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    height: 100%;
}

.panel {
    background: var(--bg-card);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 18px;
    border: 0.5px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 0.5px solid var(--divider);
}

.panel-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-purple);
}

.panel-input {
    overflow-y: auto;
}

.input-section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* Paste Zone */
.paste-zone {
    border-radius: 12px;
    transition: border-color 0.2s, background-color 0.2s;
}

.paste-zone:focus-within, .paste-zone:hover {
    background: rgba(94, 92, 230, 0.05);
}

.paste-zone.pasted {
    background: rgba(48, 209, 88, 0.1);
}

.paste-zone-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    color: var(--accent-purple);
}

.paste-hint {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.paste-hint-small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-content {
  width: 100%;
  background: #ffffff;
  border: 0.5px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  color: #000000;
  font-size: 14px;
  min-height: 150px;
  font-family: inherit;
  overflow: auto;
}

.text-content:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.text-content img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    margin: 8px 0;
    border-radius: 8px;
    max-height: 300px;
    object-fit: contain;
}

[contenteditable]:empty:before {
  content: attr(placeholder);
  color: #888;
}

/* Upload Zone */
.upload-zone {
    background: var(--bg-input);
    border: 1px dashed var(--divider);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--accent-purple);
    background: rgba(94, 92, 230, 0.08);
}

.upload-zone.drag-over {
    border-color: var(--accent-purple);
    background: rgba(94, 92, 230, 0.12);
}

.upload-zone-content {
    pointer-events: none;
}

.upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 1rem;
    color: var(--accent-purple);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

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

/* Extract PPTX Preview */
.extract-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 0.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 12px;
    margin-top: 8px;
}

.extract-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.extract-file-info svg {
    color: var(--accent-violet);
}

#extractedContent {
    margin-top: 8px;
}

.btn-extract {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: var(--bg-input);
    border: 0.5px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.btn-extract:hover {
    opacity: 0.8;
}

/* Image Preview */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 0.5px solid var(--glass-border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Template Preview */
.template-zone {
    padding: 1.5rem;
}

.template-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 0.5px solid var(--accent-purple);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.template-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 14px;
}

.btn-clear-template {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.btn-clear-template:hover {
    color: var(--error);
}

/* Additional Prompt */
.additional-prompt {
    width: 100%;
    background: var(--bg-input);
    border: 0.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.additional-prompt:focus {
    outline: none;
    border-color: var(--accent-purple);
}

/* Generate Button */
.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 12px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: auto;
}

.btn-generate:hover:not(:disabled) {
    background: #4090ff;
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Output Panel */
.panel-output {
    overflow-y: auto;
}

.output-content {
    flex: 1;
    overflow-y: auto;
}

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.output-placeholder h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Generated Result */
.generated-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-header {
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.15), rgba(191, 90, 242, 0.15));
    border: 0.5px solid var(--accent-purple);
    border-radius: 12px;
    padding: 1rem;
}

.result-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.result-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.slide-preview {
    background: var(--bg-input);
    border: 0.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
}

.slide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.slide-number {
    background: var(--accent-purple);
    color: white;
    padding: 2px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
}

.slide-layout {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.slide-title-text {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 0.5rem;
}

.slide-content-list {
    list-style: none;
    padding-left: 0;
}

.slide-content-list li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.slide-content-list li::before {
    content: "• ";
    color: var(--accent-purple);
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-download:hover {
    opacity: 0.9;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--divider);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-title {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.loading-text {
  color: var(--text-secondary);
}

/* Typewriter Output */
.typewriter-container {
  background: var(--bg-card);
  border: 0.5px solid var(--accent-purple);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.typewriter-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 0.5px solid var(--divider);
}

.typewriter-indicator {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.typewriter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.typewriter-content {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.typewriter-cursor {
  display: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typewriter-slide {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border-radius: 8px;
}

.typewriter-slide-header {
  color: var(--accent-purple);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.typewriter-field {
  color: var(--text-secondary);
  margin-left: 1rem;
}

.typewriter-field-name {
  color: var(--accent-blue);
}

.typewriter-field-value {
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .main-container {
        height: auto;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto 2rem;
    }

    .steps {
        flex-direction: column;
    }

    .step-connector {
        width: 2px;
        height: 40px;
    }
}
