/* Rapor karşılaştırma modal — siddet-hesaplama */
.siddet-compare-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10003;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.siddet-compare-modal.active {
    display: flex;
}

.siddet-compare-modal-content {
    background: #fff;
    border-radius: 16px;
    width: min(calc(100vw - 24px), 1100px);
    max-width: 100%;
    max-height: min(calc(100vh - 24px), 94vh);
    max-height: min(calc(100dvh - 24px), 94dvh);
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

.siddet-compare-modal.is-setup .siddet-compare-modal-header {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    width: auto;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 3;
}

.siddet-compare-modal.is-setup .siddet-compare-modal-header-text,
.siddet-compare-modal.is-setup .siddet-compare-danisan-btn,
.siddet-compare-modal.is-setup .siddet-compare-pdf-btn {
    display: none !important;
}

.siddet-compare-modal.is-setup .siddet-compare-body {
    display: none !important;
}

.siddet-compare-modal.is-analysis .siddet-compare-setup {
    display: none !important;
}

.siddet-compare-modal.is-setup .siddet-compare-setup {
    flex: 1;
    min-height: min(520px, calc(94dvh - 24px));
}

.siddet-compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    min-width: 0;
}

.siddet-compare-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.siddet-compare-modal-header > div,
.siddet-compare-modal-header-text {
    min-width: 0;
    flex: 1;
}

.siddet-compare-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #344c64;
    line-height: 1.25;
}

.siddet-compare-modal-subtitle {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

.siddet-compare-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.siddet-compare-modal-close:hover {
    background: #f1f5f9;
}

.siddet-compare-setup {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    min-height: 0;
    overflow: auto;
    background: #f8fafc;
}

.siddet-compare-setup-card {
    width: min(100%, 460px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
    max-height: 100%;
    min-height: 0;
}

.siddet-compare-setup-title {
    margin: 0;
    font-size: 1.05rem;
    color: #344c64;
    text-align: center;
}

.siddet-compare-setup-hint {
    margin: 0 0 8px;
    font-size: 0.84rem;
    color: #64748b;
    text-align: center;
    line-height: 1.45;
}

.siddet-compare-setup .siddet-compare-reports-list {
    max-height: min(42vh, 320px);
    min-height: 120px;
}

.siddet-compare-continue-btn {
    width: 100%;
    margin-top: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    background: #344c64;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
}

.siddet-compare-continue-btn:hover:not(:disabled) {
    background: #2a3d52;
}

.siddet-compare-continue-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.siddet-compare-danisan-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.siddet-compare-danisan-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.siddet-compare-danisan-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.siddet-compare-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.siddet-compare-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.siddet-compare-danisan-select {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #344c64;
    background: #fff;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.siddet-compare-reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    min-width: 0;
}

.siddet-compare-selection-count {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
}

.siddet-compare-loading,
.siddet-compare-empty {
    font-size: 0.85rem;
    color: #64748b;
    padding: 12px 8px;
    text-align: center;
}

.siddet-compare-reports-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 100px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.siddet-compare-report-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    min-width: 0;
}

.siddet-compare-report-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.siddet-compare-report-item.is-checked {
    border-color: #577399;
    background: rgba(87, 115, 153, 0.06);
}

.siddet-compare-report-item input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #344c64;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.siddet-compare-report-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.siddet-compare-report-date {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    word-break: break-word;
}

.siddet-compare-report-summary {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.35;
    word-break: break-word;
}

.siddet-compare-main {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    min-width: 0;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
}

.siddet-compare-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
    font-size: 0.92rem;
    padding: 40px 16px;
    min-height: 160px;
}

.siddet-compare-analysis {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.siddet-compare-metric-segment {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
}

.siddet-compare-metric-segment .mode-segment__btn {
    white-space: normal;
    line-height: 1.25;
    hyphens: auto;
}

.siddet-compare-toolbar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.siddet-compare-pdf-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.siddet-compare-pdf-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.siddet-compare-pdf-btn:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
}

.siddet-compare-pdf-btn.lingo-pdf-btn-loading,
.siddet-compare-pdf-btn.vocfount-btn-loading {
    min-height: 34px;
    min-width: 34px;
}

.siddet-compare-pdf-btn .lingo-pdf-btn-label {
    font-size: 0.62rem;
    font-weight: 700;
}

.siddet-compare-pdf-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.siddet-compare-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 10px;
    min-width: 0;
}

.siddet-compare-summary-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-width: 0;
}

.siddet-compare-summary-card--ss {
    border-left: 3px solid #ef4444;
}

.siddet-compare-summary-card--speed {
    border-left: 3px solid #577399;
}

.siddet-compare-summary-card--stutter {
    border-left: 3px solid #f59e0b;
}

.siddet-compare-summary-card--counts {
    border-left: 3px solid #10b981;
}

.siddet-compare-summary-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 4px;
}

.siddet-compare-summary-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    word-break: break-word;
}

.siddet-compare-summary-card-delta {
    font-size: 0.78rem;
    margin-top: 4px;
    color: #64748b;
    word-break: break-word;
}

.siddet-compare-summary-card-delta.is-improved {
    color: #10b981;
}

.siddet-compare-summary-card-delta.is-worsened {
    color: #ef4444;
}

.siddet-compare-chart-section,
.siddet-compare-table-section {
    min-width: 0;
    max-width: 100%;
}

.siddet-compare-section-title {
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.siddet-compare-chart-wrap {
    height: 260px;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.siddet-compare-bar-wrap {
    height: 200px;
    position: relative;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.siddet-compare-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.siddet-compare-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.siddet-compare-table th,
.siddet-compare-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.siddet-compare-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.siddet-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.siddet-compare-table tbody tr:hover {
    background: #fafbfc;
}

.siddet-compare-table .is-best {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-weight: 600;
}

.siddet-compare-table .is-worst {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    font-weight: 600;
}

.siddet-compare-table td.is-improved {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-weight: 600;
}

.siddet-compare-table td.is-worsened {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    font-weight: 600;
}

.siddet-compare-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.siddet-compare-cell-arrow {
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 700;
}

.siddet-compare-cell-arrow--up {
    color: inherit;
}

.siddet-compare-cell-arrow--down {
    color: inherit;
}

.siddet-compare-table td.is-improved .siddet-compare-cell-arrow--down {
    color: #059669;
}

.siddet-compare-table td.is-improved .siddet-compare-cell-arrow--up {
    color: #059669;
}

.siddet-compare-table td.is-worsened .siddet-compare-cell-arrow--up {
    color: #dc2626;
}

.siddet-compare-table td.is-worsened .siddet-compare-cell-arrow--down {
    color: #dc2626;
}

.siddet-compare-table-hint {
    display: none;
    margin: 0 0 6px;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Tablet ve dar masaüstü */
@media (max-width: 960px) {
    .siddet-compare-body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .siddet-compare-main {
        flex: 1;
        min-height: 0;
    }
}

/* Mobil */
@media (max-width: 640px) {
    .siddet-compare-modal {
        padding: 0;
        align-items: stretch;
    }

    .siddet-compare-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }

    .siddet-compare-modal-header {
        padding: 12px 14px;
    }

    .siddet-compare-modal-header h3 {
        font-size: 1rem;
    }

    .siddet-compare-modal-subtitle {
        font-size: 0.76rem;
    }

    .siddet-compare-setup {
        padding: 16px 14px;
    }

    .siddet-compare-setup-card {
        padding: 18px 16px;
    }

    .siddet-compare-setup .siddet-compare-reports-list {
        max-height: min(38vh, 280px);
    }

    .siddet-compare-main {
        padding: 12px 14px;
    }

    .siddet-compare-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .siddet-compare-metric-segment.mode-segment {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding: 3px;
    }

    .siddet-compare-metric-segment .mode-segment__btn {
        font-size: 0.68rem;
        padding: 8px 4px;
    }

    .siddet-compare-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .siddet-compare-summary-card {
        padding: 10px 12px;
    }

    .siddet-compare-summary-card-value {
        font-size: 1rem;
    }

    .siddet-compare-chart-wrap {
        height: 200px;
    }

    .siddet-compare-bar-wrap {
        height: 160px;
    }

    .siddet-compare-table {
        font-size: 0.76rem;
        min-width: 480px;
    }

    .siddet-compare-table th,
    .siddet-compare-table td {
        padding: 6px 8px;
    }

    .siddet-compare-table-hint {
        display: block;
    }

    .siddet-compare-placeholder {
        padding: 24px 12px;
        font-size: 0.85rem;
        min-height: 120px;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 400px) {
    .siddet-compare-metric-segment.mode-segment {
        grid-template-columns: 1fr;
    }

    .siddet-compare-metric-segment .mode-segment__btn {
        font-size: 0.78rem;
        padding: 9px 10px;
    }

    .siddet-compare-summary-cards {
        grid-template-columns: 1fr;
    }

    .siddet-compare-report-item {
        padding: 8px 10px;
    }

    .siddet-compare-chart-wrap {
        height: 180px;
    }
}
