﻿/* ─── ROOT & LAYOUT ───────────────────────────────────────── */
.ais-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    height: 100vh;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ─── HEADER ──────────────────────────────────────────────── */
.ais-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 16px;
    flex-wrap: wrap;
}

.ais-header-center {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
}
.ais-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.ais-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.22);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

    .ais-refresh-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(99, 102, 241, 0.28);
        filter: brightness(1.02);
    }

    .ais-refresh-btn:disabled {
        opacity: .65;
        cursor: not-allowed;
        box-shadow: none;
    }

.ais-header-icon {
    font-size: 2rem;
}

.ais-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, #a78bfa, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ais-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.ais-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all .25s ease;
    white-space: nowrap;
}

    .ais-back-btn:hover {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }

.ais-stats-pill {
    display: flex;
    gap: 12px;
    background: rgba(167,139,250,0.15);
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: #c4b5fd;
    white-space: nowrap;
}

/* ─── BODY ────────────────────────────────────────────────── */
.ais-body {
    flex: 1;
    min-height: 0;
    padding: 24px 28px;
    overflow: auto;
}

/* ─── LOADING ─────────────────────────────────────────────── */
.ais-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 20px;
}

.ais-ai-orb {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ais-orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(167,139,250,0.4);
    animation: orbPulse 2s ease-in-out infinite;
}

.ais-orb-ring {
    width: 120px;
    height: 120px;
}

.ais-orb-ring--2 {
    width: 88px;
    height: 88px;
    animation-delay: .4s;
    border-color: rgba(56,189,248,0.4);
}

.ais-orb-ring--3 {
    width: 56px;
    height: 56px;
    animation-delay: .8s;
    border-color: rgba(167,139,250,0.6);
}

@keyframes orbPulse {
    0%,100% {
        transform: scale(1);
        opacity: .5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.ais-orb-core {
    font-size: 2rem;
    animation: orbSpin 4s linear infinite;
}

@keyframes orbSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ais-loading-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.ais-loading-step {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.ais-loading-dots {
    display: flex;
    gap: 6px;
}

    .ais-loading-dots span {
        width: 8px;
        height: 8px;
        background: #a78bfa;
        border-radius: 50%;
        animation: dotBounce .9s ease-in-out infinite;
    }

        .ais-loading-dots span:nth-child(2) {
            animation-delay: .2s;
        }

        .ais-loading-dots span:nth-child(3) {
            animation-delay: .4s;
        }

@keyframes dotBounce {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ─── EMPTY / ERROR ───────────────────────────────────────── */
.ais-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 14px;
    text-align: center;
}

.ais-empty-icon {
    font-size: 3.5rem;
}

.ais-empty-state h3 {
    font-size: 1.2rem;
    color: #e2e8f0;
    margin: 0;
}

.ais-empty-hint {
    color: #94a3b8;
    font-size: 0.87rem;
    max-width: 440px;
    line-height: 1.6;
}

    .ais-empty-hint code {
        background: rgba(255,255,255,0.1);
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.84rem;
        color: #38bdf8;
    }

.ais-retry-btn {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity .2s;
}

    .ais-retry-btn:hover {
        opacity: .85;
    }

/* ─── MAIN LAYOUT ─────────────────────────────────────────── */
.ais-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .ais-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.ais-sidebar {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    position: sticky;
    top: 20px;
}

.ais-sidebar-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #a78bfa;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ais-unit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ais-unit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: all .2s ease;
}

    .ais-unit-item:hover {
        background: rgba(167,139,250,0.1);
        border-color: rgba(167,139,250,0.3);
    }

.ais-unit-item--active {
    background: rgba(167,139,250,0.15);
    border-color: rgba(167,139,250,0.4);
}

.ais-unit-num {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ─── Ünite / alt ünite hiyerarşisi ───────────────────────── */
.ais-unit-item--depth-1 {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid rgba(167, 139, 250, 0.35);
    border-radius: 4px 10px 10px 4px;
}

.ais-unit-item--depth-2 {
    margin-left: 40px;
    padding-left: 12px;
    border-left: 2px solid rgba(167, 139, 250, 0.22);
    border-radius: 4px 10px 10px 4px;
}

    .ais-unit-item--depth-1 .ais-unit-num,
    .ais-unit-item--depth-2 .ais-unit-num {
        width: 19px;
        height: 19px;
        font-size: 0.65rem;
        background: rgba(167, 139, 250, 0.18);
        color: #c4b5fd;
        border: 1px solid rgba(167, 139, 250, 0.35);
    }

    .ais-unit-item--depth-1 .ais-unit-name,
    .ais-unit-item--depth-2 .ais-unit-name {
        font-size: 0.78rem;
        color: #cbd5e1;
    }

.ais-unit-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ais-unit-name {
    font-size: 0.82rem;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.ais-unit-dur {
    font-size: 0.72rem;
    color: #64748b;
}

.ais-unit-check {
    color: #4ade80;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.ais-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ─── SUMMARY CARD ────────────────────────────────────────── */
.ais-summary-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14) 0%, rgba(37, 99, 235, 0.10) 100%);
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.ais-summary-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

    .ais-summary-card-header h2 {
        flex: 1;
        margin: 0;
        font-size: 1.08rem;
        font-weight: 800;
        color: #f8fafc;
        letter-spacing: -0.02em;
    }

.ais-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(167, 139, 250, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.30);
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.74rem;
    color: #c4b5fd;
    font-weight: 700;
    white-space: nowrap;
}

.ais-model-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    animation: modelPulse 2s ease-in-out infinite;
}

.ais-copy-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    transition: all 0.2s ease;
}

    .ais-copy-btn:hover {
        background: rgba(255, 255, 255, 0.16);
        color: #ffffff;
        transform: translateY(-1px);
    }

.ais-summary-text {
    padding: 20px;
    color: #e2e8f0;
    font-size: 0.92rem;
    line-height: 1.95;
    text-align: justify;
    text-justify: inter-word;
}

    .ais-summary-text p {
        margin: 0 0 12px 0;
    }

    .ais-summary-text ul,
    .ais-summary-text ol {
        margin: 0 0 14px 18px;
        padding-left: 18px;
    }

    .ais-summary-text li {
        margin: 5px 0;
        line-height: 1.8;
    }

.ais-paragraph {
    margin: 0 0 10px 0;
    line-height: 1.9;
    text-indent: 1.6em;
}

.ais-summary-list--ol {
    list-style: decimal;
}

    .ais-summary-list--ol li {
        margin: 5px 0;
        line-height: 1.8;
    }

.ais-quote {
    margin: 12px 0 14px 0;
    padding: 10px 16px;
    border-left: 3px solid rgba(167, 139, 250, 0.5);
    background: rgba(167, 139, 250, 0.07);
    border-radius: 0 10px 10px 0;
    color: #d5c8ff;
    font-style: italic;
    line-height: 1.8;
}

    .ais-summary-text strong,
    .ais-unit-ai-summary-text strong {
        color: #f8fafc;
    }

    .ais-summary-text em,
    .ais-unit-ai-summary-text em {
        color: #c4b5fd;
    }

.ais-summary-heading {
    display: block;
    color: #f8fafc;
    margin: 16px 0 8px 0;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.ais-summary-heading--1 {
    font-size: 1.35rem;
}

.ais-summary-heading--2 {
    font-size: 1.12rem;
}

.ais-summary-heading--3 {
    font-size: 0.98rem;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── UNIT DETAIL CARD ────────────────────────────────────── */
.ais-unit-detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.ais-unit-ai-summary {
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.16);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.ais-unit-ai-summary-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 8px 0;
}

.ais-unit-ai-summary-text {
    font-size: 0.88rem;
    color: #e2e8f0;
    line-height: 1.8;
}

.ais-unit-ai-summary-text ul {
    margin: 0 0 0 18px;
    padding-left: 18px;
}

.ais-unit-ai-summary-text li {
    margin: 5px 0;
}

.ais-unit-detail-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: #e2e8f0;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ais-unit-detail-date {
    font-size: 0.75rem;
    color: #c4b5fd;
    font-weight: 700;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.18);
    padding: 4px 10px;
    border-radius: 999px;
}

.ais-unit-detail-content {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.9;
    max-height: 340px;
    overflow-y: auto;
    text-align: justify;
    text-justify: inter-word;
}

    .ais-unit-detail-content p {
        margin: 0 0 12px 0;
    }

    .ais-unit-detail-content ul,
    .ais-unit-detail-content ol {
        margin: 0 0 14px 18px;
        padding-left: 18px;
    }

    .ais-unit-detail-content li {
        margin: 5px 0;
        line-height: 1.8;
    }