/*
 * 🎨 TREEBIRD TOOL PAGES
 * Shared styles for envoak, Mycmail, and other tool landing pages
 */

/* ═══════════════════════════════════════════════════════
   TOOL PAGE BASE
   ═══════════════════════════════════════════════════════ */
.tool-page {
    padding-top: var(--nav-height);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════════════════════════════════════════════════════
   TOOL HERO SECTION
   ═══════════════════════════════════════════════════════ */
.tool-hero {
    position: relative;
    padding: 80px 20px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, var(--bg-surface) 0%, var(--bg-deep) 70%);
    z-index: 0;
}

.envoak-page .tool-hero-bg {
    background: radial-gradient(ellipse at 50% 30%, #1a2a3a 0%, var(--bg-deep) 70%);
}

.mycmail-page .tool-hero-bg {
    background: radial-gradient(ellipse at 50% 30%, #1a2a25 0%, var(--bg-deep) 70%);
}

.tool-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.tool-hero-glyph img {
    width: 280px;
    height: 280px;
    object-fit: contain;
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
}

.tool-hero-text {
    flex: 1;
}

.tool-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--success);
    color: var(--text-inverse);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 16px;
}

.envoak-page .tool-badge {
    background: var(--accent);
}

.mycmail-page .tool-badge {
    background: var(--success);
}

.tool-hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    margin-bottom: 8px;
}

.tool-tagline {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.envoak-page .tool-tagline {
    color: #6ba8eb;
}

.mycmail-page .tool-tagline {
    color: #7bb86f;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 500px;
    margin-bottom: 32px;
}

.tool-hero-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.install-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0a0a0a;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.install-block code {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
}

.install-block.large {
    padding: 18px 28px;
}

.install-block.large code {
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════
   TERMINAL DEMO
   ═══════════════════════════════════════════════════════ */
.tool-demo {
    padding: 60px 20px;
    background: var(--bg-deep);
}

.demo-terminal.large {
    max-width: 700px;
    margin: 0 auto;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(74, 144, 217, 0.15);
}

.envoak-page .demo-terminal.large {
    box-shadow: var(--shadow-lg), 0 0 60px rgba(74, 144, 217, 0.15);
}

.mycmail-page .demo-terminal.large {
    box-shadow: var(--shadow-lg), 0 0 60px rgba(107, 154, 91, 0.15);
}

.demo-terminal .terminal-body {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.demo-terminal .terminal-line {
    margin-bottom: 6px;
}

.comment {
    color: #666;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   PROBLEM / SOLUTION
   ═══════════════════════════════════════════════════════ */
.problem-solution {
    padding: 80px 20px;
    background: var(--bg-surface);
}

.problem-solution .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.problem-card,
.solution-card {
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.problem-card {
    background: rgba(168, 90, 74, 0.1);
    border-color: var(--error);
}

.solution-card {
    background: rgba(107, 154, 91, 0.1);
    border-color: var(--success);
}

.problem-card h3,
.solution-card h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: 24px;
}

.problem-card ul,
.solution-card ul {
    list-style: none;
}

.problem-card li,
.solution-card li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.problem-card li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: var(--error);
    font-weight: bold;
}

.solution-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.solution-card code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ═══════════════════════════════════════════════════════
   FEATURES GRID
   ═══════════════════════════════════════════════════════ */
.features-section {
    padding: 100px 20px;
    background: var(--bg-deep);
}

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

.feature-card {
    padding: 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

.feature-card code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   INTEGRATION SECTION
   ═══════════════════════════════════════════════════════ */
.integration-section {
    padding: 100px 20px;
    background: var(--bg-surface);
}

.integration-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.integration-card {
    padding: 32px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.integration-card:hover {
    border-color: var(--warning);
}

.integration-card.highlight {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-deep) 0%, rgba(201, 162, 39, 0.1) 100%);
}

.integration-glyph {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.integration-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.integration-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.integration-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.code-example {
    background: #0a0a0a;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 16px;
}

.code-example code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.integration-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════
   COMMANDS REFERENCE
   ═══════════════════════════════════════════════════════ */
.commands-section {
    padding: 100px 20px;
    background: var(--bg-deep);
}

.commands-table {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.command-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.command-row:last-child {
    border-bottom: none;
}

.command-row:hover {
    background: var(--bg-surface-hover);
}

.command-name code {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.command-desc {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   USE CASES
   ═══════════════════════════════════════════════════════ */
.use-cases-section {
    padding: 100px 20px;
    background: var(--bg-surface);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.use-case-card {
    padding: 32px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.use-case-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.use-case-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.use-case-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

.use-case-card code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   FAQ SECTION
   ═══════════════════════════════════════════════════════ */
.faq-section {
    padding: 100px 20px;
    background: var(--bg-deep);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--bg-surface);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--bg-surface-hover);
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s;
}

.faq-item.open .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 24px 24px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════
   CTA SECTION
   ═══════════════════════════════════════════════════════ */
.cta-section {
    padding: 100px 20px;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.cta-links {
    display: flex;
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .tool-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .tool-hero-glyph img {
        width: 200px;
        height: 200px;
    }

    .tool-description {
        margin-left: auto;
        margin-right: auto;
    }

    .tool-hero-cta {
        justify-content: center;
    }

    .command-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .tool-hero {
        padding: 60px 20px;
    }

    .tool-hero-glyph img {
        width: 160px;
        height: 160px;
    }

    .install-block {
        flex-direction: column;
        gap: 8px;
    }

    .install-block code {
        font-size: 0.85rem;
    }

    .problem-solution .container {
        grid-template-columns: 1fr;
    }

    .integration-cards,
    .features-grid,
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
}