/* ConvoWizard Installation Page - Modern Minimal Design */

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

:root {
    --bg-base: #fafafa;
    --bg-card: #ffffff;
    --bg-elevated: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --accent-light: #e6f0fa;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none; /* Clicks pass through to content */
}

/* Page Layout */
.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
        "header header"
        "banner banner"
        "progress ."
        "main sidebar"
        "footer footer";
    gap: 32px;
    min-height: 100vh;
}

/* Header */
.header {
    grid-area: header;
    text-align: center;
    padding: 24px 0 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent);
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Notice Banner */
.notice-banner {
    grid-area: banner;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--warning-light);
    border-radius: var(--radius-md);
}

.notice-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--warning);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 4px;
    flex-shrink: 0;
}

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

.notice-banner strong {
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Progress Track */
.progress-track {
    grid-area: progress;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 0;
    margin-bottom: 8px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.progress-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

.progress-step.active .progress-dot {
    border-color: var(--accent);
    background: var(--accent-light);
}

.progress-step.active .progress-dot::after {
    background: var(--accent);
}

.progress-step.completed .progress-dot {
    border-color: var(--success);
    background: var(--success);
}

.progress-step.completed .progress-dot::after {
    content: '✓';
    width: auto;
    height: auto;
    background: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.progress-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active .progress-label,
.progress-step.completed .progress-label {
    color: var(--text-secondary);
}

.progress-line {
    width: 80px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 28px;
    transition: background 0.3s ease;
}

.progress-line.completed {
    background: var(--success);
}

/* Phases */
.phase {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.phase-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.phase-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.phase-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.phase-content {
    padding-left: 52px;
}

.phase-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
}

/* Action Cards */
.action-cards {
    display: flex;
    gap: 12px;
}

.action-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.action-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-card.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.action-card.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.action-card:not(.primary) .card-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-text strong {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-text span {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Install Button */
.install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.install-btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.install-btn:active {
    transform: translateY(0);
}

.install-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-btn-success {
    background: var(--success);
}

.install-btn-success:hover {
    background: var(--success);
}

.install-btn-error {
    background: var(--error);
}

/* Install Instructions */
.install-instructions {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.instructions-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.mini-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mini-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.mini-steps li > span:not(.mini-step-num):not(.step-content) {
    padding-top: 2px;
}

.mini-step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

kbd {
    display: inline-block;
    padding: 3px 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 1px 0 var(--border-strong);
}

/* Step Content - for multi-line steps */
.step-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Inline Code Block */
.code-block-inline {
    padding: 14px 16px;
    background: #1e1e1e;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.code-block-inline code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #d4d4d4;
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
}

/* Open Settings Button */
.open-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.open-settings-btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.open-settings-btn:active {
    transform: translateY(0);
}

.open-settings-btn svg {
    flex-shrink: 0;
}

/* Code Preview */
.code-preview {
    margin-top: 20px;
}

.code-preview summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.code-preview summary:hover {
    color: var(--text-secondary);
}

.code-block {
    margin-top: 12px;
    padding: 16px;
    background: #1e1e1e;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #d4d4d4;
    word-break: break-all;
    line-height: 1.5;
}

.copy-code-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #404040;
    border-radius: var(--radius-sm);
    color: #a0a0a0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-code-btn:hover {
    background: #2d2d2d;
    border-color: #505050;
    color: #e0e0e0;
}

.copy-code-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Test Link */
.test-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.test-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.test-link-icon {
    display: flex;
    color: var(--text-muted);
}

.test-link:hover .test-link-icon {
    color: var(--accent);
}

/* Verify Checklist */
.verify-checklist {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.verify-checklist p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.verify-checklist ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verify-checklist li {
    font-size: 0.9rem;
    color: var(--text-primary);
    padding-left: 20px;
    position: relative;
}

.verify-checklist li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Success Message */
.success-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--success-light);
    border-radius: var(--radius-md);
    color: #065f46;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.success-message.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.success-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: start;
    position: sticky;
    top: 24px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sidebar-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sidebar-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Uninstall Button */
.uninstall-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uninstall-btn:hover {
    border-color: var(--border-strong);
    background: var(--bg-card);
}

/* Alternative Install Link */
.alt-install-link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.alt-install-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

/* Contact Links */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.contact-link span {
    font-size: 1rem;
    opacity: 0.7;
}

/* Footer */
.footer {
    grid-area: footer;
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    background: var(--bg-card);
}

.reset-icon {
    font-weight: bold;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-message {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 900px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "header"
            "banner"
            "progress"
            "main"
            "sidebar"
            "footer";
        padding: 24px 16px;
        gap: 24px;
    }
    
    .sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-card {
        flex: 1;
        min-width: 250px;
    }
    
    .progress-line {
        width: 50px;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 16px 0;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .notice-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .progress-track {
        padding: 16px 0;
    }
    
    .progress-line {
        width: 30px;
    }
    
    .progress-label {
        font-size: 0.7rem;
    }
    
    .phase {
        padding: 20px;
    }
    
    .phase-content {
        padding-left: 0;
        margin-top: 16px;
    }
    
    .action-cards {
        flex-direction: column;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .sidebar-card {
        min-width: unset;
    }
    
    .code-block {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-code-btn {
        width: 100%;
    }
    
    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .toast {
        width: 100%;
    }
}
