/* Gerson IA - Sistema de Estilos Premium */

:root {
    --bg-dark: #060e0d;
    --bg-card: rgba(16, 28, 26, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f2f7f5;
    --text-secondary: #8fa39e;
    --text-disabled: #5a6e6a;
    
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --secondary: #00ffd1;
    --success: #00e676;
    --success-glow: rgba(0, 230, 118, 0.3);
    --danger: #ff5252;
    --warning: #ffb300;
    
    --font-main: 'Outfit', sans-serif;
    --font-code: 'Space Grotesk', monospace;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fundo Animado com Gradiente Ecológico */
.glass-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(0, 255, 209, 0.12) 0%, transparent 45%);
    z-index: -1;
    pointer-events: none;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px;
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.2);
    transition: var(--transition-smooth);
}

.logo-image:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.45);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.logo-text .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.pulse-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulse 1.8s infinite;
}

.glow-green { color: var(--success); background-color: var(--success); }
.glow-yellow { color: var(--warning); background-color: var(--warning); }
.glow-red { color: var(--danger); background-color: var(--danger); }

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.node-info-bar {
    display: flex;
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.info-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-weight: 600;
    font-size: 0.95rem;
}

.info-item .highlight-tokens {
    color: var(--secondary);
    text-shadow: 0 0 8px rgba(0, 255, 209, 0.4);
}

/* LAYOUT GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    flex: 1;
}

/* CARDS GLASSMORPHISM */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* INPUTS */
.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.toggle-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.toggle-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* BUTTONS */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 11px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-main);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--primary-glow);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn.success {
    background: var(--success);
    color: #000;
}

.btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--success-glow);
}

.btn.danger {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.btn.danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn.full-width {
    width: 100%;
}

.btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* STATS */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-row strong {
    color: var(--text-primary);
}

/* CHAT SECTION */
.chat-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--success);
    background: rgba(0, 230, 118, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.message {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.92rem;
    animation: fadeIn 0.25s ease-out;
}

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

.system-message {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    max-width: 100%;
    font-size: 0.85rem;
}

.user-message {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.assistant-message {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.error-message {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.25);
    color: #ff8a8a;
    align-self: flex-start;
}

.msg-body pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.85rem;
    margin-top: 10px;
    color: #5efccb;
}

.msg-meta {
    font-size: 0.7rem;
    color: var(--text-disabled);
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

/* INPUT AREA */
.chat-input-area {
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
}

.chat-input-area textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.92rem;
    outline: none;
    resize: none;
    transition: var(--transition-smooth);
}

.chat-input-area textarea:focus {
    border-color: var(--primary);
}

/* UTILS */
.code-text {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--primary);
}

.auth-welcome {
    font-weight: 600;
    margin-bottom: 5px;
}

.auth-welcome .user-name {
    color: var(--secondary);
    text-shadow: 0 0 6px rgba(0, 242, 254, 0.3);
}

.auth-status-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.4;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 480px;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.token-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.token-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.token-card:hover {
    background: rgba(79, 172, 254, 0.06);
    border-color: rgba(79, 172, 254, 0.3);
}

.token-card.selected {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--secondary);
}

.token-info h4 {
    margin-bottom: 4px;
    font-weight: 600;
    color: #fff;
}

.token-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.token-price {
    font-weight: 600;
    color: var(--secondary);
}

.pix-checkout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.pix-qr {
    width: 180px;
    height: 180px;
    background: #fff;
    padding: 10px;
    border-radius: var(--radius-md);
}

.range-hint {
    font-size: 0.75rem;
    color: var(--text-disabled);
    margin-top: 4px;
    display: block;
}

/* Progress Bar de Download */
.download-container {
    display: none;
    width: 160px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.download-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

.download-percentage {
    display: none;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--secondary);
    margin-top: 2px;
    font-family: var(--font-code);
}
