﻿/* =========================================================
   KALPAVRIKSHA - COMPLETE FINAL CSS
========================================================= */

.vm-kalpa-section {
    width: 100%;
    padding: 35px 0 55px;
    background: #fffaf1;
}


/* =========================================================
   HEADER
========================================================= */

.vm-kalpa-header {
    margin-bottom: 22px;
}

.vm-kalpa-shlok {
    display: inline-block;
    margin-bottom: 8px;
    padding: 5px 14px;
    border: 1px solid #ead7b0;
    border-radius: 20px;
    background: #fff8e7;
    color: #92400e;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
}

.vm-kalpa-title {
    margin: 0;
    color: #7c2d12;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.25;
}

.vm-kalpa-subtitle {
    margin-top: 7px;
    color: #6b7280;
    font-size: 15px;
}

.vm-kalpa-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 260px;
    margin: 12px auto 0;
}

    .vm-kalpa-divider span {
        flex: 1;
        height: 1px;
        background: #e8c98d;
    }

    .vm-kalpa-divider i {
        color: #d97706;
        font-size: 15px;
    }


/* =========================================================
   TOOLBAR
========================================================= */

.vm-kalpa-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.vm-kalpa-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1px solid #d97706;
    border-radius: 8px;
    background: #fff;
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

    .vm-kalpa-toolbar-btn:hover:not(:disabled) {
        background: #fff4db;
        border-color: #b45309;
        color: #7c2d12;
    }

    .vm-kalpa-toolbar-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.vm-kalpa-download-btn {
    background: #fff4db;
}


/* =========================================================
   HISTORY
========================================================= */

.vm-kalpa-history-box {
    width: 100%;
    margin-bottom: 22px;
    padding: 10px 14px;
    border: 1px solid #ead7b0;
    border-radius: 10px;
    background: #fff;
}

.vm-kalpa-history-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
}

.vm-kalpa-history-icon {
    font-size: 14px;
}

.vm-kalpa-history {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.vm-kalpa-history-item {
    color: #92400e;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

    .vm-kalpa-history-item.vm-kalpa-history-current {
        color: #7c2d12;
        font-weight: 700;
        cursor: default;
    }



.vm-kalpa-history-separator {
    margin: 0 3px;
    color: #a16207;
}


/* =========================================================
   PARENT AREA
========================================================= */

.vm-kalpa-parent-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.vm-kalpa-current-parent {
    display: flex;
    justify-content: center;
    width: 100%;
}


/* =========================================================
   CURRENT / PARENT CARD
========================================================= */

.vm-kalpa-current-card {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 460px;
    min-height: 110px;
    gap: 15px;
    padding: 13px 18px;
    background: #fff;
    border: 1px solid #e8c98d;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(124, 45, 18, .08);
}


/* =========================================================
   CURRENT PHOTO
========================================================= */

.vm-kalpa-current-photo {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 50%;
    background: #fff8e7;
}

.vm-kalpa-current-image {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 3px solid #f0c36d;
    border-radius: 50%;
}

.vm-kalpa-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border: 3px solid #f0c36d;
    border-radius: 50%;
    background: #fff8e7;
    color: #b45309;
    font-size: 25px;
}


/* =========================================================
   CURRENT INFO
========================================================= */

.vm-kalpa-current-info {
    min-width: 0;
    flex: 1;
}

.vm-kalpa-current-name {
    color: #7c2d12;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.vm-kalpa-current-code {
    margin-top: 3px;
    color: #a16207;
    font-size: 12px;
}

.vm-kalpa-current-relation {
    margin-top: 3px;
    color: #6b7280;
    font-size: 13px;
}

.vm-kalpa-current-spouse {
    margin-top: 4px;
    color: #92400e;
    font-size: 12px;
}


/* =========================================================
   PARENT → CHILD MAIN CONNECTOR
========================================================= */

.vm-kalpa-parent-connector {
    position: relative;
    width: 100%;
    height: 32px;
    margin: 0;
}


    /* Parent vertical trunk */
    .vm-kalpa-parent-connector::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 3px;
        height: 30px;
        transform: translateX(-50%);
        background: #d6b16b;
        border-radius: 3px;
        z-index: 20;
    }


    /* Parent horizontal branch */
    .vm-kalpa-parent-connector::after {
        content: "";
        position: absolute;
        top: 28px;
        left: var(--vm-kalpa-branch-left, 0);
        width: var(--vm-kalpa-branch-width, 100%);
        height: 3px;
        background: #d6b16b;
        border-radius: 3px;
        z-index: 20;
    }


/* =========================================================
   TREE AREA
========================================================= */

.vm-kalpa-tree-area {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}


/* =========================================================
   CHILDREN WRAPPER
========================================================= */

.vm-kalpa-children-wrapper {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0 2px 18px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
}


/* =========================================================
   CHILDREN ROW
========================================================= */

.vm-kalpa-children {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(6px, .65vw, 10px);
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
}


/* =========================================================
   CHILD ITEM
========================================================= */

.vm-kalpa-child-item {
    position: relative;
    flex: 0 0 auto;
    /*
       Space for vertical connector.
    */
    padding-top: 38px;
}


    /* =========================================================
   CHILD VERTICAL CONNECTOR
========================================================= */

    /*
   Parent horizontal line is at 28px.

   Child connector starts above it,
   therefore it physically overlaps the
   parent horizontal line.

   No visible gap.
*/

    .vm-kalpa-child-item::before {
        content: "";
        position: absolute;
        top: -5px;
        left: 50%;
        width: 3px;
        height: 43px;
        transform: translateX(-50%);
        background: #d6b16b;
        border-radius: 3px;
        z-index: 30;
    }


    /* =========================================================
   CHILD BRANCH JUNCTION
========================================================= */

    .vm-kalpa-child-item::after {
        content: "";
        position: absolute;
        top: 28px;
        left: 50%;
        width: 8px;
        height: 8px;
        transform: translate(-50%, -50%);
        background: #fffaf1;
        border: 2px solid #d6b16b;
        border-radius: 50%;
        z-index: 31;
    }


/* =========================================================
   CHILD CARD
========================================================= */

.vm-kalpa-card {
    position: relative;
    width: clamp(95px, 8.5vw, 130px);
    min-width: clamp(95px, 8.5vw, 130px);
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 5px 7px;
    background: #fff;
    border: 1px solid #ead7b0;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(124, 45, 18, .07);
    cursor: default;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}


    /* Clickable card */
    .vm-kalpa-card.clickable {
        cursor: pointer;
    }

        .vm-kalpa-card.clickable:hover {
            transform: translateY(-3px);
            border-color: #e8c98d;
            box-shadow: 0 7px 18px rgba(124, 45, 18, .12);
        }


/* =========================================================
   OLD CARD CONNECTORS DISABLED
========================================================= */

.vm-kalpa-card-has-child {
    cursor: pointer;
}

.vm-kalpa-card-leaf {
    cursor: default;
}

.vm-kalpa-card.has-tree-connector:hover {
    transform: translateY(-2px);
}

.vm-kalpa-card.has-tree-connector::before,
.vm-kalpa-card.has-tree-connector::after {
    display: none !important;
    content: none !important;
}


/* =========================================================
   CHILD PHOTO
========================================================= */

.vm-kalpa-card-photo {
    width: 67px;
    height: 67px;
    flex: 0 0 67px;
    overflow: hidden;
    border-radius: 50%;
    background: #fff8e7;
}

.vm-kalpa-card-image {
    display: block;
    width: 67px;
    height: 67px;
    object-fit: cover;
    border: 2px solid #f0c36d;
    border-radius: 50%;
}

.vm-kalpa-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 67px;
    height: 67px;
    border: 2px solid #f0c36d;
    border-radius: 50%;
    background: #fff8e7;
    color: #b45309;
    font-size: 20px;
}


/* =========================================================
   CHILD TEXT
========================================================= */

.vm-kalpa-card-name {
    width: 100%;
    margin-top: 10px;
    padding-bottom: 5px;
    overflow: hidden;
    color: #7c2d12;
    font-size: clamp(10px, 1vw, 13px);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vm-kalpa-card-code {
    width: 100%;
    margin-top: 2px;
    overflow: hidden;
    color: #a16207;
    font-size: clamp(8px, .8vw, 10px);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.vm-kalpa-card-relation {
    width: 100%;
    margin-top: 2px;
    overflow: hidden;
    color: #6b7280;
    font-size: clamp(8px, .8vw, 10px);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.vm-kalpa-card-spouse {
    width: 100%;
    margin-top: 2px;
    overflow: hidden;
    color: #92400e;
    font-size: clamp(8px, .8vw, 10px);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   NEXT LEVEL SYMBOL
========================================================= */

.vm-kalpa-child-symbol {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid #e8c98d;
    border-radius: 50%;
    background: #fff8e7;
    color: #b45309;
    font-size: 13px;
}

    .vm-kalpa-child-symbol i {
        line-height: 1;
    }


/* =========================================================
   NO CHILD
========================================================= */

.vm-kalpa-no-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

.vm-kalpa-no-child-icon {
    margin-bottom: 7px;
    color: #d97706;
    font-size: 25px;
}


/* =========================================================
   CONTENT
========================================================= */

.vm-kalpa-content {
    margin-top: 35px;
}

    .vm-kalpa-content h2 {
        margin-top: 25px;
        margin-bottom: 10px;
        color: #7c2d12;
        font-size: 22px;
        font-weight: 700;
    }

    .vm-kalpa-content h3 {
        margin-top: 20px;
        margin-bottom: 8px;
        color: #92400e;
        font-size: 18px;
        font-weight: 700;
    }

    .vm-kalpa-content p {
        margin-bottom: 12px;
        color: #4b5563;
        font-size: 15px;
        line-height: 1.8;
    }


/* =========================================================
   MOBILE - 767px
========================================================= */

@media (max-width: 767.98px) {

    .vm-kalpa-section {
        padding: 25px 0 40px;
    }

    .vm-kalpa-shlok {
        margin-bottom: 6px;
        padding: 4px 11px;
        font-size: 14px;
    }

    .vm-kalpa-title {
        font-size: 22px;
    }

    .vm-kalpa-subtitle {
        font-size: 13px;
    }


    /* Toolbar */

    .vm-kalpa-toolbar-btn {
        padding: 7px 10px;
        font-size: 11px;
    }


    /* History */

    .vm-kalpa-history-box {
        padding: 8px 10px;
    }

    /* Parent */

    .vm-kalpa-current-card {
        max-width: 100%;
        min-height: 90px;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .vm-kalpa-current-photo,
    .vm-kalpa-current-image,
    .vm-kalpa-no-image {
        width: 64px;
        height: 64px;
    }

    .vm-kalpa-current-photo {
        flex-basis: 64px;
    }

    .vm-kalpa-current-image,
    .vm-kalpa-no-image {
        border-width: 2px;
    }

    .vm-kalpa-current-name {
        font-size: 15px;
    }

    .vm-kalpa-current-code {
        font-size: 10px;
    }

    .vm-kalpa-current-relation {
        font-size: 11px;
    }

    .vm-kalpa-current-spouse {
        font-size: 10px;
    }


    /* Parent connector */

    .vm-kalpa-parent-connector {
        height: 32px;
    }

        .vm-kalpa-parent-connector::before {
            height: 30px;
        }

        .vm-kalpa-parent-connector::after {
            top: 28px;
        }


    /* Children */

    .vm-kalpa-children-wrapper {
        margin: 0;
        padding: 0 2px 18px;
    }

    .vm-kalpa-children {
        gap: 7px;
    }

    .vm-kalpa-child-item {
        padding-top: 38px;
    }

        .vm-kalpa-child-item::before {
            top: -5px;
            height: 43px;
        }

        .vm-kalpa-child-item::after {
            top: 28px;
        }


    /* Child card */

    .vm-kalpa-card {
        width: 105px;
        min-width: 105px;
        height: 140px;
    }

    .vm-kalpa-card-photo,
    .vm-kalpa-card-image,
    .vm-kalpa-card-no-image {
        width: 60px;
        height: 60px;
    }

    .vm-kalpa-card-photo {
        flex-basis: 60px;
    }

    .vm-kalpa-card-name {
        font-size: 10px;
    }

    .vm-kalpa-card-code {
        font-size: 8px;
    }

    .vm-kalpa-card-relation {
        font-size: 9px;
    }

    .vm-kalpa-card-spouse {
        font-size: 8px;
    }

    .vm-kalpa-child-symbol {
        width: 19px;
        height: 19px;
        font-size: 12px;
    }


    /* Content */

    .vm-kalpa-content {
        margin-top: 28px;
    }

        .vm-kalpa-content h2 {
            font-size: 20px;
        }

        .vm-kalpa-content h3 {
            font-size: 17px;
        }

        .vm-kalpa-content p {
            font-size: 14px;
            line-height: 1.75;
        }
}


/* =========================================================
   SMALL MOBILE - 400px
========================================================= */

@media (max-width: 400px) {

    .vm-kalpa-toolbar-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .vm-kalpa-current-name {
        font-size: 14px;
    }

    .vm-kalpa-card {
        width: 88px;
        min-width: 88px;
    }

    .vm-kalpa-card-photo,
    .vm-kalpa-card-image,
    .vm-kalpa-card-no-image {
        width: 60px;
        height: 60px;
    }

    .vm-kalpa-child-item {
        padding-top: 38px;
    }

        .vm-kalpa-child-item::before {
            top: -5px;
            height: 43px;
        }
}


.vm-kalpa-note-section {
    margin-top: 40px;
    margin-bottom: 20px;
}

.vm-kalpa-note {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 26px;
    border: 1px solid rgba(180, 140, 70, 0.25);
    border-radius: 16px;
    background: linear-gradient( 135deg, rgba(255, 250, 240, 0.95), rgba(255, 246, 225, 0.85) );
    box-shadow: 0 6px 20px rgba(80, 50, 20, 0.08);
}

.vm-kalpa-note-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(180, 140, 70, 0.12);
    font-size: 23px;
}

.vm-kalpa-note-content {
    flex: 1;
    min-width: 0;
}

.vm-kalpa-note-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.vm-kalpa-note-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

    .vm-kalpa-note-item + .vm-kalpa-note-item {
        margin-top: 13px;
    }

.vm-kalpa-note-number {
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    background: rgba(180, 140, 70, 0.14);
}

.vm-kalpa-note-item p {
    margin: 1px 0 0;
    font-size: 15px;
    line-height: 1.75;
}

.vm-kalpa-note-item strong {
    font-weight: 700;
}

.vm-kalpa-note-item .bi-flower1 {
    margin: 0 3px;
    font-size: 15px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 767px) {

    .vm-kalpa-note-section {
        margin-top: 30px;
    }

    .vm-kalpa-note {
        gap: 13px;
        padding: 18px 16px;
        border-radius: 13px;
    }

    .vm-kalpa-note-icon {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .vm-kalpa-note-title {
        margin-bottom: 14px;
        font-size: 17px;
    }

    .vm-kalpa-note-item {
        gap: 9px;
    }

    .vm-kalpa-note-number {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .vm-kalpa-note-item p {
        font-size: 14px;
        line-height: 1.65;
    }
}
