/**
 * Mumble WPML Utilities - Styles
 * Elegant language switcher with flags
 *
 * @package Mumble_WPML_Utils
 * @version 2.0.0
 */

/* Language Switcher Container */
.mumble-wpml-switcher {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Horizontal Layout (default) */
.mumble-wpml-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

/* Vertical Layout */
.mumble-wpml-vertical {
    flex-direction: column;
}

/* Language Item Link */
.mumble-wpml-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    border: 2px solid transparent;
}

.mumble-wpml-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mumble-wpml-item:active {
    transform: translateY(0);
}

/* Current Language */
.mumble-wpml-item.mumble-wpml-current {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    cursor: default;
}

.mumble-wpml-item.mumble-wpml-current:hover {
    transform: none;
}

/* Flag Image */
.mumble-wpml-flag {
    display: block;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.mumble-wpml-item:hover .mumble-wpml-flag {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Language Name */
.mumble-wpml-lang-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: color 0.3s ease;
}

.mumble-wpml-item:hover .mumble-wpml-lang-name {
    color: #000;
}

.mumble-wpml-item.mumble-wpml-current .mumble-wpml-lang-name {
    font-weight: 600;
    color: #000;
}

/* Size Variants */

/* Small Size */
.mumble-wpml-size-small .mumble-wpml-flag {
    width: 20px;
}

.mumble-wpml-size-small .mumble-wpml-item {
    padding: 4px 8px;
    gap: 6px;
}

.mumble-wpml-size-small .mumble-wpml-lang-name {
    font-size: 12px;
}

/* Medium Size (default) */
.mumble-wpml-size-medium .mumble-wpml-flag {
    width: 28px;
}

/* Large Size */
.mumble-wpml-size-large .mumble-wpml-flag {
    width: 36px;
}

.mumble-wpml-size-large .mumble-wpml-item {
    padding: 8px 12px;
    gap: 10px;
}

.mumble-wpml-size-large .mumble-wpml-lang-name {
    font-size: 16px;
}

/* Extra Large Size */
.mumble-wpml-size-xlarge .mumble-wpml-flag {
    width: 48px;
}

.mumble-wpml-size-xlarge .mumble-wpml-item {
    padding: 10px 14px;
    gap: 12px;
}

.mumble-wpml-size-xlarge .mumble-wpml-lang-name {
    font-size: 18px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mumble-wpml-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .mumble-wpml-item.mumble-wpml-current {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.25);
    }

    .mumble-wpml-lang-name {
        color: #e0e0e0;
    }

    .mumble-wpml-item:hover .mumble-wpml-lang-name {
        color: #fff;
    }

    .mumble-wpml-item.mumble-wpml-current .mumble-wpml-lang-name {
        color: #fff;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mumble-wpml-switcher {
        gap: 8px;
    }

    .mumble-wpml-item {
        padding: 4px 8px;
    }

    /* Auto-adjust to smaller flags on mobile if not explicitly sized */
    .mumble-wpml-size-medium .mumble-wpml-flag {
        width: 24px;
    }

    .mumble-wpml-size-large .mumble-wpml-flag {
        width: 30px;
    }

    .mumble-wpml-size-xlarge .mumble-wpml-flag {
        width: 40px;
    }
}

/* Accessibility */
.mumble-wpml-item:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.mumble-wpml-item:focus:not(:focus-visible) {
    outline: none;
}

/* Print Styles */
@media print {
    .mumble-wpml-switcher {
        display: none;
    }
}
