:root {
    --primary-color: #004a80; /* Deep blue header */
    --accent-color: #0087e0;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --header-height: 80px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

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

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

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.user-info .github, .github-link {
    font-size: 0.85rem;
    opacity: 0.8;
    color: white;
    text-decoration: none;
}

.github-link:hover {
    opacity: 1;
}

.project-name {
    font-size: 1.5rem;
    font-weight: 500;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

nav {
    display: flex;
    gap: 32px;
}

.nav-item {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 0;
    position: relative;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-item:hover {
    opacity: 1;
}

.nav-item.active {
    opacity: 1;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

/* Main Content */
main {
    margin-top: calc(var(--header-height) + 40px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px 80px;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: block;
}

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

/* README Page */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.col-content h2 {
    font-family: 'Outfit', sans-serif;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 1.75rem;
}

.col-content h2:first-child {
    margin-top: 0;
}

.col-content p {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.col-content ul, .col-content ol {
    margin-left: 24px;
    margin-bottom: 24px;
    color: var(--text-muted);
}

.col-content li {
    margin-bottom: 8px;
}

code {
    background-color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.table-container {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--primary-color);
}

.visual-card {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
}

.visual-card h3 {
    margin-bottom: 24px;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    text-align: center;
}

.mermaid {
    display: flex;
    justify-content: center;
}

/* Result Page */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.result-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.result-card h3 {
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.keywords-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: #eff6ff;
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-footer {
    margin-top: auto;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Workflow Page */
.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
}

.incognito-prompt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.incognito-prompt span {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-right: 8px;
}

.download-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.download-button svg {
    width: 18px;
    height: 18px;
}

.workflow-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    height: 700px;
    border: 1px solid #e2e8f0;
}

n8n-demo {
    width: 100%;
    height: 100%;
    --n8n-workflow-min-height: 90dvh;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    position: relative;
    padding: 48px;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: var(--text-muted);
}

.modal-details h2 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    margin-bottom: 24px;
    font-size: 2rem;
}

.modal-section {
    margin-bottom: 32px;
}

.modal-section h4 {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.modal-section p {
    color: var(--text-color);
    font-size: 1.1rem;
}

.opportunity-box {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 20px;
    border-radius: 8px;
    color: #92400e;
}

/* Responsive */
.loading, .error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.error {
    color: #ef4444;
}

@media (max-width: 1024px) {
    .two-col {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .project-name {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }
    
    nav {
        gap: 16px;
    }
    
    .nav-item {
        font-size: 0.9rem;
    }
    
    .user-info .name {
        font-size: 1.1rem;
    }
    
    .modal-content {
        padding: 32px 24px;
    }
    
    .modal-details h2 {
        font-size: 1.5rem;
    }

    .workflow-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .download-button {
        width: 100%;
        justify-content: center;
    }
}
