:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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


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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.25rem;
    color: var(--secondary-color);
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto 4rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Override for toggle switches inside form groups */
.form-group label.toggle-switch {
    display: inline-block;
    margin-bottom: 0;
    font-weight: normal;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.file-label {
    display: block;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-label input[type="file"] {
    display: none;
}

.file-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

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

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Upload Status */
.upload-status {
    margin-top: 1rem;
    text-align: center;
}

.upload-status p {
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.upload-status .loading {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.upload-status .success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.upload-status .error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Features Section */
.features-section {
    margin: 4rem 0;
}

.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

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

.feature {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Document Header */
.document-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.document-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.document-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.style-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.date {
    color: var(--secondary-color);
}

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

/* Document Viewer */
.document-viewer {
    background: white;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-radius: 12px;
}

/* Source View */
.source-view {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.source-view pre {
    background: #f6f8fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--secondary-color);
}

/* Mermaid diagram styles */
.mermaid {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Style-specific mermaid containers */
.formal-style .mermaid {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.gartner-style .mermaid {
    background: #f0f8ff;
    border: 1px solid #0066cc;
}

.mckinsey-style .mermaid {
    background: #f5f9fc;
    border: 1px solid #003A70;
}

.executive-style .mermaid {
    background: #f7fafc;
    border: 1px solid #1e3a5f;
}

.study-style .mermaid {
    background: #f0f8f0;
    border: 1px solid #2d7a2d;
}

/* Enhanced list styles for better nested list handling */
.document-content ul,
.document-content ol {
    margin: 1rem 0;
    padding-left: 2.5rem;
    line-height: 1.8;
    list-style-position: outside;
}

.document-content ul ul,
.document-content ol ol,
.document-content ul ol,
.document-content ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.document-content li {
    margin: 0.5rem 0;
    position: relative;
}

.document-content li > p {
    margin: 0.25rem 0;
}

/* Ensure consistent spacing for numbered lists */
.document-content ol {
    counter-reset: list-counter;
}

.document-content ol > li {
    display: block;
    position: relative;
}

/* Handle double-digit numbers */
.document-content ol > li::marker {
    font-weight: 600;
    content: counter(list-item) ". ";
}

/* Ensure ordered lists show numbers */
.document-content ol {
    list-style-type: decimal;
}

.document-content ol ol {
    list-style-type: lower-alpha;
}

.document-content ol ol ol {
    list-style-type: lower-roman;
}

/* Nested list markers */
.document-content ul > li {
    list-style-type: disc;
}

.document-content ul ul > li {
    list-style-type: circle;
}

.document-content ul ul ul > li {
    list-style-type: square;
}

/* Bold text in lists */
.document-content li strong {
    font-weight: 600;
    color: inherit;
}

/* Code in lists */
.document-content li code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Source Code Pro', monospace;
}

/* Hide TOC permalinks (¶ character) */
.toc-link {
    display: none !important;
}

/* Alternative: make them visible only on hover */
/*
.toc-link {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 0.5em;
    text-decoration: none;
    color: #999;
}

h1:hover .toc-link,
h2:hover .toc-link,
h3:hover .toc-link,
h4:hover .toc-link,
h5:hover .toc-link,
h6:hover .toc-link {
    opacity: 0.5;
}
*/

/* Header Content */
.header-content {
    background: #f0f7ff;
    border-bottom: 1px solid #d1e3ff;
    padding: 1rem 0;
    text-align: center;
}

.header-content p {
    margin: 0;
    color: #0066cc;
    font-weight: 500;
}

/* Ads Container */
.ads-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .document-actions {
        flex-direction: column;
    }
}

