/**
 * HUSHIKO Language Preference Modal
 * Elegant dialog for language mismatch detection
 */

/* Backdrop with blur */
.lang-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(155, 135, 217, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lang-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.lang-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(145deg, #FFFFFF 0%, #FFF8F0 100%);
    border-radius: 24px;
    box-shadow:
        0 25px 80px rgba(155, 135, 217, 0.25),
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    z-index: 10001;
    max-width: 420px;
    width: calc(100% - 40px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.lang-modal-backdrop.active .lang-modal {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Decorative top accent */
.lang-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #9B87D9 0%, #FF9F66 50%, #9B87D9 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Modal content */
.lang-modal__content {
    padding: 32px 28px 28px;
    text-align: center;
}

/* Globe icon */
.lang-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #9B87D9 0%, #B4A5E5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(155, 135, 217, 0.3);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.lang-modal__icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* Title */
.lang-modal__title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #2D2A3E;
    margin: 0 0 12px;
    line-height: 1.3;
}

/* Description */
.lang-modal__desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #6B6880;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* Language highlight */
.lang-modal__lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(155, 135, 217, 0.12) 0%, rgba(255, 159, 102, 0.08) 100%);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #9B87D9;
}

.lang-modal__lang--current {
    color: #FF9F66;
}

/* Buttons container */
.lang-modal__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Primary button */
.lang-modal__btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lang-modal__btn--primary {
    background: linear-gradient(135deg, #9B87D9 0%, #8A76C8 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(155, 135, 217, 0.35);
}

.lang-modal__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(155, 135, 217, 0.45);
}

.lang-modal__btn--primary:active {
    transform: translateY(0);
}

/* Secondary button */
.lang-modal__btn--secondary {
    background: transparent;
    color: #6B6880;
    border: 2px solid rgba(155, 135, 217, 0.2);
}

.lang-modal__btn--secondary:hover {
    background: rgba(155, 135, 217, 0.08);
    border-color: rgba(155, 135, 217, 0.3);
    color: #9B87D9;
}

/* Flag emoji styling */
.lang-modal__flag {
    font-size: 1.2em;
    line-height: 1;
}

/* Close button (X) */
.lang-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(155, 135, 217, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #9B87D9;
}

.lang-modal__close:hover {
    background: rgba(155, 135, 217, 0.2);
    transform: rotate(90deg);
}

.lang-modal__close svg {
    width: 16px;
    height: 16px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .lang-modal {
        max-width: calc(100% - 32px);
        border-radius: 20px;
    }

    .lang-modal__content {
        padding: 28px 20px 24px;
    }

    .lang-modal__title {
        font-size: 1.2rem;
    }

    .lang-modal__desc {
        font-size: 0.9rem;
    }

    .lang-modal__btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lang-modal,
    .lang-modal-backdrop,
    .lang-modal__icon,
    .lang-modal::before {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .lang-modal-backdrop.active .lang-modal {
        transform: translate(-50%, -50%);
    }
}
