/**
 * GTranslate Search UI V2 - New Design
 * Features: Search box at top, centered layout, equal padding, dual language display
 */

/* Main container */
.gt-language-selector-v2 {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: auto;
    min-width: auto;
    max-width: none;
    box-shadow: none;
    transition: all 0.3s ease;
}
body {
    top: 0 !important;
}
#custom-mobile {
    position: absolute;
    float: right;
    max-width: 60px;
    margin: 0 8px 0 8px;
    display: flex;
    align-items: center;
    height: 60px;
    right: -60px;
}
.gt-language-selector-v2:hover {
    /* No special hover effects for simple button */
}

.gt-language-selector-v2.gt-open {
    /* No special open effects for simple button */
}

/* Current language display */
.gt-current-selection {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    cursor: pointer;
    background: transparent;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    gap: 8px;
    border: none;
}

/* .gt-current-selection:hover {
    background: rgba(0, 0, 0, 0.05);
}

.gt-current-selection.active {
    background: rgba(66, 133, 244, 0.1);
} */

.gt-current-selection:focus {
    outline: none;
}

.gt-current-lang-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.gt-current-native {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.gt-current-english {
    font-size: 12px;
    color: #666;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none !important; /* Always hide English name in button */
}

/* Globe icon */
.gt-globe-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gt-globe-icon svg {
    width: 100%;
    height: 100%;
}

/* Hide dotted line */
.gt-dotted-line {
    display: none;
}

.gt-dropdown-arrow {
    display: none;
}

.gt-language-selector-v2.gt-open .gt-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.gt-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 235px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow: hidden;
    margin-top: 4px;
    max-height: 575px !important;
}

/* Ensure dropdown doesn't go off-screen on small screens */
@media (max-width: 280px) {
    .gt-dropdown-panel {
        width: calc(100vw - 20px);
        right: auto;
        left: 0;
    }
}

.gt-language-selector-v2.gt-open .gt-dropdown-panel {
    display: block;
}

/* Search container */
.gt-search-container {
    position: relative;
    padding: 12px;
    /* border-bottom: 1px solid #eee; */
    background: #fff;
}

.gt-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px !important;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.gt-search-input:focus {
    /* border-color: #4285f4; */
    /* box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2); */
}

.gt-search-container:focus-within .gt-search-icon svg path {
    /* stroke: #4285f4; */
}

.gt-search-input::placeholder {
    color: #999;
}

.gt-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.gt-search-icon svg {
    width: 100%;
    height: 100%;
}

.gt-search-icon svg path {
    stroke: #5d5d5d;
}

/* Language list - prevent Google Translate from translating */
.gt-language-list {
    max-height: 496px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

/* Custom scrollbar */
.gt-language-list::-webkit-scrollbar {
    width: 6px;
}

.gt-language-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.gt-language-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.gt-language-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Language item */
.gt-language-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* border-bottom: 1px solid #f0f0f0; */
    text-align: left;
    position: relative;
}

.gt-language-item:last-child {
    border-bottom: none;
}

.gt-language-item:hover {
    background: #f5f5f5;
}

.gt-language-item.selected {
    background: #e3f2fd;
    color: #1976d2;
}

.gt-language-item.selected::after {
    content: '✓';
    position: absolute;
    right: 15px;
    color: #1976d2;
    font-weight: bold;
}

/* Language names container */
.gt-language-names {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.gt-language-native {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.gt-language-english {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.gt-language-item.selected .gt-language-native {
    color: #1976d2;
}

.gt-language-item.selected .gt-language-english {
    color: #1565c0;
}

/* Popular languages separator - Hidden */
.gt-language-separator {
    display: none;
}

/* Popular languages styling */
.gt-language-item.popular {
    background: #fff;
}

.gt-language-item.popular:hover {
    background: #EFF6FF;
}

/* Loading state */
.gt-language-selector-v2.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gt-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No results message */
.gt-no-results {
    padding: 20px 15px;
    text-align: left;
    color: #666;
    font-style: italic;
}

/* Error state */
.gt-error-message {
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    text-align: left;
    font-size: 13px;
}
@media screen and (max-width: 979px){
    #custom-mobile .gt-current-lang-info {
        display: none;
    }
    #custom-mobile {
        position: relative; 
        right: 0;
    }
}
/* Responsive design */
@media (max-width: 480px) {
    .gt-language-selector-v2 {
        width: auto;
        max-width: none;
        min-width: auto;
    }
    
    .gt-dropdown-panel {
        width: 235px;
        right: 0;
        left: auto;
    }
    #custom-mobile .gt-current-selection {
        padding-left: 0;
    }
    .gt-language-item {
        padding: 7px 15px;
    }
    
    .gt-search-container {
        padding: 10px;
    }
    
    .gt-current-selection {
        padding: 14px 16px;
    }
    
    .gt-globe-icon {
        width: 30px;
        height: 30px;
    }
    .gt-globe-icon {
        width: 30px;
        height: 30px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .gt-language-selector-v2 {
        border-color: #000;
    }
    
    .gt-language-item:hover {
        background: #000;
        color: #fff;
    }
    
    .gt-language-item.selected {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gt-language-selector-v2,
    .gt-language-item,
    .gt-dropdown-arrow,
    .gt-search-input {
        transition: none;
    }
}

/* Focus styles for accessibility */
.gt-language-selector-v2:focus-within {
    outline: none;
}

.gt-language-item:focus {
    outline: none;
}

/* Animation for smooth opening */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gt-language-selector-v2.gt-open .gt-dropdown-panel {
    animation: slideDown 0.2s ease-out;
}

/* Utilities */
.gt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 
.skiptranslate {
    display: none;
}

/* Prevent Google Translate from translating language list content */
.gt-language-list,
.gt-language-item,
.gt-language-names,
.gt-language-native,
.gt-language-english {
    translate: no;
}

/* Alternative method for older browsers */
.gt-language-selector-v2 .gt-language-list {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}