/* css/presentation.css - Multi-mode with centered tabs & balanced layout */

:root {
    --presentation-accent: #009688;
    --presentation-accent-soft: #00968820;
}

/* Layout */
.presentation-main {
    padding: 1.5rem 1rem 2rem;
    min-height: calc(100vh - 140px);
    background: var(--bg-page);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================================================
   Mode Tabs (Report / Documentation / Case Presentation)
   Centered on desktop, scrollable on mobile
   ========================================================================= */
.mode-tabs {
    display: flex;
    justify-content: center;
    max-width: 420px;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 0.3rem;
    background: var(--surface);
    border-radius: 3rem;
    border: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    position: relative;
}

.mode-tabs::-webkit-scrollbar {
    display: none;
}

.mode-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.3rem;
    border: none;
    border-radius: 3rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-width: fit-content;
    font-family: inherit;
}

.mode-tab i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.mode-tab.active {
    background: var(--presentation-accent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 150, 136, 0.35);
}

.mode-tab.active i {
    transform: scale(1.1);
}

.mode-tab:hover:not(.active) {
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
}

/* =========================================================================
   Workspace Grid - 60/40 split for better proportions
   ========================================================================= */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.input-area {
    min-height: 300px;
    width: 100%
}

.input-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--presentation-accent);
}

.input-header i {
    font-size: 1.25rem;
}

.input-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Text input */
#textInput {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    min-height: 200px;
}

#textInput:focus {
    outline: none;
    border-color: var(--presentation-accent);
    box-shadow: 0 0 0 3px var(--presentation-accent-soft);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.clear-btn:hover {
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface);
    margin-top: 1rem;
}

.drop-zone:hover {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
    transform: translateY(-2px);
}

.drop-content i {
    font-size: 2.5rem;
    color: var(--presentation-accent);
    margin-bottom: 0.5rem;
}

.drop-content h4 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.drop-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* Attachment list */
.attachments-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    padding: 0.4rem 1rem 0.4rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.attachment-chip:hover {
    border-color: var(--presentation-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.attachment-chip img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

.attachment-chip .file-icon {
    width: 32px;
    height: 32px;
    background: var(--presentation-accent-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--presentation-accent);
}

.remove-attachment {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
}

.remove-attachment:hover {
    color: #dc2626;
    transform: scale(1.1);
}

/* =========================================================================
   Upload Modal
   ========================================================================= */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.upload-modal-card {
    position: relative;
    background: var(--surface);
    border-radius: 24px;
    max-width: 420px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.upload-modal-header {
    background: linear-gradient(135deg, var(--presentation-accent), #4f46e5);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.upload-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.upload-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.upload-modal-body {
    padding: 24px;
}

.upload-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.upload-option:hover {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
    transform: translateX(4px);
}

.upload-option:active {
    transform: scale(0.98);
}

.upload-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--presentation-accent-soft), #4f46e520);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-option-icon svg {
    width: 28px;
    height: 28px;
    color: var(--presentation-accent);
}

.upload-option-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.upload-option-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* =========================================================================
   Config Area
   ========================================================================= */

.config-area{
    background-color: var(--card-bg);
    padding: 1rem;
}

.config-area:hover {
  box-shadow: 0 20px 40px rgba(0, 150, 136, 0.3), 0 0 20px rgba(0, 150, 136, 0.3);
  transform: translateY(-4px);
  border-color: rgba(0, 150, 136, 0.5);
}

[data-theme="dark"] .config-area:hover {
  box-shadow: 0 20px 40px rgba(20, 184, 166, 0.4), 0 0 25px rgba(20, 184, 166, 0.4);
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(30, 42, 50, 0.6);
}

.config-area h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.config-area h3 i {
    color: var(--presentation-accent);
}

.config-mode-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.config-mode-section h3 i {
    color: var(--presentation-accent);
}

.patient-form {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--presentation-accent);
    box-shadow: 0 0 0 3px var(--presentation-accent-soft);
}

/* =========================================================================
   Suggested instruction chips (horizontally scrollable)
   ========================================================================= */
.suggested-instructions {
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.suggestion-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.suggestion-chips::-webkit-scrollbar {
    height: 4px;
}

.suggestion-chips::-webkit-scrollbar-track {
    background: transparent;
}

.suggestion-chips::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.5rem 1.1rem;
    border-radius: 2rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.suggestion-chip:hover {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.15);
}

.suggestion-chip:active {
    transform: scale(0.96);
    background: var(--presentation-accent);
    color: white;
    border-color: var(--presentation-accent);
}

.suggestion-chip.active {
    background: var(--presentation-accent);
    color: white;
    border-color: var(--presentation-accent);
}

/* =========================================================================
   Output size radio buttons (horizontal)
   ========================================================================= */
.output-size-selector {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0 0;
}

.output-size-selector > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.size-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.size-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--surface);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.size-option:hover {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
    transform: translateY(-1px);
}

.size-option input[type="radio"] {
    accent-color: var(--presentation-accent);
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.size-option:has(input:checked) {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
    font-weight: 600;
}

.size-option span {
    color: var(--text-primary);
    transition: color 0.2s;
}

.size-option:has(input:checked) span {
    color: var(--presentation-accent);
}

/* =========================================================================
   Outline Selector
   ========================================================================= */
.outline-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.outline-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.outline-option:hover {
    border-color: var(--presentation-accent);
    background: var(--presentation-accent-soft);
}

.outline-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--presentation-accent);
}

.outline-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

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

/* Custom Outline Textareas */
.config-mode-section textarea {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.config-mode-section textarea:focus {
    outline: none;
    border-color: var(--presentation-accent);
    box-shadow: 0 0 0 3px var(--presentation-accent-soft);
}

.config-mode-section textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Smooth transition when showing/hiding custom outlines */
.config-mode-section textarea[style*="display: block"] {
    animation: fadeSlideDown 0.3s ease;
}

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

/* Outline Hint */
.outline-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    background: var(--presentation-accent-soft);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: var(--presentation-accent);
    animation: fadeIn 0.3s ease;
}

.outline-hint i {
    font-size: 0.9rem;
}

.outline-hint span {
    flex: 1;
}

/* =========================================================================
   Generate Button
   ========================================================================= */
.generate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--presentation-accent);
    color: white;
    border: none;
    border-radius: 2.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 1.5rem;
    font-family: inherit;
}

.generate-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.3);
}

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

.generate-btn .fa-spinner {
    margin-right: 8px;
}

/* =========================================================================
   Results Container
   ========================================================================= */
.results-container {
    margin-top: 2rem;
    animation: fadeIn 0.4s ease;
}

.results-loading {
    text-align: center;
    padding: 3rem;
    background: var(--glass-bg);
    border-radius: 1.5rem;
    border: 1px solid var(--border-light);
}

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

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

.results-editor {
    background: var(--glass-bg);
    border-radius: 1.5rem;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
}

.toolbar-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.tool-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
}

.tool-btn:hover {
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
}

.tool-btn.secondary:hover {
    background: #fee2e2;
    color: #dc2626;
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    margin: 0 0.5rem;
}

.tool-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
}

.editor-content {
    min-height: 400px;
    padding: 1.5rem;
    outline: none;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface);
}

.editor-content:focus {
    outline: none;
}

.editor-content h1 { font-size: 1.8rem; border-bottom: 2px solid var(--presentation-accent); padding-bottom: 0.5rem; }
.editor-content h2 { font-size: 1.4rem; margin-top: 1.5rem; }
.editor-content h3 { font-size: 1.2rem; }
.editor-content ul, .editor-content ol { padding-left: 1.5rem; margin: 0.75rem 0; }

.editor-status {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#saveStatus {
    color: var(--presentation-accent);
}

/* =========================================================================
   History Drawer
   ========================================================================= */
.history-drawer {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    z-index: 1000;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
}

.history-drawer.active {
    left: 0;
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.history-search {
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
}

.history-search input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
}

.history-item {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item:hover {
    border-color: var(--presentation-accent);
    transform: translateX(-4px);
}

.history-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-info {
    flex: 1;
}

.history-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* =========================================================================
   Toast
   ========================================================================= */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: var(--surface);
    border-left: 4px solid var(--presentation-accent);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    animation: slideUp 0.3s ease;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #dc2626; }

/* =========================================================================
   Preview Modal
   ========================================================================= */
.preview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.preview-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.preview-card {
    position: relative;
    background: var(--surface);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.preview-card-header {
    background: linear-gradient(135deg, var(--presentation-accent), #4f46e5);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.preview-icon { font-size: 32px; }

.preview-card-header h3 { margin: 0; flex: 1; font-size: 1.25rem; }

.preview-close {
    background: rgba(255,255,255,0.2);
    border: none; color: white; font-size: 28px;
    cursor: pointer; width: 32px; height: 32px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    transition: all 0.2s;
}

.preview-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.preview-card-body { padding: 24px; }

.preview-info {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px;
    flex-wrap: wrap; gap: 8px;
}

.preview-badge {
    background: var(--presentation-accent-soft);
    color: var(--presentation-accent);
    padding: 6px 12px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600;
}

.preview-date { font-size: 0.8rem; color: var(--text-secondary); }

.preview-description { margin-bottom: 24px; line-height: 1.5; color: var(--text-primary); }

.preview-actions { display: flex; gap: 12px; margin-bottom: 16px; }

.preview-btn {
    flex: 1; padding: 12px 20px;
    border-radius: 40px; font-size: 1rem;
    font-weight: 600; cursor: pointer;
    transition: all 0.2s; border: none;
    text-align: center; white-space: nowrap;
    font-family: inherit;
}

.preview-btn.primary { background: var(--presentation-accent); color: white; }

.preview-btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.3);
}

.preview-btn.secondary { background: var(--surface); border: 1px solid var(--border-light); color: var(--text-primary); }

.preview-btn.secondary:hover { background: var(--border-light); transform: translateY(-2px); }

.preview-note { text-align: center; font-size: 0.8rem; color: var(--text-secondary); margin-top: 8px; }

/* =========================================================================
   Animations
   ========================================================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* =========================================================================
   Dark Mode
   ========================================================================= */
[data-theme="dark"] .upload-modal-card {
    background: #1e2a32;
}

[data-theme="dark"] .upload-option {
    background: #2e3b45;
    border-color: #3e4b55;
}

[data-theme="dark"] .upload-option:hover {
    background: #3e4b55;
    border-color: var(--presentation-accent);
}

[data-theme="dark"] .preview-card {
    background: #1e2a32;
}

[data-theme="dark"] .preview-btn.secondary {
    background: #2e3b45;
    color: #eef2f6;
    border-color: #3e4b55;
}

[data-theme="dark"] .preview-btn.secondary:hover {
    background: #3e4b55;
}

[data-theme="dark"] .config-mode-section textarea {
    background: rgba(30, 42, 50, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .config-mode-section textarea:focus {
    border-color: var(--presentation-accent);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.2);
}

[data-theme="dark"] .mode-tabs {
    background: #2e3b45;
    border-color: #3e4b55;
}

[data-theme="dark"] .mode-tab {
    color: #9aa8b5;
}

[data-theme="dark"] .mode-tab.active {
    background: var(--presentation-accent);
    color: #fff;
}

[data-theme="dark"] .mode-tab:hover:not(.active) {
    background: rgba(0, 150, 136, 0.2);
    color: var(--presentation-accent);
}

[data-theme="dark"] .suggestion-chip {
    background: #2e3b45;
    border-color: #3e4b55;
}

[data-theme="dark"] .suggestion-chip:hover {
    background: #3e4b55;
}

[data-theme="dark"] .suggestion-chip.active {
    background: var(--presentation-accent);
}

[data-theme="dark"] .size-option {
    background: #2e3b45;
    border-color: #3e4b55;
}

[data-theme="dark"] .size-option:hover {
    background: #3e4b55;
}

[data-theme="dark"] .size-option:has(input:checked) {
    background: rgba(0, 150, 136, 0.2);
}

/* =========================================================================
   Mobile Responsive
   ========================================================================= */
@media (max-width: 768px) {
    .mode-tabs {
        justify-content: flex-start;
        padding: 0.25rem;
        border-radius: 2.5rem;
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 2%,
            black 98%,
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 2%,
            black 98%,
            transparent 100%
        );
    }

    .mode-tab {
        padding: 0.55rem 1.1rem;
        font-size: 1rem;
        border-radius: 2.5rem;
    }

    .mode-tab i {
        font-size: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .workspace-grid {
        gap: 1rem;
    }

    .glass-card {
        padding: 0.75rem;
    }

    .suggestion-chips {
        gap: 0.4rem;
        padding: 0.25rem 0 0.4rem;
        flex-wrap: nowrap;
    }

    .suggestion-chip {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .size-options {
        flex-direction: column;
        gap: 0.5rem;
    }

    .size-option {
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem 1rem;
    }

    .size-option span {
        font-size: 0.85rem;
    }

    .config-area {
        overflow-x: hidden;
    }

    .editor-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .toolbar-group {
        flex-shrink: 0;
    }

    .history-drawer {
        width: 300px;
        left: -300px;
    }
}

@media (max-width: 480px) {
    .mode-tab {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .mode-tab i {
        font-size: 0.85rem;
    }

    .suggestion-chip {
        padding: 0.35rem 0.8rem;
        font-size: 0.78rem;
        min-height: 34px;
    }

    .size-option {
        padding: 0.55rem 0.9rem;
    }

    .generate-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .upload-option {
        padding: 14px;
    }
    
    .upload-option-icon {
        width: 48px;
        height: 48px;
    }
    
    .upload-option-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .preview-btn {
        width: 100%;
        padding: 14px 20px;
        white-space: normal;
    }
}

@media (max-width: 360px) {
    .preview-card-header {
        padding: 16px 20px;
    }
    
    .preview-card-body {
        padding: 20px;
    }
    
    .preview-icon {
        font-size: 28px;
    }
    
    .preview-card-header h3 {
        font-size: 1.1rem;
    }
    
    .preview-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .preview-description {
        font-size: 0.9rem;
    }
}

/* =========================================================================
   Print
   ========================================================================= */
@media print {
    .navbar, .input-type-tabs, .workspace-grid, .generate-btn, 
    .editor-toolbar, .editor-status, .mode-tabs {
        display: none !important;
    }
    .results-editor {
        box-shadow: none;
        border: none;
    }
    .editor-content {
        padding: 0;
    }
}