﻿:root {
    --ts-primary: #1a2a4a;
    --ts-blue: #1e5288;
    --ts-red: #c9302c;
    --ts-green: #28a745;
    --ts-purple: #6f42c1;
    --ts-border: #dee2e6;
    --ts-bg-light: #f8f9fa;
}

.teskilat-section {
    padding: 40px 0;
    background: #fff;
    touch-action: pan-x pan-y;
}

/* SVG connector overlay - covers the whole chart */
#org-svg-connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.teskilat-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative; /* needed for SVG overlay */
}

/* ─── BAŞKAN ─── */
.baskan-wrapper-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.baskan-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 40px;
    background: var(--ts-primary);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

    .baskan-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(26, 42, 74, 0.3);
    }

.baskan-img {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.3);
    margin-bottom: 12px;
    background: rgba(255,255,255,0.1);
}

    .baskan-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

.baskan-unvan {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.baskan-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

/* Spacer below başkan card - JS will draw the line */
.vertical-line {
    width: 2px;
    height: 35px;
    background: transparent; /* SVG handles this now */
}

/* ─── ANA YAPI ─── */
.seviye-wrapper {
    position: relative;
}

/* Remove ALL old CSS-drawn lines */
.horizontal-line {
    display: none !important;
}

.vertical-connector-up,
.kolon-connector,
.horizontal-connector {
    display: none !important;
}

.ana-yapi {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 10px;
}

.sol-grup,
.sag-grup {
    display: flex;
    gap: 8px;
}

.orta-grup {
    display: flex;
    gap: 8px;
}

.musavir-grup,
.tasra-grup {
    display: flex;
}

.byrd-grup {
    display: flex;
    gap: 6px;
    position: relative;
}

.kolon {
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-width: 320px;
    flex: 1;
    position: relative;
    z-index: 2;
}

/* Remove ALL pseudo-element lines - replaced by SVG */
.sol-grup .byrd-satir:not(.empty)::before,
.sag-grup .byrd-satir:not(.empty)::before,
.sol-grup .gm-satir:not(.empty)::before,
.sag-grup .gm-satir:not(.empty)::before,
.sol-grup .gm-satir:not(.empty) .gm-item::before,
.sag-grup .gm-satir:not(.empty) .gm-item::before,
.sol-grup .kolon:not(.direkt-kolon) .db-satir:not(.empty)::before,
.sag-grup .kolon:not(.direkt-kolon) .db-satir:not(.empty)::before,
.orta-grup .kolon .db-satir:not(.empty)::before,
.sol-grup .kolon:not(.direkt-kolon) .db-satir:not(.empty) .db-item::before,
.sag-grup .kolon:not(.direkt-kolon) .db-satir:not(.empty) .db-item::before,
.orta-grup .kolon .db-satir:not(.empty) .db-item::before,
.sag-grup .byrd-grup:has(.direkt-kolon)::before,
.sag-grup .byrd-grup:has(.direkt-kolon)::after {
    display: none !important;
    content: none !important;
}

/* ─── SATIR LAYOUTS ─── */
.byrd-satir {
    height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 25px;
    position: relative;
}

    .byrd-satir.empty {
        position: relative;
        padding-top: 25px;
    }

.gm-satir {
    height: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 15px;
    position: relative;
}

    .gm-satir.empty {
    }

.db-satir {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 10px;
    position: relative;
}

/* ─── BYRD CARD (Başkan Yardımcısı) ─── */
.byrd-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: #fff;
    border: 2px solid var(--ts-primary);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 220px;
    position: relative;
    z-index: 2;
}

    .byrd-card:hover {
        background: var(--ts-primary);
    }

        .byrd-card:hover .byrd-unvan,
        .byrd-card:hover .byrd-name {
            color: #fff;
        }

.byrd-img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--ts-border);
    margin-bottom: 8px;
    background: var(--ts-bg-light);
}

    .byrd-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

.byrd-unvan {
    font-size: 9px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    transition: color 0.3s;
}

.byrd-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ts-primary);
    transition: color 0.3s;
    text-align: center;
}

/* ─── GM ITEM ─── */
.gm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #26394A;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    z-index: 2;
}

    .gm-item:hover {
        transform: translateX(3px);
        box-shadow: 0 4px 15px #26394A;
    }

    .gm-item.direkt {
        background: #fff;
        border-color: #26394A;
    }

.gm-photo {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8b0 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

    .gm-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

.gm-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

    .gm-info .item-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--ts-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gm-info .item-title {
        font-size: 10px;
        font-weight: 700;
        color: #555;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* ─── DB ITEM ─── */
.db-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: var(--ts-bg-light);
    border: 1px solid var(--ts-border);
    border-left: 3px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    z-index: 2;
}

    .db-item:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .db-item.direkt {
        border-left: 3px solid #ddd;
    }

        .db-item.direkt:hover {
            border-color: var(--ts-primary);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

    .db-item .item-name {
        font-size: 12px;
        font-weight: 600;
        color: var(--ts-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .db-item .item-title {
        font-size: 10px;
        color: #666;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* ─── DIREKT KOLON ─── */
.direkt-kolon {
    position: relative;
}

/* ─── MUSAVIR ─── */
.musavir-kolon {
    min-width: 220px;
    max-width: 260px;
}

.musavir-liste {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.musavir-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: var(--ts-bg-light);
    border: 1px solid var(--ts-border);
    border-left: 3px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

    .musavir-item:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .musavir-item .item-name {
        font-size: 12px;
        font-weight: 600;
        color: var(--ts-primary);
    }

    .musavir-item .item-title {
        font-size: 10px;
        color: #666;
    }

/* ─── TASRA ─── */
.tasra-kolon {
    min-width: 150px;
    max-width: 170px;
}

.tasra-liste {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.tasra-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: var(--ts-bg-light);
    border: 1px solid var(--ts-border);
    border-left: 3px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

    .tasra-item:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .tasra-item .item-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--ts-primary);
    }

    .tasra-item .item-title {
        font-size: 10px;
        color: #666;
    }

/* ─── RESPONSIVE ─── */
@media (max-width: 1800px) {
    .kolon {
        min-width: 250px;
        max-width: 290px;
    }
}

@media (max-width: 1600px) {
    .kolon {
        min-width: 220px;
        max-width: 260px;
    }

    .ana-yapi {
        gap: 10px;
    }
}

@media (max-width: 1400px) {
    .kolon {
        min-width: 200px;
        max-width: 240px;
    }

    .ana-yapi {
        gap: 8px;
    }

    .gm-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .gm-photo {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
}

@media (max-width: 1200px) {
    .kolon {
        min-width: 180px;
        max-width: 220px;
    }

    .gm-info .item-name,
    .db-item .item-name {
        font-size: 11px;
    }

    .gm-info .item-title,
    .db-item .item-title {
        font-size: 9px;
    }
}

@media (max-width: 992px) {
    #org-svg-connectors {
        display: none;
    }

    .ana-yapi {
        flex-direction: column;
        align-items: center;
    }

    .sol-grup,
    .sag-grup,
    .orta-grup,
    .musavir-grup,
    .tasra-grup {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .byrd-grup {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .kolon {
        width: 100%;
        max-width: 450px;
        margin-bottom: 30px;
    }

    .byrd-satir,
    .gm-satir {
        height: auto;
        min-height: auto;
        padding-top: 10px;
    }

        .byrd-satir.empty,
        .gm-satir.empty {
            display: none;
        }

    .musavir-liste,
    .tasra-liste {
        margin-top: 0;
    }
}

@media (max-width: 576px) {
    .baskan-card {
        padding: 15px 25px;
    }

    .baskan-img {
        width: 65px;
        height: 65px;
    }

    .baskan-name {
        font-size: 15px;
    }

    .kolon {
        min-width: unset;
    }
}

/* ─── PROFILE IMAGE in biyografi ─── */
.content_block_1 .text img[src*="osema"] {
    width: 180px !important;
    height: 180px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: top center !important;
    border: 5px solid white !important;
    box-shadow: 0 10px 40px rgba(37, 38, 56, 0.2) !important;
    margin: 0 30px 20px 0 !important;
    float: left !important;
}

/* ─── MODAL ─── */
.db-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

    .db-modal-overlay.active {
        display: flex;
    }

.db-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px 40px;
    max-width: 700px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.db-modal-body {
    display: flex;
    align-items: center;
    gap: 25px;
}

.db-modal-photo {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #1a2a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

    .db-modal-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

.db-modal-info {
    flex: 1;
    min-width: 0;
}

@@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.db-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    background: none;
    border: none;
    line-height: 1;
}

    .db-modal-close:hover {
        color: #333;
    }

.db-modal-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-modal-name {
    font-size: 26px;
    font-weight: 700;
    color: #1a2a4a;
    margin-bottom: 25px;
}

.db-modal-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
}

.db-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

    .db-contact-item:hover {
        color: #26394A;
    }

.db-contact-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .db-contact-icon svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    .db-contact-icon.phone svg {
        fill: #26394A;
    }

    .db-contact-icon.fax svg {
        fill: #26394A;
    }

    .db-contact-icon.email svg {
        fill: #26394A;
    }

.db-contact-text {
    font-size: 15px;
}

/* Clickable cards */
.db-item.db-clickable,
.musavir-item.db-clickable,
.tasra-item.db-clickable {
    cursor: pointer;
}

    .db-item.db-clickable:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 12px rgba(26, 42, 74, 0.15);
    }

    .musavir-item.db-clickable:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 12px rgba(26, 42, 74, 0.15);
    }

    .tasra-item.db-clickable:hover {
        border-color: var(--ts-primary);
        box-shadow: 0 2px 12px rgba(26, 42, 74, 0.15);
    }

@@media (max-width: 576px) {
    .db-modal-content {
        padding: 25px 20px;
    }

    .db-modal-body {
        flex-direction: column;
        text-align: center;
    }

    .db-modal-photo {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    .db-modal-contacts {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .db-modal-name {
        font-size: 22px;
    }
}
