/* =========================================================
   MERGEAI - GitHub-inspired Dark Theme
   ========================================================= */


/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans",
        Helvetica,
        Arial,
        sans-serif;

    background-color: #0d1117;
    color: #f0f6fc;
}


/* =========================
   PAGE CONTAINER
========================= */

.container {
    width: min(1200px, 92%);
    margin: 0 auto;

    padding: 40px 0 70px;
}


/* =========================
   HEADER
========================= */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 35px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    width: auto;
    height: 42px;
    object-fit: contain;
}

.logo span {
    color: #d74a32;
}

.subtitle {
    margin-top: 7px;

    color: #8b949e;

    font-size: 14px;
}


/* =========================
   TITLES
========================= */

h1,
h2,
h3 {
    color: #f0f6fc;
}

h2 {
    margin-top: 0;
    margin-bottom: 10px;

    font-size: 21px;
}

h3 {
    font-size: 15px;
}


/* =========================
   CARDS
========================= */

.card {
    margin-bottom: 24px;

    padding: 24px;

    background-color: #161b22;

    border: 1px solid #30363d;
    border-radius: 8px;
}


/* =========================
   FORM
========================= */

form {
    width: 100%;
}

label {
    display: block;

    margin-bottom: 8px;

    color: #c9d1d9;

    font-size: 14px;
    font-weight: 600;
}


/* =========================
   SELECT
========================= */

select {
    min-width: 180px;

    margin-bottom: 18px;

    padding: 8px 12px;

    background-color: #0d1117;
    color: #f0f6fc;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-size: 14px;

    cursor: pointer;
}

select:hover {
    border-color: #8b949e;
}

select:focus {
    outline: none;

    border-color: #2f81f7;

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.15);
}


/* =========================
   TEXTAREA
========================= */

textarea {
    display: block;

    width: 100%;
    min-height: 330px;

    padding: 16px;

    resize: vertical;

    background-color: #0d1117;
    color: #e6edf3;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 14px;
    line-height: 1.55;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

textarea:hover {
    border-color: #8b949e;
}

textarea:focus {
    outline: none;

    border-color: #2f81f7;

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.15);
}

textarea::placeholder {
    color: #6e7681;
}


/* =========================
   PRIMARY BUTTON
========================= */

.primary-button {
    margin-top: 18px;

    padding: 9px 16px;

    background-color: #238636;
    color: #ffffff;

    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.primary-button:hover {
    background-color: #2ea043;
}

.primary-button:active {
    background-color: #238636;
}

.primary-button:disabled {
    background-color: #238636;

    opacity: 0.55;

    cursor: wait;
}


/* =========================
   LOADING
========================= */

.loading {
    display: flex;
    align-items: center;

    margin-top: 16px;

    color: #58a6ff;

    font-size: 14px;
}

.spinner {
    display: inline-block;

    width: 15px;
    height: 15px;

    margin-right: 9px;

    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;

    vertical-align: middle;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================
   SEPARATORS
========================= */

hr {
    height: 1px;

    margin: 30px 0;

    background-color: #21262d;

    border: 0;
}


/* =========================
   CONFLICT ANALYSIS
========================= */

.analysis-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 20px;

    margin-top: 18px;
}


/* =========================
   BRANCH CARDS
========================= */

.branch-card {
    min-width: 0;

    margin-bottom: 0;
}

.branch-card.current {
    border-color: #30363d;
}

.branch-card.incoming {
    border-color: #1f6feb;
}

.branch-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 14px;
}

.branch-title h3 {
    margin: 0;

    font-size: 15px;
}


/* =========================
   BRANCH LABEL
========================= */

.branch-label {
    display: inline-flex;
    align-items: center;

    padding: 3px 9px;

    background-color: #21262d;
    color: #8b949e;

    border: 1px solid #30363d;
    border-radius: 20px;

    font-size: 12px;
    font-weight: 500;
}

.incoming .branch-label {
    background-color: rgba(31, 111, 235, 0.12);
    color: #58a6ff;

    border-color: rgba(47, 129, 247, 0.4);
}


/* =========================
   CODE BLOCKS
========================= */

.code-block {
    width: 100%;
    min-height: 180px;

    margin: 0;

    padding: 16px;

    overflow-x: auto;

    background-color: #0d1117;
    color: #e6edf3;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 13px;
    line-height: 1.55;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================
   AI RESOLUTION
========================= */

.ai-card {
    position: relative;

    border-color: #238636;

    box-shadow:
        0 0 0 1px rgba(46, 160, 67, 0.08),
        0 8px 24px rgba(1, 4, 9, 0.25);
}

.ai-title {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 0;
    margin-bottom: 20px;
}

.ai-title span {
    color: #3fb950;
}


/* =========================
   AI EXPLANATION
========================= */

.explanation {
    margin-top: 8px;
    margin-bottom: 26px;

    color: #c9d1d9;

    font-size: 14px;
    line-height: 1.7;
}


/* =========================
   RESOLVED CODE
========================= */

.resolved-code-wrapper {
    position: relative;

    margin-top: 10px;
}

.resolved-code {
    min-height: 130px;

    padding-top: 48px;

    border-color: #30363d;
}


/* =========================
   COPY BUTTON
========================= */

.copy-button {
    position: absolute;

    top: 10px;
    right: 10px;

    z-index: 2;

    padding: 6px 12px;

    background-color: #21262d;
    color: #f0f6fc;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.copy-button:hover {
    background-color: #30363d;

    border-color: #8b949e;
}

.copy-button:active {
    background-color: #161b22;
}


/* =========================
   ERROR
========================= */

.error-card {
    margin-top: 20px;

    padding: 15px;

    background-color: rgba(248, 81, 73, 0.08);
    color: #ff7b72;

    border: 1px solid rgba(248, 81, 73, 0.5);
    border-radius: 6px;
}

.error-card h2,
.error-card h3 {
    color: #ff7b72;
}


/* =========================
   SUCCESS
========================= */

.success {
    color: #3fb950;
}


/* =========================
   LINKS
========================= */

a {
    color: #58a6ff;

    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;

    margin-top: 15px;

    color: #58a6ff;

    font-size: 14px;
}


/* =========================
   SCROLLBAR
========================= */

textarea::-webkit-scrollbar,
.code-block::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

textarea::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track {
    background-color: #0d1117;
}

textarea::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb {
    background-color: #30363d;

    border: 2px solid #0d1117;
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover,
.code-block::-webkit-scrollbar-thumb:hover {
    background-color: #484f58;
}


/* =========================
   TEXT SELECTION
========================= */

::selection {
    background-color: rgba(47, 129, 247, 0.35);
    color: #ffffff;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 800px) {

    .container {
        width: 94%;

        padding-top: 25px;
    }

    .header {
        margin-bottom: 25px;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
    }

    textarea {
        min-height: 260px;
    }

    .logo {
        font-size: 24px;
    }

}


@media (max-width: 500px) {

    .container {
        width: 95%;
    }

    .card {
        padding: 15px;
    }

    textarea {
        min-height: 230px;

        font-size: 13px;
    }

    .primary-button {
        width: 100%;
    }

    .branch-title {
        align-items: flex-start;
        flex-direction: column;
    }

}



/* =========================================================
   HOME PAGE
   ========================================================= */


/* =========================
   HOME HEADER
========================= */

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 24px;

    border-bottom: 1px solid #21262d;
}

.header-link {
    padding: 7px 12px;

    color: #f0f6fc;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 600;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.header-link:hover {
    background-color: #21262d;
    border-color: #8b949e;

    text-decoration: none;
}


/* =========================
   HERO
========================= */

.hero {
    max-width: 820px;

    margin: 0 auto;

    padding: 100px 20px 110px;

    text-align: center;
}

.hero-badge {
    display: inline-block;

    margin-bottom: 22px;

    padding: 5px 12px;

    background-color: rgba(47, 129, 247, 0.1);
    color: #58a6ff;

    border: 1px solid rgba(47, 129, 247, 0.35);
    border-radius: 20px;

    font-size: 12px;
    font-weight: 600;
}

.hero-title {
    max-width: 760px;

    margin: 0 auto;

    color: #f0f6fc;

    font-size: clamp(42px, 6vw, 68px);
    line-height: 1.05;

    letter-spacing: -2px;
}

.hero-title span {
    display: block;

    color: #8b949e;
}

.hero-description {
    max-width: 660px;

    margin: 25px auto 0;

    color: #8b949e;

    font-size: 17px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;

    margin-top: 32px;
}

.hero-button {
    display: inline-block;

    padding: 11px 20px;

    background-color: #238636;
    color: #ffffff;

    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.hero-button:hover {
    background-color: #2ea043;

    text-decoration: none;

    transform: translateY(-1px);
}


/* =========================
   HOW IT WORKS
========================= */

.how-it-works {
    padding: 70px 0;

    border-top: 1px solid #21262d;
}

.section-heading {
    margin-bottom: 32px;

    text-align: center;
}

.section-heading h2 {
    margin-bottom: 8px;

    font-size: 28px;
}

.section-heading p {
    margin: 0;

    color: #8b949e;
}


/* =========================
   STEPS
========================= */

.steps-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 20px;
}

.step-card {
    min-height: 300px;

    padding: 24px;

    background-color: #161b22;

    border: 1px solid #30363d;
    border-radius: 8px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin-bottom: 20px;

    background-color: rgba(47, 129, 247, 0.1);
    color: #58a6ff;

    border: 1px solid rgba(47, 129, 247, 0.35);
    border-radius: 50%;

    font-size: 13px;
    font-weight: 700;
}

.success-number {
    background-color: rgba(46, 160, 67, 0.1);
    color: #3fb950;

    border-color: rgba(46, 160, 67, 0.4);
}

.step-card h3 {
    margin-bottom: 10px;

    font-size: 17px;
}

.step-card p {
    min-height: 65px;

    color: #8b949e;

    font-size: 14px;
    line-height: 1.6;
}


/* =========================
   MINI CODE EXAMPLE
========================= */

.mini-code {
    margin-top: 20px;

    padding: 14px;

    overflow: hidden;

    background-color: #0d1117;
    color: #c9d1d9;

    border: 1px solid #30363d;
    border-radius: 6px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================
   MINI BRANCHES
========================= */

.mini-branches {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 20px;
}

.mini-branches span {
    padding: 14px 8px;

    background-color: #0d1117;

    border: 1px solid #30363d;
    border-radius: 6px;

    color: #8b949e;

    font-family: monospace;
    font-size: 11px;

    text-align: center;
}

.mini-branches span:last-child {
    color: #58a6ff;

    border-color: #1f6feb;
}


/* =========================
   MINI SUCCESS
========================= */

.mini-success {
    margin-top: 20px;

    padding: 14px;

    background-color: rgba(46, 160, 67, 0.06);
    color: #3fb950;

    border: 1px solid rgba(46, 160, 67, 0.4);
    border-radius: 6px;

    font-size: 12px;
    font-weight: 600;

    text-align: center;
}


/* =========================
   BOTTOM CTA
========================= */

.bottom-cta {
    margin: 60px 0;

    padding: 55px 30px;

    background-color: #161b22;

    border: 1px solid #30363d;
    border-radius: 8px;

    text-align: center;
}

.bottom-cta h2 {
    margin-bottom: 10px;

    font-size: 26px;
}

.bottom-cta p {
    margin-bottom: 25px;

    color: #8b949e;
}


/* =========================
   FOOTER
========================= */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-top: 25px;

    color: #6e7681;

    border-top: 1px solid #21262d;

    font-size: 12px;
}

.footer-ai {
    color: #d74a32;
}


/* =========================
   HOME RESPONSIVE
========================= */

@media (max-width: 850px) {

    .hero {
        padding:
            70px 10px
            80px;
    }

    .hero-title {
        font-size: 45px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .step-card {
        min-height: auto;
    }

    .step-card p {
        min-height: auto;
    }

}


@media (max-width: 500px) {

    .home-header {
        gap: 15px;
    }

    .hero {
        padding:
            55px 0
            65px;
    }

    .hero-title {
        font-size: 38px;

        letter-spacing: -1px;
    }

    .hero-description {
        font-size: 15px;
    }

    .bottom-cta {
        padding:
            40px 20px;
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

}