/* Regional Connection Tabs Widget Styles */

.regional-connection-tabs {
    width: 100%;
    padding: 40px 0;
}

.regional-tabs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Match height mode: stretch both columns to equal height */
.regional-connection-tabs.match-height .regional-tabs-container {
    align-items: stretch;
}

/* Tabs List */
.regional-tabs-list {
    display: flex;
    flex-direction: column;
}

/* Section Title inside Tabs List */
.regional-tabs-list .regional-tabs-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f242c;
    margin: 0 0 30px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.regional-tabs-title .title-icon-before,
.regional-tabs-title .title-icon-after {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Icon rendering fix */
.regional-tabs-title i {
    display: inline-block;
    line-height: inherit;
}

.regional-tabs-title svg {
    display: inline-block;
    fill: currentColor;
    stroke: currentColor;
}

.regional-tab-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 0;
    border-top: 1px solid #e8e8e8;
    cursor: pointer;
    gap: 35px;
    transition: all 0.3s ease;
    outline: none;
}

.regional-tab-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.regional-tab-item:focus-visible {
    outline: 2px solid #c9a26e;
    outline-offset: 2px;
}

.regional-tab-content {
    flex: 1;
}

.regional-tab-item h5 {
    font-size: 20px;
    font-weight: 600;
    color: #1f242c;
    margin: 0 0 12px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.regional-tab-item.active h5 {
    color: #c9a26e;
}

.regional-tab-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.regional-tab-info p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regional-tab-info svg,
.regional-tab-info i {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: inherit;
    flex-shrink: 0;
}

.regional-tab-info i {
    width: auto;
    height: auto;
    display: inline-block;
}

.regional-tab-info svg {
    fill: currentColor;
    stroke: currentColor;
}

/* Tab Arrow Icon */
.tab-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f3f4f6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: #1f242c;
}

.tab-arrow svg,
.tab-arrow i {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: inherit;
    transition: color 0.3s ease;
}

.tab-arrow i {
    width: auto;
    height: auto;
    display: inline-block;
    line-height: 1;
}

.tab-arrow svg {
    fill: currentColor;
    stroke: currentColor;
}

.regional-tab-item.active .tab-arrow {
    background-color: #c9a26e;
    color: #ffffff;
}

.regional-tab-item:hover .tab-arrow {
    transform: scale(1.05);
}

/* Image Wrapper */
.regional-tabs-image-wrapper {
    position: relative;
    width: 100%;
    /* Height controlled by Elementor - no default to avoid conflicts */
    overflow: hidden;
}

/* Match height mode: image takes 100% height of grid cell */
.regional-connection-tabs.match-height .regional-tabs-image-wrapper {
    height: 100%;
}

.regional-tabs-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.regional-tabs-image.active {
    opacity: 1;
    visibility: visible;
}

.regional-tabs-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 8px;
}

/* Ensure image fills full height in match mode - force 100% on all levels */
.regional-connection-tabs.match-height .regional-tabs-image-wrapper,
.regional-connection-tabs.match-height .regional-tabs-image,
.regional-connection-tabs.match-height .regional-tabs-image img {
    height: 100% !important;
    min-height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .regional-tabs-container {
        gap: 40px;
    }

    .regional-tab-item {
        padding: 25px 0;
        gap: 25px;
    }

    .regional-tab-item h5 {
        font-size: 18px;
    }

    .regional-tabs-image-wrapper {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .regional-connection-tabs {
        padding: 30px 0;
    }

    .regional-tabs-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .regional-tabs-container {
        grid-template-columns: 1fr;
        gap: 30px;
        display: flex;
        flex-direction: column;
    }

    /* Image lên trên, tabs xuống dưới */
    .regional-tabs-image-wrapper {
        order: -1;
    }

    .regional-tabs-list {
        order: 1;
    }

    .regional-tab-item {
        padding: 20px 0;
        gap: 20px;
    }

    .regional-tab-item h5 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .regional-tab-info {
        gap: 15px;
        flex-wrap: wrap;
    }

    .regional-tab-info p {
        font-size: 13px;
    }

    .tab-arrow {
        width: 44px;
        height: 44px;
    }

    .tab-arrow svg {
        width: 18px;
        height: 18px;
    }

    .regional-tabs-image-wrapper {
        height: 300px;
        order: -1; /* Move image above tabs on mobile */
    }
}

@media (max-width: 480px) {
    .regional-tabs-title {
        font-size: 20px;
    }

    .regional-tab-item {
        padding: 18px 0;
    }

    .regional-tab-item h5 {
        font-size: 15px;
    }

    .regional-tab-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tab-arrow {
        width: 40px;
        height: 40px;
    }

    .regional-tabs-image-wrapper {
        height: 250px;
    }
}

/* Animation for tab switching */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.regional-tabs-image.active {
    animation: fadeIn 0.5s ease;
}

/* Loading state */
.regional-tabs-image-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #c9a26e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

