/* ==========================================================================
   Kidan Accordion Widget - Vertical Collapsible Panels
   ========================================================================== */

.kidan-accordion {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 15px;
}
.kidan-accordion-item {
    width: 75px;
	max-height: 300px !important;
    min-height: 300px !important;
}
.kidan-accordion-item.active {
    width: fit-content;
}
/* Individual Accordion Item */
.kidan-accordion-item {
    background-color: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 60px; /* Collapsed state is thin/compact */
}

/* Header Container */
.kidan-accordion-header {
    position: relative;
    padding: 15px 20px; /* Very small padding for collapsed */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Collapsed Title (VERTICAL - rotated 90deg for collapsed state) */
.kidan-accordion-title-collapsed {
    font-family: 'Gantari', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.4;
    color: #000000;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg); /* Rotate so text reads from bottom to top */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

/* Expanded Title (HORIZONTAL - normal horizontal text for expanded state) */
.kidan-accordion-title-vertical {
    font-family: 'Gantari', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.4;
    color: #FFFFFF;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state - show VERTICAL (rotated) title */
.kidan-accordion-item:not(.active) .kidan-accordion-title-collapsed {
    display: block;
    opacity: 1;
    visibility: visible;
}

.kidan-accordion-item:not(.active) .kidan-accordion-title-vertical {
    display: none;
    opacity: 0;
    visibility: hidden;
}

/* Collapsed state - hide expanded content */
.kidan-accordion-item:not(.active) .kidan-accordion-expanded-content {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* Active/Expanded State */
.kidan-accordion-item.active {
    background-color: #0066FF;
    min-height: auto; /* Remove min-height for expanded */
}

/* Active state - larger padding for expanded, different layout */
.kidan-accordion-item.active .kidan-accordion-header {
    padding: 40px;
    display: block; /* Change to block for expanded state */
    align-items: flex-start;
    justify-content: flex-start;
}

/* Active state - hide vertical (collapsed) title, show horizontal (expanded) title */
.kidan-accordion-item.active .kidan-accordion-title-collapsed {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.kidan-accordion-item.active .kidan-accordion-title-vertical {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Active state - show expanded content */
.kidan-accordion-item.active .kidan-accordion-expanded-content {
    display: block;
    opacity: 1;
    max-height: none;
    padding-right: 0; /* No extra padding needed */
    animation: fadeInExpand 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Expanded Heading */
.kidan-accordion-heading {
    font-family: 'Gantari', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.3;
    color: #FFFFFF;
    margin: 0 0 20px 0;
}

/* Expanded Content */
.kidan-accordion-content {
    font-family: 'Gantari', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.kidan-accordion-content p {
    margin: 0 0 15px 0;
}

.kidan-accordion-content p:last-child {
    margin-bottom: 0;
}

/* Hover Effect */
.kidan-accordion-item:not(.active):hover {
    background-color: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animation for content expansion */
@keyframes fadeInExpand {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .kidan-accordion-header {
        padding: 20px;
    }

    .kidan-accordion-item.active .kidan-accordion-header {
        padding: 30px;
    }

    .kidan-accordion-title-collapsed {
        font-size: 16px;
    }

    .kidan-accordion-title-vertical {
        font-size: 14px;
        right: 20px;
    }

    .kidan-accordion-item.active .kidan-accordion-expanded-content {
        padding-right: 60px;
    }

    .kidan-accordion-heading {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .kidan-accordion-content {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .kidan-accordion-heading {
        font-size: 20px;
    }

    .kidan-accordion-content {
        font-size: 14px;
    }

    .kidan-accordion-item.active .kidan-accordion-expanded-content {
        padding-right: 50px;
    }
}