:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0 8px;
    margin-bottom: 40px;
}

.logo svg {
    color: var(--primary-light);
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    color: white;
    background: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-700);
    color: var(--gray-500);
    font-size: 0.75rem;
    text-align: center;
}

/* History Section */
.history-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-700);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 8px;
}

.history-header h3 {
    color: var(--gray-300);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: 4px;
}

.history-empty {
    color: var(--gray-600);
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
    padding: 16px 8px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gray-600);
    transform: translateX(2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-filename {
    color: var(--gray-200);
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.history-score {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.score-high {
    background: var(--success);
    color: white;
}

.score-medium {
    background: var(--warning);
    color: white;
}

.score-low {
    background: var(--danger);
    color: white;
}

.history-date {
    color: var(--gray-500);
    font-size: 0.7rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 48px;
    max-width: calc(100vw - var(--sidebar-width));
}

.header {
    margin-bottom: 32px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.header p {
    color: var(--gray-500);
    font-size: 1rem;
}

.model-selector-container {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-selector-container label {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.875rem;
}

.model-select {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    color: var(--gray-800);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 280px;
}

.model-select:hover {
    border-color: var(--primary);
}

.model-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-header svg {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Input Section */
.input-section {
    margin-bottom: 32px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-content svg {
    color: var(--gray-400);
}

.drop-zone-text {
    font-weight: 500;
    color: var(--gray-700);
}

.drop-zone-hint {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* Selected File Display */
.selected-file-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.selected-file-display.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.file-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon-wrapper svg {
    color: var(--primary);
}

.checkmark-badge {
    position: absolute;
    bottom: -4px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: popIn 0.3s ease 0.1s both;
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.selected-file-name {
    font-weight: 600;
    color: var(--gray-800);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-file-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
}

.change-file-btn:hover {
    text-decoration: underline;
}

/* Job Description Textarea */
#job-description {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#job-description:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#job-description::placeholder {
    color: var(--gray-400);
}

/* Buttons */
.action-container {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.35);
}

.primary-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover:not(:disabled) {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.2);
}

.secondary-btn:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    border-color: var(--gray-300);
    cursor: not-allowed;
}

.outline-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--gray-600);
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.outline-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.icon-btn {
    padding: 10px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-600);
}

.icon-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.loading-section.hidden {
    display: none;
}

.loading-card {
    background: white;
    border-radius: 16px;
    padding: 48px 64px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-card h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.loading-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.loading-step.active {
    color: var(--gray-700);
}

.loading-step.completed {
    color: var(--success);
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.loading-step.active .step-icon {
    background: var(--primary-light);
    animation: pulse 1.5s ease infinite;
}

.loading-step.completed .step-icon {
    background: var(--success);
}

.loading-step.completed .step-icon svg {
    stroke: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Results Section */
.results-section {
    animation: slideUp 0.5s ease;
}

.results-section.hidden {
    display: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Score Comparison */
.score-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.score-card {
    text-align: center;
    padding: 24px;
}

.score-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 16px;
    font-weight: 500;
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease, stroke 0.3s ease;
}

.score-card.before .score-progress {
    stroke: var(--warning);
}

.score-card.after .score-progress {
    stroke: var(--success);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
}

.score-card.before .score-value {
    color: var(--warning);
}

.score-card.after .score-value {
    color: var(--success);
}

.score-breakdown {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.score-breakdown p {
    margin: 4px 0;
}

.keyword-match span,
.ats-likelihood span {
    font-weight: 600;
    color: var(--gray-700);
}

.score-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
}

.improvement-badge {
    background: var(--success);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.analysis-card.full-width {
    grid-column: 1 / -1;
}

.analysis-list {
    list-style: none;
}

.analysis-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    color: var(--gray-700);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.analysis-list li:last-child {
    border-bottom: none;
}

.analysis-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
    flex-shrink: 0;
}

.analysis-list.improvements li::before {
    content: '✦';
    color: var(--primary);
}

/* Keywords Container */
.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.keyword-tag.matched {
    background: var(--success-light);
    color: #065f46;
}

.keyword-tag.added {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-dark);
}

/* Resume Card */
.resume-card {
    margin-bottom: 24px;
}

.resume-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    background: var(--gray-50);
    padding: 24px;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
    color: var(--gray-800);
}

/* Bold text in resume */
.resume-content strong,
.resume-content b {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Style Card */
.style-card {
    margin-bottom: 24px;
}

/* Style Selector with Live Preview */
.style-selector-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

.style-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
}

.style-option:hover {
    border-color: var(--primary-light);
    background: rgba(79, 70, 229, 0.02);
}

.style-option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.style-preview {
    width: 50px;
    height: 65px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.mini-doc {
    width: 100%;
    height: 100%;
    padding: 3px;
    display: flex;
    flex-direction: column;
}

.mini-header-band {
    height: 12px;
    border-radius: 2px 2px 0 0;
    margin: -3px -3px 3px -3px;
}

.mini-name {
    height: 5px;
    width: 55%;
    border-radius: 1px;
    margin-bottom: 2px;
}

.mini-name-centered {
    height: 5px;
    width: 45%;
    margin: 0 auto 2px;
    border-radius: 1px;
    background: currentColor;
}

.mini-contact {
    height: 2px;
    width: 65%;
    margin: 0 auto 3px;
    border-radius: 1px;
}

.mini-divider {
    height: 1px;
    width: 35%;
    margin: 0 auto 3px;
}

.mini-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mini-section-title {
    height: 3px;
    width: 40%;
    border-radius: 1px;
    margin-bottom: 2px;
    background: currentColor;
}

.mini-line {
    height: 2px;
    border-radius: 1px;
}

.mini-bullet {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 4px;
    line-height: 1;
}

.mini-bullet span:last-child {
    height: 2px;
    flex: 1;
    border-radius: 1px;
}

.style-info {
    flex: 1;
    min-width: 0;
}

.style-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800);
    margin-bottom: 1px;
}

.style-desc {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Live Preview Panel */
.style-preview-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 20px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-header svg {
    color: var(--primary);
}

.preview-document {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    height: 1400px;
    position: relative;
}

.preview-document iframe {
    display: block;
    min-height: 100%;
}

.markdown-preview {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 0;
    border: none;
}

.preview-document::-webkit-scrollbar {
    width: 6px;
}

.preview-document::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.preview-document::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Preview Resume Styles */
.preview-resume {
    padding: 0;
    font-size: 9px;
    line-height: 1.5;
    font-family: 'Inter', -apple-system, sans-serif;
}

.preview-header-band {
    padding: 18px 24px 14px;
}

.preview-header-classic,
.preview-header-minimal {
    padding: 18px 24px;
}

/* Template 1: Two-column header layout */
.preview-header-twocol {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 12px;
}

.preview-header-left {
    flex: 1;
}

.preview-header-right {
    text-align: right;
}

.preview-contact-stack {
    line-height: 1.6;
}

.preview-divider-full {
    margin: 0 24px;
}

/* Template 2: Centered header layout */
.preview-header-centered {
    text-align: center;
    padding: 15px 24px;
}

.preview-bar-top,
.preview-bar-bottom {
    width: 100%;
}

.preview-title {
    margin: 4px 0;
    color: #666;
}

.preview-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.preview-contact {
    font-size: 8px;
    opacity: 0.9;
    letter-spacing: 0.2px;
}

.preview-divider {
    height: 2px;
    width: 60px;
    margin: 10px auto 0;
    border-radius: 1px;
}

.preview-body {
    padding: 14px 24px 24px;
}

.preview-section {
    margin-bottom: 14px;
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-section-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 3px;
}

.preview-section-content {
    padding-left: 0;
}

.preview-text {
    margin-bottom: 4px;
    color: #374151;
    font-size: 8px;
}

/* Resume Preview Content Styling */
.resume-preview-content {
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    color: #1f2937;
    padding: 20px;
}

.preview-name {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.preview-section-header {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 16px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #1e3a5f;
}

.preview-subtitle {
    font-size: 10px;
    color: #4b5563;
    font-style: italic;
    margin-bottom: 6px;
}

.preview-bullet {
    font-size: 9px;
    color: #374151;
    margin-bottom: 4px;
    padding-left: 12px;
    line-height: 1.4;
}

.preview-bullet strong {
    color: #1e3a5f;
    font-weight: 600;
}

.preview-text {
    font-size: 9px;
    color: #4b5563;
    margin-bottom: 6px;
    line-height: 1.5;
}

.preview-text strong {
    color: #111827;
    font-weight: 600;
}

.preview-text strong {
    font-weight: 600;
}

/* Mini document preview tweaks */
.mini-bar {
    width: 100%;
}

.mini-doc {
    position: relative;
    overflow: hidden;
}

.preview-bullet {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    color: #4b5563;
    font-size: 8px;
    line-height: 1.5;
}

.preview-bullet span:first-child {
    flex-shrink: 0;
    font-size: 7px;
    margin-top: 1px;
}

.pdf-action-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding-top: 12px;
    flex-wrap: wrap;
}

.pdf-action-container.single {
    justify-content: flex-start;
}

.pdf-save-btn,
.html-save-btn,
.docx-save-btn,
.markdown-save-btn {
    padding: 14px 28px;
    flex: 1;
    max-width: 280px;
    min-width: 200px;
}

.docx-save-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.docx-save-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
}

.markdown-save-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.markdown-save-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
}

.card-subtitle {
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--danger);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.error-toast.hidden {
    display: none;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Success Toast */
.success-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .score-comparison {
        flex-direction: column;
    }
    
    .score-arrow {
        transform: rotate(90deg);
    }
    
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
