/**
 * Language Slider Styles
 * Styling for the language slider widget
 */

/* Main Wrapper */
.mc-language-slider-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Carousel Container */
.mc-language-carousel {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.mc-carousel-track {
    display: flex;
    gap: 20px;
    width: fit-content;
    will-change: transform;
}

/* Infinite scroll animations */
.mc-carousel-left .mc-carousel-track {
    animation: scrollLeft var(--animation-speed, 20s) linear infinite;
}

.mc-carousel-right .mc-carousel-track {
    animation: scrollRight var(--animation-speed, 20s) linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(-33.33%);
    }
    100% {
        transform: translateX(-66.66%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-66.66%);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

/* Pause on hover */
.mc-language-carousel:hover .mc-carousel-track {
    animation-play-state: paused;
}

/* Language Item */
.mc-language-slider-item {
    border-radius: 30px;
    border: 3px solid #000;
    background: #FFF;
    display: inline-flex;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}

.mc-language-slider-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.mc-language-slider-item a {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 80px;
}

/* Flag */
.mc-language-flag {
    width: 80px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    order: 1;
}

.mc-language-flag svg,
.mc-language-flag img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Language Name */
.mc-language-name {
    color: #000;
    font-family: "articulat-cf", Sans-serif;
    font-size: 26px;
    font-style: normal;
    font-weight: 900;
    line-height: 28px;
    letter-spacing: -0.52px;
    white-space: nowrap;
    order: 2;
    padding: 0 20px;
    flex: 1;
}

/* Search Container */
.mc-language-search-container {
    margin-top: 30px;
    overflow: visible;
}

.mc-language-search-wrapper {
    position: relative;
    display: block;
    overflow: visible;
}



.mc-language-search-icon {
    position: absolute;
    left: 25px;
    top: 17px;
    z-index: 10;
    pointer-events: none;
}

.mc-language-search-input {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 50px;
    background: #EBEDE8;
    padding: 17px;
    padding-left: 70px;
    padding-right: 180px;
    color: #000;
    font-family: "articulat-cf", Sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 26px;
    letter-spacing: -0.32px;
    outline: none !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0;
    z-index: 5;
}

.mc-language-search-input:focus,
.mc-language-search-input:active,
.mc-language-search-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

.mc-language-search-input::placeholder {
    color: #000;
    opacity: 0.6;
}

.mc-language-search-button {
    position: absolute;
    right: 3px;
    top: 3px;
    color: #FFF;
    text-align: center;
    font-family: "articulat-cf", Sans-serif;
    font-size: 22px;
    font-style: normal;
    font-weight: 600;
    line-height: 52px;
    letter-spacing: -0.44px;
    border-radius: 30px;
    background: #000;
    display: flex;
    height: 52px;
    padding: 0 30px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.mc-language-search-button:hover {
    background: #333;
    transform: scale(1.05);
}

.mc-language-search-button:active {
    transform: scale(0.98);
}

/* Dropdown Styles */
.mc-language-dropdown {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    background: #EBEDE8;
    border-radius: 38px;
    border: 0 solid transparent;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top center;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    padding-top: 0;
}

.mc-language-dropdown.mc-dropdown-visible {
    max-height: 500px;
    opacity: 1;
    transform: scaleY(1);
    border: 3px solid #000;
    padding-top: 78px;
    padding-bottom: 20px;
    overflow: hidden;
	z-index:2;
}

.mc-dropdown-items-wrapper {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.mc-dropdown-item {
    padding: 15px 78px;
    color: #000;
    font-family: "articulat-cf", Sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 26px;
    letter-spacing: -0.32px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="26" viewBox="0 0 22 26" fill="none"><path d="M4.88839 0.696936L20.3116 13.4314C20.7222 13.77 21.0179 14.2274 21.1582 14.7407C21.2985 15.2541 21.2765 15.7983 21.0952 16.2986C20.9139 16.799 20.5823 17.231 20.1457 17.5354C19.7092 17.8398 19.1891 18.0016 18.657 17.9987H13.1178C12.3145 17.9983 11.522 18.1842 10.8026 18.5415C10.0831 18.8989 9.45628 19.4182 8.97122 20.0585L5.63355 24.4743C5.31309 24.8987 4.86984 25.2144 4.36391 25.3784C3.85798 25.5424 3.31385 25.5468 2.80532 25.391C2.29679 25.2353 1.84847 24.9269 1.52115 24.5077C1.19383 24.0885 1.00335 23.5788 0.975552 23.0477L0.0037187 3.12369C-0.0252225 2.54533 0.115257 1.9711 0.407929 1.47142C0.7006 0.97174 1.13274 0.568339 1.65134 0.31069C2.16995 0.0530414 2.75248 -0.047653 3.32748 0.0209567C3.90248 0.0895664 4.44496 0.324497 4.88839 0.696936Z" fill="black"/></svg>') 11 13, pointer;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease, 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mc-dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.mc-dropdown-item:nth-child(2) { animation-delay: 0.08s; }
.mc-dropdown-item:nth-child(3) { animation-delay: 0.11s; }
.mc-dropdown-item:nth-child(4) { animation-delay: 0.14s; }
.mc-dropdown-item:nth-child(5) { animation-delay: 0.17s; }
.mc-dropdown-item:nth-child(6) { animation-delay: 0.20s; }
.mc-dropdown-item:nth-child(7) { animation-delay: 0.23s; }
.mc-dropdown-item:nth-child(8) { animation-delay: 0.26s; }
.mc-dropdown-item:nth-child(n+9) { animation-delay: 0.29s; }

.mc-dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    padding-left: 83px;
    transform: translateX(0) scale(1.02);
}

.mc-dropdown-item.mc-dropdown-item-removing {
    animation: fadeOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeOutRight {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 100px;
    }
    50% {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
        max-height: 100px;
    }
    100% {
        opacity: 0;
        transform: translateX(40px) scale(0.9);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
}

.mc-dropdown-item.mc-no-results {
    cursor: default;
    opacity: 0.6;
    font-style: italic;
}

.mc-dropdown-item.mc-no-results:hover {
    background-color: transparent;
    padding-left: 78px;
}

/* Scrollbar for dropdown */
.mc-dropdown-items-wrapper::-webkit-scrollbar {
    width: 8px;
}

.mc-dropdown-items-wrapper::-webkit-scrollbar-track {
    background: #fff;
}

.mc-dropdown-items-wrapper::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 10px;
}

.mc-dropdown-items-wrapper::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Filtered Items */
.mc-language-slider-item.mc-filtered-out {
    animation: shrinkOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mc-language-slider-item.mc-filtered-in {
    animation: expandIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes shrinkOut {
    0% {
        opacity: 1;
        transform: scale(1);
        max-width: 300px;
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        max-width: 0;
        margin: 0;
        padding: 0;
        display: none;
    }
}

@keyframes expandIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Styles - Tablet */
@media screen and (max-width: 1024px) {
    .mc-carousel-track {
        gap: 15px;
    }

    .mc-language-slider-item a {
        height: 70px;
    }

    .mc-language-name {
        font-size: 22px;
        line-height: 26px;
        letter-spacing: -0.44px;
        padding: 0 18px;
    }

    .mc-language-flag {
        width: 70px;
    }

    .mc-language-search-input {
        font-size: 15px;
        padding-right: 160px;
    }

    .mc-language-search-button {
        font-size: 20px;
        padding: 0 25px;
        height: 48px;
        line-height: 48px;
    }
}

/* Responsive Styles - Mobile */
@media screen and (max-width: 768px) {
    .mc-carousel-track {
        gap: 12px;
    }

    .mc-language-carousel {
        margin-bottom: 15px;
    }

    .mc-language-slider-item {
        border-radius: 25px;
    }

    .mc-language-slider-item a {
        height: 60px;
    }

    .mc-language-name {
        color: #000;
        font-family: "articulat-cf", Sans-serif;
        font-size: 19px;
        font-style: normal;
        font-weight: 900;
        line-height: 28px;
        letter-spacing: -0.38px;
        padding: 0 15px;
    }

    .mc-language-flag {
        width: 60px;
    }

    .mc-language-search-container {
        margin-bottom: 20px;
    }

    .mc-language-search-input {
        padding: 15px;
        padding-left: 60px;
        padding-right: 15px;
        font-size: 14px;
        line-height: 24px;
    }

    .mc-language-search-icon {
        left: 20px;
        width: 20px;
        height: 22px;
    }

    /* Hide button on mobile - search happens on input */
    .mc-language-search-button {
        display: none;
    }

    .mc-dropdown-item {
        padding: 12px 68px;
        font-size: 14px;
        line-height: 24px;
    }

    .mc-dropdown-item:hover {
        padding-left: 73px;
    }

    .mc-dropdown-item.mc-no-results:hover {
        padding-left: 68px;
    }

    .mc-language-dropdown.mc-dropdown-visible {
        padding-top: 68px;
    }
}

/* Extra Small Mobile */
@media screen and (max-width: 479px) {
    .mc-carousel-track {
        gap: 8px;
    }

    .mc-language-carousel {
        margin-bottom: 8px;
    }

    .mc-language-slider-item {
        border-radius: 20px;
    }

    .mc-language-slider-item a {
        height: 50px;
    }

    .mc-language-name {
        font-size: 15px;
        line-height: 20px;
        padding: 0 10px;
    }

    .mc-language-flag {
        width: 50px;
    }

    .mc-language-search-input {
        font-size: 13px;
        padding: 12px;
        padding-left: 50px;
    }

    .mc-dropdown-item {
        padding: 10px 58px;
        font-size: 13px;
        line-height: 20px;
    }

    .mc-dropdown-item:hover {
        padding-left: 63px;
    }

    .mc-dropdown-item.mc-no-results:hover {
        padding-left: 58px;
    }

    .mc-language-dropdown.mc-dropdown-visible {
        padding-top: 63px;
    }

    .mc-language-search-icon {
        top: 12px;
    }
}

/* Animation for slide transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mc-language-slider-item[data-slide] {
    animation: slideIn 0.4s ease-out;
}

/* Loading State */
.mc-language-slider-wrapper.loading .mc-language-slider-item {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty Search Results */
.mc-language-slider:empty::after {
    content: "Nie znaleziono języków pasujących do wyszukiwania";
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-family: "articulat-cf", Sans-serif;
    font-size: 18px;
    font-weight: 500;
}

/* Accessibility */
.mc-language-slider-item:focus,
.mc-language-search-input:focus,
.mc-language-search-button:focus {
    outline: 3px solid #000;
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .mc-language-search-container {
        display: none;
    }
    
    .mc-language-slider-item {
        break-inside: avoid;
    }
}

/* Grid Layout Styles */
.mc-language-grid-wrapper {
    width: 100%;
}

.mc-language-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    column-gap: 20px;
    row-gap: 20px;
}

.mc-language-grid .mc-language-slider-item {
    margin: 0;
    flex: 0 1 auto;
    min-width: max-content;
}

.mc-language-grid .mc-language-slider-item a {
    width: auto;
    min-width: 100%;
}

.mc-language-grid .mc-language-slider-item:hover {
    transform: translateY(-3px);
}

.mc-language-grid .mc-language-slider-item.mc-filtered-out {
    display: none !important;
}

.mc-language-grid-wrapper .mc-language-search-container {
    margin-bottom: 30px;
    margin-top: 0;
    overflow: visible;
}

.mc-language-grid-wrapper .mc-language-search-wrapper {
    position: relative;
    display: block;
    overflow: visible;
}

/* Grid Responsive Adjustments */
@media screen and (max-width: 768px) {
    .mc-language-grid-wrapper .mc-language-search-container {
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 767px) {
    .mc-language-grid .mc-language-slider-item {
        flex: 0 1 auto;
        max-width: 50%;
        min-width: max-content;
    }
    
    .mc-language-grid .mc-language-slider-item a {
        width: auto;
    }
    
    .mc-language-grid .mc-language-name {
        font-size: 19px;
        line-height: 24px;
        padding: 0 12px;
    }
}

@media screen and (max-width: 479px) {
    .mc-language-grid .mc-language-name {
        font-size: 16px;
        line-height: 20px;
        padding: 0 10px;
    }
}
