/* WP Safari Translate Styles */

.wst-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Embedded State (Shortcode) */
.wst-embedded.wst-switcher {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    z-index: 100; /* Lower z-index for inline */
    display: inline-block;
}

.wst-embedded .wst-options {
    bottom: auto;
    top: 100%; /* Dropdown goes down for embedded usually */
    margin-top: 10px;
    margin-bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    right: auto;
}

.wst-embedded .wst-options.wst-open {
    transform: translateX(-50%) translateY(0);
}

/* Upwards State for Embedded */
.wst-embedded .wst-options.wst-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 10px;
    transform: translateX(-50%) translateY(-10px);
}

.wst-embedded .wst-options.wst-up.wst-open {
    transform: translateX(-50%) translateY(0);
}

.wst-switcher.wst-hidden {
  transform: translateY(120%);
}

/* Main Button (Text Pill) */
.wst-current {
    background: #fff;
    color: #4D4D4D;
    padding: 0 12px;
    height: 32px;
    min-width: 173px;
    border-radius: 4px; /* Slightly squarer to match reference size feel maybe? Or keep 50px? User image shows rectangular selection box. Let's go with 5px to be safe/standard. */
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(177, 222, 221, 0.4);
    cursor: pointer;
    border: 1px solid #ccc; /* Mimic standard widget border? Or keep Teal? User image shows blue background in selection box but grey border on tooltip. Let's keep theme but thinner. */
    border: 1px solid #B1DEDD;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between; /* To put arrow on right if we had one. Center for now. */
    justify-content: center;
}

.wst-current:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(177, 222, 221, 0.6);
    background: #f9fdfd;
}

/* Speech Bubble */
.wst-bubble {
    position: absolute;
    bottom: 25px; 
    right: 15px; /* Positioned to the right of the character anchor */
    background: #fff;
    color: #4D4D4D;
    padding: 12px 24px 12px 40px; /* Extra left padding for overlap */
    border-radius: 50px;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(177, 222, 221, 0.4);
    pointer-events: none;
    border: 3px solid #B1DEDD;
    z-index: 9990; /* Behind character */
    transform: translateX(0); /* Reset logic if needed */
}

/* Remove old character/bubble styles if present to keep file clean */
.wst-character-img, .wst-character-btn {
    display: none;
}

/* Options Dropdown */
.wst-options {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    margin-bottom: 20px; /* Space between button and menu */
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-width: 200px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: none;
    padding: 10px 0;
    
    /* Scroll Support */
    max-height: 250px; /* Approx 5 items (50px each) */
    max-width: 70vw; /* Prevent full width on wide screens, responsive on mobile */
    overflow-y: auto; /* Enable scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Custom Scrollbar for Dropdown */
.wst-options::-webkit-scrollbar {
    width: 6px;
}
.wst-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.wst-options::-webkit-scrollbar-track {
    background: #f0f0f0;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .wst-current {
        padding: 8px 16px;
        font-size: 14px;
        border-width: 2px;
    }
    
    .wst-options {
        min-width: 160px;
        max-height: 50vh;
        margin-bottom: 15px;
    }
    
    .wst-lang-item {
        padding: 10px 12px;
    }
    
    .wst-lang-main {
        font-size: 14px;
    }
    
    .wst-lang-sub {
        font-size: 10px;
    }
}

.wst-options.wst-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Language Item */
.wst-lang-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
    color: #4D4D4D; /* Default text color */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.wst-lang-item:hover {
    background: #f0fbfa; /* Very light teal hover */
    color: #68B3B2;
}

.wst-lang-item.active {
    background: #EAF7F7; /* Light version of B1DEDD? Or just use B1DEDD opacity */
    /* User asked for #B1DEDD palette. Lets try to match the image style. */
    /* If image background is very light, maybe #EFFCFB? */
    /* Let's rely on #B1DEDD as a highlight color if needed, but for active background a lighter shade is better for readability unless text is white. */
    /* Image shows "China" blue text on light blue bg. */
    background: #eff6ff; /* Fallback light blue, let's try a custom mix close to teal */
    background: rgba(177, 222, 221, 0.3); /* #B1DEDD with opacity */
    color: #68B3B2; /* Active Text */
    font-weight: 700;
}

.wst-lang-main {
    font-size: 16px;
    line-height: 1.2;
}

.wst-lang-sub {
    font-size: 12px;
    opacity: 0.8;
}

/* Loading State */
body.wst-loading {
    cursor: wait;
    opacity: 0.8;
}

/* Placeholder for Ruby tags */
.wst-ph {
    display: none; 
}

/* Ruby preservation helpers */
/* ruby { } - No specific styles needed as we preserve structure */
