/**
 * MLAF Translation Simple - Frontend Styles V2
 * iOS 26 Liquid Glass Effect
 */

/* Language Switcher Container - Liquid Glass */
#mlaf-language-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Language Button - Liquid Glass Effect */
.mlaf-lang-btn {
    position: relative;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    border: none;
    outline: none;

    /* Liquid Glass Base */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.05)
    );

    /* Frosted Glass Blur */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Subtle Border & Shadow */
    border: 1px solid #bdc9c9;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlay for liquid effect */
.mlaf-lang-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.06)
    );
    mix-blend-mode: overlay;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Hover Effect */
.mlaf-lang-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.1)
    );
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.02);
}

.mlaf-lang-btn:hover::before {
    opacity: 0.8;
}

/* Active/Click Effect */
.mlaf-lang-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Language Menu - Liquid Glass */
.mlaf-lang-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    list-style: none;
    padding: 8px;
    margin: 0;
    border-radius: 20px;

    /* Liquid Glass Effect */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1)
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border: 1px solid #bdc9c9;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    /* Animation */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Overlay for menu */
.mlaf-lang-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.06)
    );
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Show menu */
.mlaf-lang-menu[style*="display: block"],
.mlaf-lang-menu:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Menu Items */
.mlaf-lang-menu li {
    margin: 0;
    padding: 0;
}

.mlaf-lang-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Link hover effect */
.mlaf-lang-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1)
    );
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mlaf-lang-link:hover::before {
    opacity: 1;
}

.mlaf-lang-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.mlaf-lang-link:active {
    transform: translateX(0) scale(0.98);
    background: rgba(255, 255, 255, 0.25);
}

/* Checkmark */
.mlaf-checkmark {
    color: #000;
    font-weight: bold;
    margin-left: 8px;
    opacity: 0.8;
}

/* Loading Overlay - CENTERED */
#mlaf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex; /* Changed from none to flex */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Show overlay */
#mlaf-loading-overlay.mlaf-show {
    opacity: 1;
    pointer-events: all;
}

/* Spinner - Liquid Glass */
.mlaf-spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;

    /* Glass ring */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.05)
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* Spinning gradient */
.mlaf-spinner::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.8);
    border-right-color: rgba(255, 255, 255, 0.4);
    animation: mlaf-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* Progress Text */
.mlaf-progress {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Custom Scrollbar for Menu */
.mlaf-lang-menu::-webkit-scrollbar {
    width: 6px;
}

.mlaf-lang-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mlaf-lang-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    backdrop-filter: blur(10px);
}

.mlaf-lang-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #mlaf-language-switcher {
        bottom: 15px;
        right: 15px;
    }

    .mlaf-lang-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .mlaf-lang-menu {
        min-width: 180px;
    }

    .mlaf-lang-link {
        padding: 9px 12px;
        font-size: 13px;
    }
}

/* Dark backgrounds - increase contrast */
@media (prefers-color-scheme: dark) {
    .mlaf-lang-btn,
    .mlaf-lang-menu {
        border-color: rgba(255, 255, 255, 0.25);
    }

    .mlaf-lang-btn {
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.2),
            rgba(255, 255, 255, 0.08)
        );
    }

    .mlaf-lang-menu {
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.25),
            rgba(255, 255, 255, 0.12)
        );
    }
}

/* Accessibility */
.mlaf-lang-btn:focus,
.mlaf-lang-link:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

/* Smooth transitions for all */
* {
    box-sizing: border-box;
}
