/* ============================================
   ZykoAuth PWA - Styles
   ============================================ */

:root {
    /* Cores padrao - podem ser sobrescritas por branding */
    --primary-color: #2d3a8c;
    --primary-hover: #3651d4;
    --secondary-color: #1e293b;

    /* Aliases para compatibilidade */
    --primary: var(--primary-color);
    --primary-dark: var(--primary-hover);

    /* Cores fixas */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    height: 58px;
    width: auto;
    margin-right: 12px;
    vertical-align: middle;
}

.header-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header-subtitle {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
}

.header .status {
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Connection Status Indicator */
.connection-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 8px;
    flex-shrink: 0;
    transition: background 0.3s;
}
.connection-status.offline {
    background: var(--danger);
    animation: pulse-offline 1.5s infinite;
}
@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Offline Screen */
.offline-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 60vh;
}
.offline-icon {
    color: var(--text-muted);
    margin-bottom: 24px;
}
.offline-icon svg {
    stroke: var(--danger);
}
.offline-container h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text);
}
.offline-message {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
    max-width: 280px;
}
.offline-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.offline-auto-retry {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Scanner */
.scanner-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#qr-reader {
    width: 100%;
    max-width: 350px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#qr-reader video {
    border-radius: 16px;
}

.hint {
    margin-top: 20px;
    color: var(--text-muted);
    text-align: center;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Elimina delay de 300ms em touch devices (iOS) */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
    margin-top: 20px;
}

.btn-link {
    background: transparent;
    color: var(--primary);
    text-decoration: underline;
    padding: 10px;
    margin-top: 10px;
}

.btn-link:hover {
    background: transparent;
    color: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
    flex: 1;
}

.btn-danger {
    background: var(--danger);
    color: white;
    flex: 1;
}

/* Confirm Screen */
.confirm-card {
    background: var(--card);
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.confirm-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.confirm-card h2 {
    margin-bottom: 20px;
    color: var(--text);
}

.device-info {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.device-info p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.device-info strong {
    color: var(--text);
}

.warning {
    color: var(--warning);
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

/* Result Screen */
.result-card {
    background: var(--card);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-card.success .result-icon {
    color: var(--success);
}

.result-card.error .result-icon {
    color: var(--danger);
}

.result-icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.result-card h2 {
    margin-bottom: 12px;
}

.result-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Login Screen */
.login-card {
    background: var(--card);
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card h2 {
    margin-bottom: 12px;
}

.login-card > p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Site Info Header (Registration) */
.site-info-header {
    text-align: center;
    padding: 16px;
    margin: -30px -20px 20px -20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px 20px 0 0;
    color: white;
}

.site-info-header .site-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.site-info-header .site-detail {
    font-size: 13px;
    opacity: 0.85;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-form input {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 12px;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: white;
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 380px) {
    .confirm-buttons {
        flex-direction: column;
    }
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--card);
    padding: 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-prompt.hidden {
    display: none;
}

/* ============================================
   Accounts Management
   ============================================ */

/* Botao de contas no header */
.btn-icon {
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

/* Lista de contas */
.accounts-card,
.select-account-card {
    background: var(--card);
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: var(--shadow);
}

.accounts-card h2,
.select-account-card h2 {
    text-align: center;
    margin-bottom: 8px;
}

/* Botao de refresh */
.btn-refresh {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 50%;
    transition: transform 0.3s, background 0.2s;
    vertical-align: middle;
}

.btn-refresh:hover {
    background: rgba(79, 70, 229, 0.1);
}

.btn-refresh:active,
.btn-refresh.spinning {
    animation: spin 0.5s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.select-account-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: 12px;
    transition: all 0.2s;
}

.account-item.selectable {
    cursor: pointer;
}

.account-item.selectable:hover {
    background: var(--border);
    transform: translateX(4px);
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-label {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.account-url {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.no-accounts {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* Conta selecionada na tela de confirmacao */
.selected-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(67, 97, 238, 0.1);
    border: 2px solid var(--primary);
    border-radius: 12px;
    margin: 16px 0;
}

.selected-account .account-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.selected-account .account-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.selected-account .account-name {
    font-size: 14px;
}

.selected-account .account-label {
    font-size: 12px;
}

/* Form de adicionar conta */
#add-account-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    font-size: 12px;
    color: var(--text-muted);
}

#btn-cancel-add {
    margin-top: 12px;
}

/* ============================================
   Restricao de Rede
   ============================================ */

.form-section {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg);
    border-radius: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.form-section small {
    display: block;
    margin-top: 6px;
    margin-left: 30px;
    color: var(--text-muted);
    font-size: 12px;
}

.network-config {
    margin-top: 12px;
    padding: 16px;
    background: rgba(67, 97, 238, 0.05);
    border: 1px solid var(--primary);
    border-radius: 10px;
}

.network-config.hidden {
    display: none;
}

.btn-small {
    padding: 10px 16px;
    font-size: 13px;
    background: var(--border);
    color: var(--text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}

.btn-small:hover {
    background: #d1d5db;
}

/* Badge de restricao de rede */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-network {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.account-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tela de selecao com indicador de rede */
.account-item.selectable .badge-network {
    background: rgba(16, 185, 129, 0.2);
}

/* Secao do Beacon */
.beacon-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.beacon-section h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.beacon-section > small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 16px;
}

.beacon-section .form-group {
    margin-bottom: 12px;
}

.badge-beacon {
    background: rgba(67, 97, 238, 0.15);
    color: var(--primary);
}

/* ============================================
   Login Screen
   ============================================ */

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-help {
    margin-top: 24px;
    color: var(--text-muted);
}

#login-form {
    text-align: left;
}

#login-form .form-group {
    margin-bottom: 16px;
}

/* ============================================
   Utility Classes
   ============================================ */

.btn-block {
    width: 100%;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.hidden {
    display: none !important;
}

/* ============================================
   Selecao de Perfil
   ============================================ */

.select-profile-card {
    background: var(--card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 0 auto;
}

.site-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.site-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.site-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px 0;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-item:hover {
    background: var(--border);
    transform: translateX(4px);
}

.profile-item:active {
    transform: scale(0.98);
}

.profile-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-area {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-item.selected {
    background: rgba(67, 97, 238, 0.15);
    border: 2px solid var(--primary);
}

/* ============================================
   Login - Criar Conta
   ============================================ */

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    padding: 0 12px;
}

/* Botao biometrico */
.btn-biometric {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-biometric svg {
    flex-shrink: 0;
}

/* Info de biometria */
.biometric-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #0369a1;
    margin: 16px 0;
    text-align: left;
}

/* Botao danger outline */
.btn-danger-outline {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    margin-top: 16px;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Botao de Panico - Discreto no canto */
.btn-panic {
    background: transparent;
    color: #991b1b;
    font-weight: 500;
    font-size: 12px;
    padding: 8px 12px;
    border: 1px solid #dc2626;
    border-radius: 6px;
    margin-top: 30px;
    width: auto;
    display: inline-block;
}

.btn-panic:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
    transform: scale(1.02);
}

.btn-panic:active {
    transform: scale(0.98);
}

@keyframes pulse-panic {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(220, 38, 38, 0.6);
    }
}

.panic-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Tela de Bloqueio */
.blocked-screen {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.blocked-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.blocked-title {
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 16px;
}

.blocked-message {
    color: #9ca3af;
    margin-bottom: 24px;
    line-height: 1.6;
}

.unblock-form {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.unblock-form input {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    text-align: center;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.unblock-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

/* ============================================
   Tela de Vinculacao
   ============================================ */

.link-options {
    margin: 20px 0;
}

.link-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.link-divider::before,
.link-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.link-divider span {
    padding: 0 12px;
}

#link-code {
    text-transform: uppercase;
}

/* ============================================
   Codigo de Verificacao
   ============================================ */

#verify-code {
    font-family: monospace;
    font-size: 28px !important;
    letter-spacing: 8px;
    text-align: center;
    padding: 16px;
}

/* ============================================
   Toast de Atualizacao
   ============================================ */

.update-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    transition: bottom 0.3s ease-out;
    max-width: 95%;
    width: 400px;
}

.update-toast.show {
    bottom: 20px;
}

.update-toast-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.update-toast-icon {
    font-size: 24px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-toast-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.update-toast-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.update-toast-btn:hover {
    background: var(--primary-dark);
}

.update-toast-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.update-toast-dismiss:hover {
    color: white;
}

/* ============================================
   RTL Support (Hebrew, Arabic)
   ============================================ */

/* Global RTL adjustments */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Header RTL */
body.rtl .header {
    flex-direction: row-reverse;
}

body.rtl .header-logo {
    margin-right: 0;
    margin-left: 12px;
}

body.rtl .connection-status {
    margin-right: 0;
    margin-left: 8px;
}

/* Account items RTL */
body.rtl .account-item.selectable:hover {
    transform: translateX(-4px);
}

body.rtl .profile-item:hover {
    transform: translateX(-4px);
}

body.rtl .profile-icon {
    margin-right: 0;
    margin-left: 12px;
}

/* Device info RTL */
body.rtl .device-info {
    text-align: right;
}

/* Selected account RTL */
body.rtl .selected-account .account-details {
    text-align: right;
}

/* Form RTL */
body.rtl .form-group {
    text-align: right;
}

body.rtl #add-account-form {
    text-align: right;
}

body.rtl #login-form {
    text-align: right;
}

/* Buttons with icons RTL */
body.rtl .btn svg {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl .btn-biometric svg {
    margin-right: 0;
    margin-left: 8px;
}

/* Spinner RTL */
body.rtl .btn-spinner {
    margin-left: 0;
    margin-right: 8px;
}

/* Network badge RTL */
body.rtl .account-name-row {
    flex-direction: row-reverse;
}

/* Checkbox RTL */
body.rtl .checkbox-label {
    flex-direction: row-reverse;
}

body.rtl .form-section small {
    margin-left: 0;
    margin-right: 30px;
}

/* Biometric info icon RTL */
body.rtl .biometric-info svg {
    margin-right: 0;
    margin-left: 4px;
}

/* Profile arrow RTL */
body.rtl .profile-arrow {
    transform: scaleX(-1);
}

/* ============================================
   Language Selector
   ============================================ */

.lang-selector {
    position: relative;
    display: inline-block;
}

.btn-lang {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 120px;
    z-index: 1000;
    overflow: hidden;
    display: none;
}

/* RTL: dropdown continua alinhado a direita pois o botao ainda esta no canto direito */
body.rtl .lang-dropdown {
    right: 0;
    left: auto;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
}

body.rtl .lang-option {
    text-align: right;
}

.lang-option:hover {
    background: var(--bg);
}

.lang-option.active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Version Info */
.version-info {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}
