/**
 * CSS do Sistema de Idiomas - KyraChat
 */

/* ============================================
   POPUP DE SELEÇÃO DE IDIOMA
   ============================================ */

.language-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.language-popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.language-popup-container {
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.language-popup-overlay.visible .language-popup-container {
    transform: scale(1) translateY(0);
}

/* Botão de fechar */
.language-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.language-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* Título */
.language-popup-title {
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 32px 0;
    text-align: left;
    letter-spacing: -0.5px;
}

/* Seção de idiomas */
.language-section {
    margin-bottom: 32px;
}

.language-section:last-child {
    margin-bottom: 0;
}

.language-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px 0;
    letter-spacing: 0.3px;
}

.language-section-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 16px 0;
}

/* Grid de opções */
.language-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Opção de idioma */
.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.language-option.selected {
    background: rgba(255, 82, 109, 0.1);
    border-color: #ff526d;
    box-shadow: 0 0 20px rgba(255, 82, 109, 0.15);
}

/* Flag */
.lang-flag {
    font-size: 24px;
    line-height: 1;
}

/* Nome do idioma */
.lang-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    flex: 1;
}

/* Código do idioma */
.lang-code {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: uppercase;
}

/* Check mark */
.lang-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.language-option.selected .lang-check {
    opacity: 1;
    background: #ff526d;
    color: #fff;
}

.lang-check i {
    font-size: 12px;
}

/* ============================================
   SELETOR DE IDIOMA NO HEADER/SETTINGS
   ============================================ */

.language-selector {
    position: relative;
}

.language-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 14px;
}

.language-selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.language-selector-btn .flag {
    font-size: 18px;
}

.language-selector-btn .code {
    font-weight: 500;
    text-transform: uppercase;
}

.language-selector-btn .arrow {
    margin-left: 4px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.language-selector.open .language-selector-btn .arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #fff;
    font-size: 14px;
}

.language-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.language-dropdown-item.active {
    background: rgba(255, 82, 109, 0.15);
}

.language-dropdown-item .flag {
    font-size: 18px;
}

.language-dropdown-item .name {
    flex: 1;
}

.language-dropdown-item .check {
    opacity: 0;
    color: #ff526d;
}

.language-dropdown-item.active .check {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .language-popup-container {
        padding: 28px 20px;
        margin: 0 16px;
        border-radius: 20px;
    }
    
    .language-popup-title {
        font-size: 22px;
        margin-bottom: 24px;
    }
    
    .language-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .language-option {
        padding: 14px 16px;
    }
    
    .lang-flag {
        font-size: 22px;
    }
    
    .lang-name {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .language-popup-container {
        padding: 24px 16px;
    }
    
    .language-popup-title {
        font-size: 20px;
    }
}

/* ============================================
   SIDEBAR EXTERNAL LINKS - DESKTOP
   ============================================ */

.sidebar-external-links {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.sidebar-external-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.sidebar-external-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-external-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Sidebar Language Selector */
.sidebar-language-selector {
    position: relative;
    margin-top: 8px;
}

.sidebar-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-lang-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-lang-btn .lang-flag-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-lang-btn .lang-code {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.sidebar-lang-btn i {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.sidebar-language-selector.open .sidebar-lang-btn i {
    transform: rotate(180deg);
}

.sidebar-lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 8px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
}

.sidebar-language-selector.open .sidebar-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sidebar-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.sidebar-lang-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-lang-item.active {
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
}

.sidebar-lang-item .lang-flag-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

/* Sidebar Footer with multiple links */
.sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    font-size: 12px;
}

.sidebar-footer-dot {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MOBILE DRAWER LANGUAGE & EXTERNAL LINKS
   ============================================ */

.mobile-drawer-language {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-lang-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-lang-btn .lang-flag-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-lang-btn .lang-name {
    font-weight: 500;
}

.mobile-lang-dropdown {
    margin-top: 10px;
    display: none;
}

.mobile-lang-dropdown.open {
    display: block;
}

.mobile-lang-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 4px;
}

.mobile-lang-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-lang-item.active {
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
}

.mobile-lang-item .lang-flag-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

/* Mobile External Links */
.mobile-drawer-external {
    padding: 8px 16px;
}

.mobile-external-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.mobile-external-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.mobile-external-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.7;
}

/* Mobile Drawer Divider */
.mobile-drawer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 16px;
}

/* Mobile Drawer Footer */
.mobile-drawer-footer {
    margin-top: auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-drawer-footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.mobile-drawer-footer span {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.language-option {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.language-option:nth-child(1) { animation-delay: 0.05s; }
.language-option:nth-child(2) { animation-delay: 0.1s; }
.language-option:nth-child(3) { animation-delay: 0.15s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
