/**
 * Public Styles for Language Translator Plugin
 */

/* Language Selector Container - Floating Version */
.ltp-language-selector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Selector Button */
.ltp-selector-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    transition: all 0.3s ease;
}

.ltp-selector-button:hover {
    background: #005a87;
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
    transform: translateY(-2px);
}

.ltp-selector-button:active {
    transform: translateY(0);
}

.ltp-selector-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.ltp-current-lang {
    font-size: 14px;
    font-weight: 500;
}

/* Dropdown Container */
.ltp-language-selector .ltp-dropdown {
    position: absolute;
    bottom: 60px;
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
}

.ltp-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Scrollbar Styling */
.ltp-dropdown::-webkit-scrollbar {
    width: 8px;
}

.ltp-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.ltp-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ltp-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Language Option */
.ltp-lang-option {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.ltp-lang-option:last-child {
    border-bottom: none;
}

.ltp-lang-option:hover {
    background: #f5f5f5;
    color: #0073aa;
    padding-left: 20px;
}

.ltp-lang-option.active {
    background: #e3f2fd;
    color: #0073aa;
    font-weight: 600;
    border-left: 3px solid #0073aa;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ltp-language-selector {
        bottom: 15px;
        right: 15px;
    }

    .ltp-selector-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .ltp-dropdown {
        min-width: 180px;
        bottom: 55px;
    }

    .ltp-lang-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ltp-language-selector {
        bottom: 10px;
        right: 10px;
    }

    .ltp-selector-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ltp-selector-button svg {
        width: 16px;
        height: 16px;
    }

    .ltp-dropdown {
        min-width: 160px;
        bottom: 50px;
        max-height: 300px;
    }

    .ltp-lang-option {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Animation for dropdown arrow */
.ltp-selector-button::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid white;
    transition: transform 0.3s ease;
}

.ltp-selector-button.active::after {
    transform: rotate(180deg);
}

/* Loading State */
.ltp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ltp-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ltp-spin 0.6s linear infinite;
}

@keyframes ltp-spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.ltp-selector-button:focus,
.ltp-lang-option:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .ltp-selector-button {
        border: 2px solid white;
    }

    .ltp-dropdown {
        border: 2px solid #333;
    }

    .ltp-lang-option {
        border-bottom: 2px solid #333;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ltp-selector-button,
    .ltp-dropdown,
    .ltp-lang-option,
    .ltp-selector-button::after {
        transition: none;
    }

    .ltp-loading::before {
        animation: none;
    }
}
