/**
 * Language Browser Detector - Compact Bottom Popup
 * Small, non-intrusive language notification
 * Version 3.0 - Simplified Design
 */

/* === CSS CUSTOM PROPERTIES === */
:root {
    --lbd-primary: #0073aa;
    --lbd-primary-hover: #005a87;
    --lbd-secondary: #666;
    --lbd-secondary-hover: #444;
    --lbd-text-dark: #333;
    --lbd-bg-white: #fff;
    --lbd-border: #ddd;
    --lbd-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --lbd-radius: 8px;
}

/* === BASE POPUP CONTAINER === */
#lbd-language-popup {
    position: fixed;
    z-index: 999999;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: var(--lbd-bg-white);
    border: 1px solid var(--lbd-border);
    border-radius: var(--lbd-radius);
    box-shadow: var(--lbd-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.4s ease;
}

#lbd-language-popup.lbd-show {
    transform: translateY(0);
    opacity: 1;
}

/* === POSITION VARIANTS === */

/* Top positions */
#lbd-language-popup.lbd-popup-top-left {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
    transform: translateY(-120px);
}

#lbd-language-popup.lbd-popup-top-left.lbd-show {
    transform: translateY(0);
}

#lbd-language-popup.lbd-popup-top-center {
    top: 20px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%) translateY(-120px);
}

#lbd-language-popup.lbd-popup-top-center.lbd-show {
    transform: translateX(-50%) translateY(0);
}

#lbd-language-popup.lbd-popup-top-right {
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
    transform: translateY(-120px);
}

#lbd-language-popup.lbd-popup-top-right.lbd-show {
    transform: translateY(0);
}

/* Bottom positions */
#lbd-language-popup.lbd-popup-bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
    top: auto;
    transform: translateY(120px);
}

#lbd-language-popup.lbd-popup-bottom-left.lbd-show {
    transform: translateY(0);
}

#lbd-language-popup.lbd-popup-bottom-center {
    bottom: 20px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%) translateY(120px);
}

#lbd-language-popup.lbd-popup-bottom-center.lbd-show {
    transform: translateX(-50%) translateY(0);
}

#lbd-language-popup.lbd-popup-bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    top: auto;
    transform: translateY(120px);
}

#lbd-language-popup.lbd-popup-bottom-right.lbd-show {
    transform: translateY(0);
}

/* === POPUP CONTENT === */
.lbd-popup-content {
    position: relative;
    padding: 20px;
}

/* === CLOSE BUTTON === */
.lbd-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--lbd-secondary);
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.lbd-popup-close:hover {
    background: #f5f5f5;
    color: var(--lbd-text-dark);
}

.lbd-popup-close:focus {
    outline: 2px solid var(--lbd-primary);
    outline-offset: 1px;
}

/* === POPUP BODY === */
.lbd-popup-body {
    padding-right: 24px;
}

.lbd-popup-description {
    margin: 0 0 16px;
    color: var(--lbd-text-dark);
    font-size: 15px;
    line-height: 1.5;
}

/* === POPUP ACTIONS === */
.lbd-popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

/* === BUTTONS === */
.lbd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 38px;
    box-sizing: border-box;
    flex: 1;
}

.lbd-btn-primary {
    background: var(--lbd-primary);
    color: white;
    border-color: var(--lbd-primary);
}

.lbd-btn-primary:hover {
    background: var(--lbd-primary-hover);
    border-color: var(--lbd-primary-hover);
    color: white;
}

.lbd-btn-secondary {
    background: white;
    color: var(--lbd-secondary);
    border-color: var(--lbd-border);
}

.lbd-btn-secondary:hover {
    background: #f5f5f5;
    color: var(--lbd-secondary-hover);
    border-color: var(--lbd-secondary);
}

.lbd-btn:focus {
    outline: 2px solid var(--lbd-primary);
    outline-offset: 1px;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    #lbd-language-popup {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    #lbd-language-popup.lbd-popup-top-left,
    #lbd-language-popup.lbd-popup-top-center,
    #lbd-language-popup.lbd-popup-top-right {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: auto;
        transform: translateY(-120px);
    }

    #lbd-language-popup.lbd-popup-top-left.lbd-show,
    #lbd-language-popup.lbd-popup-top-center.lbd-show,
    #lbd-language-popup.lbd-popup-top-right.lbd-show {
        transform: translateY(0);
    }

    #lbd-language-popup.lbd-popup-bottom-left,
    #lbd-language-popup.lbd-popup-bottom-center,
    #lbd-language-popup.lbd-popup-bottom-right {
        bottom: 10px;
        left: 10px;
        right: 10px;
        top: auto;
        transform: translateY(120px);
    }

    #lbd-language-popup.lbd-popup-bottom-left.lbd-show,
    #lbd-language-popup.lbd-popup-bottom-center.lbd-show,
    #lbd-language-popup.lbd-popup-bottom-right.lbd-show {
        transform: translateY(0);
    }

    .lbd-popup-actions {
        flex-direction: column;
    }

    .lbd-btn {
        width: 100%;
        justify-content: center;
        flex: none;
    }
}

/* === THEME VARIATIONS === */

/* Light Theme (Default) */
#lbd-language-popup.lbd-theme-light {
    --lbd-primary: #0073aa;
    --lbd-primary-hover: #005a87;
    --lbd-secondary: #666;
    --lbd-secondary-hover: #444;
    --lbd-text-dark: #333;
    --lbd-bg-white: #fff;
    --lbd-border: #ddd;
    --lbd-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Dark Theme */
#lbd-language-popup.lbd-theme-dark {
    --lbd-primary: #4f9eff;
    --lbd-primary-hover: #357abd;
    --lbd-secondary: #aaa;
    --lbd-secondary-hover: #ccc;
    --lbd-text-dark: #e0e0e0;
    --lbd-bg-white: #2a2a2a;
    --lbd-border: #444;
    --lbd-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Blue Theme */
#lbd-language-popup.lbd-theme-blue {
    --lbd-primary: #1e90ff;
    --lbd-primary-hover: #1c7ed6;
    --lbd-secondary: #4a5568;
    --lbd-secondary-hover: #2d3748;
    --lbd-text-dark: #1a202c;
    --lbd-bg-white: #f7faff;
    --lbd-border: #bee3f8;
    --lbd-shadow: 0 4px 20px rgba(30, 144, 255, 0.25);
}

/* Green Theme */
#lbd-language-popup.lbd-theme-green {
    --lbd-primary: #38a169;
    --lbd-primary-hover: #2f855a;
    --lbd-secondary: #4a5568;
    --lbd-secondary-hover: #2d3748;
    --lbd-text-dark: #1a202c;
    --lbd-bg-white: #f0fff4;
    --lbd-border: #9ae6b4;
    --lbd-shadow: 0 4px 20px rgba(56, 161, 105, 0.25);
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    #lbd-language-popup,
    .lbd-btn,
    .lbd-popup-close {
        transition: none;
    }
}

/* Disable body scroll when popup is visible */
body.lbd-no-scroll {
    /* Remove this - we want the page to remain scrollable */
}