/* Abstraction AI - Modern UI Styles */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
		max-width: 1200px;
		margin: 0 auto;
			padding: 1.75rem 2rem 2.5rem;
}

/* Main layout */
.main-content {
	max-width: 960px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Header */
.header {
    text-align: center;
		    margin-bottom: 1.75rem;
		    padding: 1.5rem 0 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.logo i {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Language switch */
.lang-switch {
    margin-top: 0.75rem;
}

.lang-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.lang-switch-link:hover {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.35);
}

/* Hero Split Layout */
.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
	    margin-bottom: 1.5rem;
    align-items: start;
}

/* Left: Content */
.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* 3 Key Benefits */
.hero-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.hero-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.hero-benefits li i {
    color: var(--success);
    font-size: 1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* 3-Step Process (Minimal) */
.hero-steps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    color: var(--text-muted);
    white-space: nowrap;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Hero: AI usage hint */
.hero-ai-usage {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.7);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-ai-usage-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: var(--text);
}

.hero-ai-usage-title i {
    color: var(--primary-light);
}

.hero-ai-usage p {
    margin: 0;
    line-height: 1.5;
}

/* Right: Input Card (Glass Morphism) */
.hero-input-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.input-card-header {
    margin-bottom: 1.5rem;
}

.input-card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.input-card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.input-card-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

/* File Upload Button */
.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Time Estimate */
.time-estimate {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

/* Sections */
.section-header {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 1.25rem;
	margin-bottom: 1.75rem;
}

.section-header-main {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	flex: 1;
}

.section-header-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
}

.section-header h2 {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1.5rem;
	margin: 0;
}

.section-header h2 i {
	color: var(--primary);
}

.section-header p {
	color: var(--text-muted);
}

.ai-prompt-inline {
	    align-self: stretch;
	    max-width: 100%;
	    margin-top: 0;
}

/* Input / results sections */
.input-section,
.results-section {
	background: var(--surface);
	border-radius: 1rem;
	padding: 2rem 2.25rem 2.5rem;
	border: 1px solid var(--border);
	box-shadow: 0 22px 60px rgba(15, 23, 42, 0.8);
}

.results-section {
	margin-top: 0;
}

.input-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.project-name-input {
    flex: 1;
    min-width: 200px;
}

.project-name-input label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.project-name-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-name-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.file-upload {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface-light);
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.05s;
}

.file-label:hover {
	border-color: var(--primary);
	background: rgba(99, 102, 241, 0.12);
	transform: translateY(-1px);
}

.file-name {
	color: var(--text-muted);
	font-size: 0.875rem;
}

/* File List for multiple uploads */
.file-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.file-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.75rem;
	background: rgba(15, 23, 42, 0.6);
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.85rem;
}

.file-item-name {
	color: var(--text-secondary);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-item-name i {
	color: var(--primary);
	flex-shrink: 0;
}

.file-remove-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0.25rem;
	border-radius: 4px;
	transition: color 0.2s, background 0.2s;
	flex-shrink: 0;
}

.file-remove-btn:hover {
	color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
}

.model-select {
	min-width: 230px;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.model-select label {
	color: var(--text-muted);
	font-size: 0.875rem;
}

.model-toggle-group {
	display: flex;
	gap: 0.5rem;
	width: 100%;
}

.model-toggle {
	flex: 1;
	border: 1px solid var(--border);
	background: rgba(15, 23, 42, 0.6);
	color: var(--text-muted);
	font-size: 0.85rem;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	transition: all 0.2s ease;
}

.model-toggle:hover {
	border-color: var(--primary);
	background: rgba(99, 102, 241, 0.1);
}

.model-name {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text);
}

.model-hint {
	font-size: 0.75rem;
	opacity: 0.8;
}

.model-toggle.active {
	background: var(--gradient);
	border-color: transparent;
	color: white;
}

.model-toggle.active .model-name {
	color: white;
}

.model-toggle.active .model-hint {
	opacity: 0.9;
	color: rgba(255, 255, 255, 0.9);
}

.textarea-container {
	position: relative;
	margin-bottom: 1.5rem;
}

#contextInput {
	width: 100%;
	min-height: 260px;
	padding: 1.25rem;
	background: var(--surface-light);
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	color: var(--text);
	font-size: 0.98rem;
	font-family: inherit;
	resize: vertical;
	transition: border-color 0.2s, box-shadow 0.2s;
}

#contextInput:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

#contextInput::placeholder {
	color: var(--text-muted);
}

.char-count {
	position: absolute;
	bottom: 1rem;
	right: 1rem;
	color: var(--text-muted);
	font-size: 0.8rem;
}

/* Generate Button */
.generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
	width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-content {
    max-width: 400px;
    margin: 0 auto;
}

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

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

.loading-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.loading-content p {
    color: var(--text-muted);
}

.loading-tip {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--warning);
}

/* Results Section */
.results-section {
	    margin-top: 0.75rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.results-meta {
    margin-top: 0.75rem;
}

.generation-status {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.generation-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.generation-progress-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.generation-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--gradient);
    transition: width 0.25s ease-out;
}

.generation-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
	    padding: 0.55rem 1.4rem;
    background: var(--primary);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--surface-light);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: var(--surface);
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.document-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    /* Fixed height to prevent jitter during streaming */
    min-height: 240px;
    height: 240px;
    overflow: hidden;
}

.document-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.25);
}

.document-card .doc-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.document-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.document-card .doc-preview {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-card .doc-size {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.document-card .doc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
}

.doc-footer {
	    margin-top: auto;
	    padding-top: 0.75rem;
	    display: flex;
	    align-items: center;
	    gap: 0.75rem;
}

.doc-footer .doc-status {
	    margin-top: 0;
}

.doc-actions {
	    margin-left: auto;
	    display: flex;
	    gap: 0.35rem;
}

.doc-action-btn {
	    width: 28px;
	    height: 28px;
	    border-radius: 999px;
	    border: none;
	    background: var(--surface-light);
	    color: var(--text-muted);
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    font-size: 0.8rem;
	    cursor: pointer;
	    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.doc-action-btn:hover {
	    background: var(--primary);
	    color: #fff;
	    transform: translateY(-1px);
}

.doc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.doc-status-pending .doc-status-dot {
    background: var(--border);
}

.doc-status-streaming .doc-status-dot {
    background: var(--warning);
}

.doc-status-done .doc-status-dot {
    background: var(--success);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

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

.modal-header h3 {
    font-size: 1.125rem;
    word-break: break-word;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    font-size: 0.875rem;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1001;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

/* Responsive */
	@media (max-width: 768px) {
	    .app-container {
	        padding: 1rem;
	    }

	    .logo {
	        font-size: 1.75rem;
	    }

	    .hero-split {
	        grid-template-columns: 1fr;
	        gap: 2rem;
	    }

	    .hero-title {
	        font-size: 1.75rem;
	    }

	    .hero-steps {
	        flex-direction: column;
	        align-items: stretch;
	    }

	    .step-arrow {
	        transform: rotate(90deg);
	        align-self: center;
	    }

	    .hero-input-card {
	        padding: 1.5rem;
	    }

	    .documents-grid {
	        grid-template-columns: 1fr;
	    }

	    .modal-header {
	        flex-direction: column;
	        gap: 1rem;
	        align-items: flex-start;
	    }

	    .section-header {
	        flex-direction: column;
	        align-items: stretch;
	    }

	    .section-header-title-row {
	        flex-direction: column;
	        align-items: flex-start;
	        gap: 0.75rem;
	    }

	    .ai-prompt-inline {
	        align-self: stretch;
	        max-width: 100%;
	        margin-top: 1rem;
	    }
	}

/* Elapsed Timer */
.elapsed-timer {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-left: 0.75rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

.elapsed-timer:empty {
    display: none;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* AI Prompt Box */
.ai-prompt-box {
	margin-top: 0;
	background: rgba(30, 41, 59, 0.6);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 0.75rem;
	padding: 1.25rem;
}

.results-section .ai-prompt-inline {
	margin-top: 0;
}

.ai-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-prompt-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.ai-prompt-title i {
    color: var(--primary-light);
}

.copy-prompt-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: var(--primary);
    border: none;
    border-radius: 0.4rem;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.copy-prompt-btn:hover {
    background: var(--primary-dark);
}

.copy-prompt-btn:active {
    transform: scale(0.97);
}

.ai-prompt-guide {
    margin-bottom: 0.75rem;
}

.ai-prompt-guide p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.ai-prompt-guide u {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary);
}

.ai-prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem 1.25rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-prompt-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.ai-prompt-textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Feedback Widget Styles
   ============================================ */

.feedback-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

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

.feedback-question {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn:hover {
    transform: translateY(-2px);
}

.feedback-positive:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.feedback-negative:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
    color: var(--error);
}

.feedback-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
}

.feedback-dismiss:hover {
    color: var(--text);
}

.feedback-thanks {
    text-align: center;
    padding: 8px;
    color: var(--success);
    font-weight: 500;
}

/* ============================================
   NPS Survey Modal Styles
   ============================================ */

.nps-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nps-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nps-content h3 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.25rem;
    color: var(--text);
}

.nps-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

.nps-close:hover {
    color: var(--text);
}

.nps-scale {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.nps-score {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface-light);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nps-score:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.nps-score.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 20px;
    padding: 0 8px;
}

.nps-feedback-input {
    margin-top: 20px;
    animation: fadeIn 0.3s ease-out;
}

.nps-feedback-input textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text);
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 12px;
}

.nps-feedback-input textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.nps-submit {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nps-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}
