/* Global Styles and Variables */
:root {
    /* Cores Preto e Branco */
    --color-dark-blue: #000000;           /* Fundo principal - Preto */
    --color-medium-blue: #0a0a0a;         /* Fundo secundário - Preto mais claro */
    --color-card-bg: #1a1a1a;             /* Fundo de cards - Cinza escuro */
    --color-primary: #ffffff;             /* Branco - Destaque/Selecionado */
    --color-primary-dark: #e0e0e0;        /* Branco acinzentado - Hover */
    --color-secondary: #ffffff;           /* Branco - Acentos */
    --color-text-light: #ffffff;          /* Texto principal - Branco */
    --color-text-secondary: #cccccc;      /* Texto secundário - Cinza claro */
    --color-text-muted: #888888;          /* Texto terciário - Cinza */
    --color-success: #ffffff;             /* Branco - Sucesso */
    --color-danger: #ffffff;              /* Branco - Erro */
    --color-border: #ffffff;              /* Bordas - Branco */
}

html {
    margin: 0;
    padding: 0;
    line-height: 1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--color-dark-blue);
    color: var(--color-text-light);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.5;
}

/* App Container - Responsive */
.app-container {
    width: 100%;
    max-width: 400px;
    min-height: 100vh;
    background-color: var(--color-medium-blue);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header */
.app-header {
    height: 70px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

/* Header Logo */
.header-left {
    display: flex;
    align-items: center;
    padding-left: 16px;
}

.header-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Info Badge */
.user-info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-info-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-info-badge i {
    font-size: 16px;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* Header Info */
.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Left */
.header-left {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.3px;
}

.connection-dot {
    font-size: 6px;
    color: var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* User Balance */
.user-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    padding: 4px 10px;
    border-radius: 0;
    border: 1px solid #ffffff;
    transition: all 0.3s ease;
}

.user-balance:hover {
    background: #ffffff;
    color: #000000;
}

.user-balance:hover .balance-amount,
.user-balance:hover .balance-toggle {
    color: #000000;
}

.user-balance i {
    font-size: 12px;
    color: var(--color-primary);
}

.user-balance .balance-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.user-balance .balance-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.balance-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.3px;
}

/* Main Content */
.app-main {
    flex-grow: 1;
    padding: 20px;
    padding-bottom: 95px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    overflow-y: auto;
}

/* Background pattern */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    z-index: -1;
}

/* Responsive Design */
@media screen and (min-width: 600px) {
    .app-container {
        max-width: 600px;
    }
}

@media screen and (min-width: 1024px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .app-container {
        max-width: none;
        min-height: 100vh;
        border-radius: 0;
        margin-left: 250px; /* Width of sidebar */
    }

    .app-header {
        height: 80px;
        padding: 0 40px;
        border-radius: 0;
    }

    .logo {
        font-size: 1.4rem;
    }

    .logo i {
        font-size: 2rem;
    }

    .app-main {
        padding: 40px;
        padding-bottom: 40px; /* No bottom nav on desktop */
        gap: 30px;
    }
}

@media screen and (min-width: 1440px) {
    .app-container {
        /* No max-width needed - sidebar handles layout */
    }
}

/* Botão de Download de Logs */
.download-logs-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-logs-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.6);
}

.download-logs-btn:active {
    transform: scale(0.95);
}

.download-logs-btn i {
    font-size: 20px;
}

.logs-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Bloqueio de Saldo - Balance Lock Overlay */
.balance-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.balance-lock-overlay.active {
    display: flex;
}

.balance-lock-content {
    background: #131722;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInUp 0.3s ease;
}

.lock-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.lock-icon i {
    font-size: 36px;
    color: #ef4444;
}

.lock-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.lock-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 24px;
}

.lock-balance-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.lock-balance-info i {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
}

.lock-balance-info span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.lock-balance-info strong {
    color: #ef4444;
    font-size: 16px;
    margin-left: 4px;
    font-weight: 600;
}

.lock-minimum-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(251, 191, 36, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    margin-bottom: 24px;
}

.lock-minimum-info i {
    font-size: 16px;
    color: #fbbf24;
}

.lock-minimum-info span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.lock-minimum-info strong {
    color: #fbbf24;
    font-size: 15px;
    margin-left: 4px;
    font-weight: 600;
}

.deposit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    letter-spacing: 0;
}

.deposit-btn:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.deposit-btn:active {
    transform: translateY(0);
}

.deposit-btn i {
    font-size: 18px;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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


@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-right: 12px;
}

.language-current {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-current:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.language-current .flag-icon {
    font-size: 20px;
    line-height: 1;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(135deg, #1a1d2e 0%, #0f111d 100%);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-option:hover {
    background: rgba(88, 166, 255, 0.1);
}

.language-option .flag-icon {
    font-size: 20px;
    line-height: 1;
}

.language-option .lang-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
}

/* Logout Button */
.logout-btn {
    width: 36px;
    height: 36px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 8px;
    color: var(--color-danger);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(248, 81, 73, 0.2);
    border-color: var(--color-danger);
    transform: scale(1.05);
}

.logout-btn i {
    font-size: 16px;
}

/* Hide language selector in header on desktop (sidebar has it) */
@media screen and (min-width: 1024px) {
    .language-selector {
        display: none !important;
    }
}
