/**
 * Kind Team Grid - Frontend Styles
 */

/* Team Grid Container */
.ktg-team-grid-container {
    width: 100%;
}

/* Category Title */
.ktg-category-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Filter buttons */
.ktg-filter-buttons {
    text-align: center;
    margin-bottom: 30px;
}

.ktg-filter-button {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px 10px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 3px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.ktg-filter-button:hover,
.ktg-filter-button.active {
    background-color: #2EA3F2;
    color: #fff;
}

/* Team Grid */
.ktg-team-grid {
    display: flex;
    flex-wrap: wrap;
}

.ktg-team-member {
    box-sizing: border-box;
    padding: 0;
    border-radius:10px!important;
    background-color:#0b217a;
    margin-bottom: 30px;
}

.ktg-popup-enabled:hover {
    transform: scaleX(1.03) scaleY(1.03) !important;
    transition: transform 300ms ease 0ms, background-color 300ms ease 0ms;
    background-color:#0cb7a3;
}
.ktg-chyron-item:hover {
    transform:none!important;
    background-color:#0b217a!important;
}

/* Layout variations */
.grid_layout1 .ktg-team-member {
    width: 20%; margin-left:2.5%; margin-right:2.5%;
}

.grid_layout2 .ktg-team-member {
    width: 31.333%; margin-left:1%; margin-right:1%;
}

.grid_layout3 .ktg-team-member {
    width: 48%; margin-left:1%; margin-right:1%;
}

.grid_layout4 .ktg-team-member {
    width: 98%; margin-left:1%; margin-right: 1%;
}

/* Responsive */
@media (max-width: 980px) {
    .grid_layout1 .ktg-team-member,
    .grid_layout2 .ktg-team-member {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .grid_layout1 .ktg-team-member,
    .grid_layout2 .ktg-team-member,
    .grid_layout3 .ktg-team-member {
        width: 100%;
    }
}

/* Team Member */
.ktg-team-member-image {
    display: block;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    padding-top: 100%; /* Create a square aspect ratio container */
}

.ktg-team-member-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This maintains aspect ratio while filling container */
    display: block;
    transition: 300ms ease 0ms;
}

/* Special rules for chyron and flipper views */
.ktg-chyron-item .ktg-team-member-image,
.ktg-flipper-item .ktg-team-member-image {
    height: 70%; /* Adjust as needed */
    padding-top: 0;
    position: relative;
}

.ktg-team-member-content {
    text-align: left;
    padding-left:10px;
}

.ktg-team-member-name {
    font-size: 21px;
    line-height: 1.0;
    text-align:left;
}

.ktg-team-member-designation {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
    text-align:left;
}

.ktg-team-member-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Chyron Styling */
.ktg-chyron-container {
    width: 100%;
    height: 300px; /* Default height if not specified */
    position: relative;
    overflow: hidden;
    margin: 0;
    background-color: #f5f5f5;
}

.ktg-chyron-wrap {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    position: relative;
    height: 100%;
    will-change: transform;
}

/* Animation keyframes for scrolling */
@keyframes ktgScrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes ktgScrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Apply animations based on direction */
.ktg-chyron-direction-left .ktg-chyron-wrap {
    animation: ktgScrollLeft linear infinite;
}

.ktg-chyron-direction-right .ktg-chyron-wrap {
    animation: ktgScrollRight linear infinite;
}

/* Animation speeds - UPDATED */
.ktg-chyron-speed-crawl .ktg-chyron-wrap {
    animation-duration: 500s;
}

.ktg-chyron-speed-slow .ktg-chyron-wrap {
    animation-duration: 25s;
}

.ktg-chyron-speed-regular .ktg-chyron-wrap {
    animation-duration: 8s;
}

.ktg-chyron-speed-fast .ktg-chyron-wrap {
    animation-duration: 3.2s;
}

.ktg-chyron-speed-sprint .ktg-chyron-wrap {
    animation-duration: 0.6s;
}

/* Pause on hover */
.ktg-chyron-pause-hover:hover .ktg-chyron-wrap {
    animation-play-state: paused;
}

/* Chyron items */
.ktg-chyron-item {
    flex: 0 0 100%;
    padding: 0!important;
    box-sizing: border-box;
    margin: 0;
    border-radius: 0;
    transition: transform 300ms ease 0ms, background-color 300ms ease 0ms;
    height: 100%; /* Adjust for padding */
    width:250px;
}

/* No gap between the last and first items */
.ktg-chyron-wrap .ktg-chyron-item:last-child {
    margin-right: 0;
}

/* No members message */
.ktg-no-members-message {
    padding: 20px;
    text-align: center;
    font-style: italic;
    color: #666;
}

/* Popup Styling */
.mfp-hide,
.ktg-member-popup {
    display: none !important;
}
.ktg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 50px 0;
}

.ktg-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ktg-member-popup {
    position: relative;
    max-width: 900px;
    width: 90%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(255, 255, 255, 0.3);
    padding: 0;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000000;
}

.ktg-overlay.active .ktg-member-popup {
    opacity: 1;
    transform: scale(1);
}

.ktg-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background-color: rgba(28, 184, 167, 1.0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 1000001;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ktg-popup-close:hover {
    background-color: rgba(28, 184, 167, 0.5);
}

.ktg-popup-close:before,
.ktg-popup-close:after {
    content: '';
    position: absolute;
    width: 15px;
    height: 2px;
    background-color: currentColor;
}

.ktg-popup-close:before {
    transform: rotate(45deg);
}

.ktg-popup-close:after {
    transform: rotate(-45deg);
}

.ktg-popup-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
}

.ktg-popup-image {
    width: 35%;
    padding-right: 30px;
}

.ktg-popup-image img {
    width: 100%;
    height: auto;
}

.ktg-popup-content {
    width: 65%;
}

.ktg-popup-name {
    font-size: 28px;
    margin-bottom: 5px;
    line-height: 1.2;
    color: #333;
}

.ktg-popup-designation {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Contact info styling */
.ktg-popup-contact-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.ktg-popup-email,
.ktg-popup-phone {
    margin-bottom: 5px;
}

.ktg-popup-email a,
.ktg-popup-phone a {
    color: #2EA3F2;
    text-decoration: none;
}

.ktg-popup-email a:hover,
.ktg-popup-phone a:hover {
    text-decoration: underline;
}

.ktg-popup-description {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #444;
}

.ktg-popup-description p {
    margin-bottom: 15px;
}

/* Team Member Cursor */
.ktg-popup-trigger {
    cursor: pointer !important;
}

.ktg-popup-enabled {
    cursor: pointer !important;
}

/* Responsive Popup */
@media (max-width: 767px) {
    .ktg-popup-image,
    .ktg-popup-content {
        width: 100%;
    }
    
    .ktg-popup-image {
        padding-right: 0;
        margin-bottom: 20px;
    }
    
    .ktg-popup-inner {
        padding: 20px;
    }
    
    .ktg-overlay {
        padding: 15px;
    }
    
    /* Responsive Chyron */
    .ktg-chyron-item {
        flex: 0 0 200px;
    }
}

/* Flipper Styling - Updated for sliding transition */
.ktg-flipper-container {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    background-color: #f5f5f5;
    height: 300px;
    width: 100%;
}

.ktg-flipper-slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.ktg-flipper-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.ktg-flipper-active {
    display: block;
    z-index: 1;
}

.ktg-flipper-next {
    display: block;
    z-index: 2;
}

/* Slide directions */
.ktg-flipper-direction-right-to-left .ktg-flipper-next {
    left: 100%;
    transition: transform 0.5s ease-in-out;
}

.ktg-flipper-direction-right-to-left.ktg-flipper-animating .ktg-flipper-next {
    transform: translateX(-100%);
}

.ktg-flipper-direction-left-to-right .ktg-flipper-next {
    left: -100%;
    transition: transform 0.5s ease-in-out;
}

.ktg-flipper-direction-left-to-right.ktg-flipper-animating .ktg-flipper-next {
    transform: translateX(100%);
}

.ktg-flipper-direction-up-to-down .ktg-flipper-next {
    top: -100%;
    left: 0;
    transition: transform 0.5s ease-in-out;
}

.ktg-flipper-direction-up-to-down.ktg-flipper-animating .ktg-flipper-next {
    transform: translateY(100%);
}

.ktg-flipper-direction-down-to-up .ktg-flipper-next {
    top: 100%;
    left: 0;
    transition: transform 0.5s ease-in-out;
}

.ktg-flipper-direction-down-to-up.ktg-flipper-animating .ktg-flipper-next {
    transform: translateY(-100%);
}

.ktg-flipper-slide-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

.ktg-flipper-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0 5px;
    background-color: #0b217a;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.ktg-flipper-members-1 .ktg-flipper-item {
    max-width: 300px;
    margin: 0 auto;
}

.ktg-flipper-members-2 .ktg-flipper-item {
    max-width: 48%;
}

.ktg-flipper-members-3 .ktg-flipper-item {
    max-width: 32%;
}

.ktg-flipper-members-4 .ktg-flipper-item {
    max-width: 24%;
}

.ktg-flipper-members-5 .ktg-flipper-item {
    max-width: 19%;
}

/* Responsive styles */
@media (max-width: 768px) {
    .ktg-flipper-members-4 .ktg-flipper-item,
    .ktg-flipper-members-5 .ktg-flipper-item {
        max-width: 48%;
    }
    
    .ktg-flipper-slide-row {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ktg-flipper-members-2 .ktg-flipper-item,
    .ktg-flipper-members-3 .ktg-flipper-item,
    .ktg-flipper-members-4 .ktg-flipper-item,
    .ktg-flipper-members-5 .ktg-flipper-item {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .ktg-flipper-slide-row {
        flex-direction: column;
        align-items: center;
    }
}