/**
 * COMPONENTES GLOBAIS - KyraChat
 * Estilos para drawer, modais de auth, etc.
 */

/* ============================================
   MOBILE DRAWER GLOBAL
   ============================================ */

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.mobile-drawer-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-drawer-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Seletor de Idioma Mobile */
.mobile-drawer-language {
    padding: 16px 20px;
    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 {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

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

.mobile-lang-dropdown {
    margin-top: 10px;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 8px;
}

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

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

.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-lang-item i {
    margin-left: auto;
    color: #8b5cf6;
}

/* Navegação Mobile */
.mobile-drawer-nav {
    padding: 12px;
    flex: 1;
}

.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.mobile-drawer-item:hover,
.mobile-drawer-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

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

.mobile-drawer-item.premium {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.mobile-drawer-item.premium i {
    color: #ffd700;
    opacity: 1;
}

.mobile-drawer-item .badge-off {
    margin-left: auto;
    background: linear-gradient(135deg, #ff006e, #8338ec);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* Divisor */
.mobile-drawer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 20px;
}

/* Auth Buttons */
.mobile-drawer-auth {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-join-drawer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-join-drawer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-login-drawer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-login-drawer:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

/* User Menu */
.mobile-drawer-user {
    padding: 12px 20px;
}

.drawer-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.drawer-user-profile:hover {
    background: rgba(255, 255, 255, 0.08);
}

.drawer-user-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #8b5cf6;
}

.drawer-user-profile span {
    font-weight: 600;
    font-size: 15px;
}

.drawer-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    transition: all 0.2s ease;
}

.drawer-user-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.drawer-user-link i {
    width: 20px;
    text-align: center;
}

.drawer-user-link.logout {
    color: #ef4444;
}

.drawer-user-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.drawer-token-count {
    margin-left: auto;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Suporte */
.mobile-drawer-support {
    padding: 12px 20px;
}

.mobile-support-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    transition: all 0.2s ease;
}

.mobile-support-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.mobile-support-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

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

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

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

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

/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MODAL DE AUTH GLOBAL
   ============================================ */

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

.auth-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

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

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

/* Botão Fechar - Posicionado no container */
.auth-modal-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;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Header do Modal */
.auth-modal-header {
    padding: 32px 32px 20px;
    text-align: center;
}

.auth-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 16px 0 8px;
    text-align: center;
}

.auth-modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin: 0;
}

/* Conteúdo do Modal */
.auth-modal-content {
    padding: 20px 32px 28px;
}

/* Google Button */
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: #fff;
    border: none;
    border-radius: 12px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.auth-google-btn:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.auth-google-btn img {
    width: 20px;
    height: 20px;
}

/* Divisor */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    text-transform: lowercase;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-input-group {
    position: relative;
    width: 100%;
}

.auth-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-input-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
    text-align: center;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Links */
.auth-forgot-link {
    display: block;
    text-align: right;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-top: -8px;
}

.auth-forgot-link:hover {
    color: #8b5cf6;
}

/* Footer do Modal */
.auth-modal-footer {
    padding: 20px 32px 28px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-terms {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    margin-bottom: 16px;
}

.auth-terms a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
}

.auth-switch {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.auth-switch button {
    background: none;
    border: none;
    color: #8b5cf6;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.auth-switch button:hover {
    color: #a78bfa;
}

/* ============================================
   LANGUAGE SELECTOR (DESKTOP)
   ============================================ */

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

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

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

@media (max-width: 480px) {
    .mobile-drawer {
        width: 90%;
    }
    
    .auth-modal-container {
        max-width: 100%;
        border-radius: 20px;
    }
    
    .auth-modal-header {
        padding: 24px 20px 0;
    }
    
    .auth-modal-content {
        padding: 20px;
    }
    
    .auth-modal-footer {
        padding: 16px 20px 24px;
    }
}
