/* ========================================
   TrustXScanner - Estilos Principales
   Línea Visual: Web3TrustX
   ======================================== */

/* ========================================
   Variables CSS
   ======================================== */
:root {
    /* Colores */
    --color-background: #0A1220;
    --color-primary: #00B5AD;
    --color-primary-hover: #00D4CB;
    --color-primary-dark: #009A93;
    --color-surface: #131B2E;
    --color-surface-light: #1A2538;
    --color-text: #FFFFFF;
    --color-text-secondary: #A8B3CF;
    --color-text-muted: #6B7A99;
    --color-border: #1F2937;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    
    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 181, 173, 0.3);
    --shadow-glow-strong: 0 0 30px rgba(0, 181, 173, 0.5);
}

/* ========================================
   Reset y Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ========================================
   Language Selector (Estilo Web3TrustX)
   ======================================== */
.language-selector {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    z-index: 1000;
}

.lang-button {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
}

.lang-button:hover {
    color: var(--color-text-secondary);
}

.lang-button.active {
    color: var(--color-primary);
    font-weight: 600;
}

.lang-separator {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    user-select: none;
}

/* ========================================
   Contenedor Principal
   ======================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Encabezado - Esquina Superior Izquierda
   ======================================== */
.header {
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    z-index: 1000;
}

.header-content {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 181, 173, 0.4));
}

.header-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.app-title {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.beta-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 181, 173, 0.15);
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Contenido Principal
   ======================================== */
.main-content {
    flex: 1;
    padding-top: 6rem;
}

.main-title {
    font-family: var(--font-secondary);
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* ========================================
   Sección de Escaneo
   ======================================== */
.scan-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.input-group {
    margin-bottom: var(--spacing-md);
}

.input-field {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.3s ease;
}

.input-field::placeholder {
    color: var(--color-text-muted);
}

.input-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 181, 173, 0.1), var(--shadow-glow);
    background: var(--color-background);
}

.input-field:hover:not(:focus) {
    border-color: var(--color-primary-dark);
}

/* ========================================
   Botón de Escaneo
   ======================================== */
.scan-button {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-background);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.scan-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.scan-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
}

.scan-button:hover::before {
    left: 100%;
}

.scan-button:active {
    transform: translateY(0);
}

.button-text {
    font-weight: 600;
}

.button-icon {
    font-size: 1.125rem;
}

/* ========================================
   Sección de Resultados
   ======================================== */
.results-section {
    margin-bottom: var(--spacing-lg);
}

.results-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    min-height: 200px;
    box-shadow: var(--shadow-md);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    gap: var(--spacing-sm);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Content */
.results-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Result Header - Token Info */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.token-identity {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.token-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.token-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
}

.token-name-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.token-symbol {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.token-address {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: 'Courier New', monospace;
    margin: 0;
}

.token-price {
    text-align: right;
}

.price-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.price-change {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

.price-change.positive {
    color: var(--color-success);
}

.price-change.negative {
    color: var(--color-error);
}

.price-change.neutral {
    color: var(--color-text-muted);
}

/* Result Cards */
.result-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-surface-light);
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    letter-spacing: 0.05em;
}

.card-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.info-value {
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 600;
    font-family: var(--font-secondary);
}

.info-value.highlight {
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* ========================================
   Footer y Disclaimer
   ======================================== */
.footer {
    margin-top: auto;
    padding-top: var(--spacing-md);
}

.disclaimer {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(0, 181, 173, 0.05);
    border: 1px solid rgba(0, 181, 173, 0.2);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.disclaimer-icon {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.disclaimer-text {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.disclaimer-text strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* ========================================
   Layout de Dos Columnas (60/40)
   ======================================== */
.results-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: stretch;
    width: 100%;
}

@media (min-width: 1024px) {
    .results-grid-layout {
        grid-template-columns: 3fr 2fr; /* 60% / 40% */
        gap: 30px;
    }
}

.risk-panel,
.token-data-panel {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Aumentado de 9px a 12px para alineación con panel izquierdo */
    height: 100%;
    min-height: 0; /* Permite que flexbox funcione correctamente */
}

/* Panel derecho: reducir espaciado entre cards (override) */
.token-data-panel {
    gap: 16px; /* Aumentado para alineación vertical con panel izquierdo */
}

/* Cards dentro del token data panel con espacio consistente */
.token-data-panel .result-card {
    margin-bottom: 0;
}

/* Reducir padding en headers y content del panel derecho */
.token-data-panel .card-header {
    padding: 1rem 1.5rem;
}

.token-data-panel .card-content {
    padding: 12px;
}

/* Info rows más compactas en panel derecho */
.token-data-panel .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Labels más pequeños en panel derecho */
.token-data-panel .info-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Valores más compactos en panel derecho */
.token-data-panel .info-value {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.token-data-panel .info-value.highlight {
    font-size: 14px;
    font-weight: 600;
    color: #00B5AD;
}

/* En mobile, asegurar que el token panel aparezca después del risk panel */
@media (max-width: 1023px) {
    .risk-panel {
        order: 1;
    }
    
    .token-data-panel {
        order: 2;
    }
}

/* Eliminar estilos antiguos del layout anterior */
.analysis-layout > div {
    display: block;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.token-info-panel {
    position: static; /* Remover sticky */
}

/* Score Breakdown siempre visible */
.score-breakdown-section {
    margin-top: 20px;
}

.score-breakdown-header {
    font-size: 14px;
    font-weight: 600;
    color: #00B5AD;
    padding: 10px;
    background: rgba(0, 181, 173, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
}

.score-breakdown-content {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .main-content {
        padding-top: 5rem;
    }
    
    .main-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }
    
    .header {
        top: var(--spacing-md);
        left: var(--spacing-md);
    }
    
    .header-content {
        padding: 0.4rem var(--spacing-md);
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .logo {
        width: 32px;
        height: 32px;
    }
    
    .scan-section {
        padding: var(--spacing-md);
    }
    
    .results-container {
        padding: var(--spacing-md);
        min-height: 150px;
    }
    
    .empty-state {
        height: 120px;
    }
    
    .result-header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .token-identity {
        flex-direction: column;
        text-align: center;
    }
    
    .token-price {
        text-align: center;
    }
    
    .card-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.4rem var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .app-title {
        font-size: 1.1rem;
    }
    
    .main-title {
        font-size: 1.25rem;
    }
    
    .disclaimer {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .language-selector {
        top: var(--spacing-md);
        right: var(--spacing-md);
        gap: 0.3rem;
    }
    
    .lang-button {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
    
    .token-symbol {
        font-size: 1.25rem;
    }
    
    .price-value {
        font-size: 1.25rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ========================================
   Animaciones
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}
