/* ============================================
   0xaddress - Wallet Educativa
   Estilos Profesionales con Modo Claro/Oscuro
   ============================================ */

:root {
    /* Colores principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    /* Fondos - Modo Oscuro (default) */
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --bg-input: #16162a;
    
    /* Textos */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Bordes */
    --border-color: #2d2d4a;
    --border-focus: #6366f1;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-card: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* Tipografía */
    --font-display: 'Syne', sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    /* Espaciado */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ============================================
   Modo Claro
   ============================================ */
[data-theme="light"] {
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-input: #e9ecef;
    
    --text-primary: #1a1a2e;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    --border-color: #dee2e6;
    
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.12);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

/* ============================================
   Listener Toggle Button
   ============================================ */
.listener-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.listener-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.listener-toggle.active {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
}

.listener-toggle.inactive {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.listener-icon {
    font-size: 1rem;
}

.listener-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.listener-toggle.active .listener-status {
    color: var(--secondary);
}

.listener-toggle.inactive .listener-status {
    color: var(--danger);
}

.listener-toggle.active .listener-icon {
    animation: pulse-listener 2s ease-in-out infinite;
}

@keyframes pulse-listener {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: rotate(15deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: translateY(20px) rotate(-90deg);
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: translateY(-20px) rotate(90deg);
}

/* ============================================
   Loader
   ============================================ */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.logo-animated {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loader-progress {
    width: 30%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

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

/* ============================================
   Logo
   ============================================ */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-hex {
    color: var(--primary);
    font-family: var(--font-mono);
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Modal Base
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

/* Modal de firma siempre encima */
#signModal {
    z-index: 2000;
}

/* Modal de scanner encima de todo */
#scannerModal {
    z-index: 2100;
}

/* Modales de detalle con z-index intermedio */
#nftDetailModal,
#tokenDetailModal {
    z-index: 1500;
}

/* Modal de settings */
#settingsModal {
    z-index: 1200;
}

[data-theme="light"] .modal {
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ============================================
   Setup Modal
   ============================================ */
.setup-modal {
    text-align: center;
}

.setup-header {
    margin-bottom: 2rem;
}

.setup-header h2 {
    font-size: 1.75rem;
    margin: 1rem 0 0.5rem;
}

.setup-subtitle {
    color: var(--text-secondary);
}

.setup-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.setup-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.setup-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.setup-tab:hover:not(.active) {
    color: var(--text-primary);
}

.setup-tab-content {
    display: none;
}

.setup-tab-content.active {
    display: block;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.file-input-display:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.file-input-display.has-file {
    border-color: var(--secondary);
    border-style: solid;
    background: rgba(16, 185, 129, 0.1);
}

.file-input-display .file-icon {
    font-size: 1.5rem;
}

.file-input-display .file-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-input-display.has-file .file-text {
    color: var(--secondary);
}

.setup-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    text-align: left;
}

.info-icon {
    font-size: 2rem;
}

.info-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

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

.setup-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    text-align: left;
}

.warning-icon {
    font-size: 1.25rem;
}

.setup-warning p {
    font-size: 0.85rem;
    color: var(--accent);
}

/* ============================================
   Formularios
   ============================================ */
.input-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

input, select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-display);
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.password-strength {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background: var(--danger);
    transition: all 0.3s;
}

.password-strength.weak::after {
    width: 33%;
    background: var(--danger);
}

.password-strength.medium::after {
    width: 66%;
    background: var(--accent);
}

.password-strength.strong::after {
    width: 100%;
    background: var(--secondary);
}

.password-match {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.password-match.match {
    color: var(--secondary);
}

.password-match.no-match {
    color: var(--danger);
}

/* ============================================
   Botones
   ============================================ */
.btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

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

.btn-reset {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: color 0.2s;
}

.btn-reset:hover {
    color: var(--danger);
}

.unlock-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.unlock-options .separator {
    color: var(--text-muted);
}

.unlock-options .btn-text {
    font-size: 0.85rem;
}

.btn-danger-text {
    color: var(--danger) !important;
}

.import-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.import-buttons button {
    flex: 1;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.network-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--secondary);
}

.network-dot {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: blink 2s infinite;
}

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

.header-right {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app.hidden {
    display: none;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   Balance Card
   ============================================ */
.balance-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

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

.address-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-input);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.address-badge:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

.explorer-icon {
    font-size: 0.7rem;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.balance-symbol {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 1.5rem;
}

/* ============================================
   Educational Tips
   ============================================ */
.edu-tips {
    margin-bottom: 1.5rem;
}

.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
}

.tip-icon {
    font-size: 1.25rem;
}

.tip-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: opacity 0.3s ease;
}

/* ============================================
   Sections
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================
   Assets Tabs
   ============================================ */
.assets-tabs-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.assets-tabs {
    display: flex;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.assets-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-width: fit-content;
}

.assets-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.assets-tab.active {
    color: var(--primary);
    background: var(--bg-card);
    border-bottom-color: var(--primary);
}

.tab-label, .tab-label-short {
    display: inline;
}

@media (max-width: 480px) {
    .tab-label {
        display: none;
    }
    .assets-tab {
        padding: 0.75rem 0.4rem;
        font-size: 0.75rem;
    }
}

.tab-count {
    background: var(--bg-input);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
}

.assets-tab.active .tab-count {
    background: var(--primary);
    color: white;
}

.assets-tab-content {
    display: none;
    padding: 1rem;
}

.assets-tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   NFT Accordion
   ============================================ */
.nfts-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nft-collection {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.nft-collection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nft-collection-header:hover {
    background: var(--bg-card-hover);
}

.nft-collection-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nft-collection-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.nft-collection-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.nft-collection-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.nft-collection-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nft-count-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.nft-collection-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: var(--text-muted);
}

.nft-collection.expanded .nft-collection-toggle {
    transform: rotate(180deg);
}

.nft-collection-actions {
    display: flex;
    gap: 0.25rem;
}

.nft-collection-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nft-collection-actions button:hover {
    opacity: 1;
}

.nft-collection-content {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border-color);
}

.nft-collection.expanded .nft-collection-content {
    display: block;
}

.nft-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding-top: 1rem;
}

.nft-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.nft-item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.nft-item-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-input);
}

.nft-item-info {
    padding: 0.75rem;
}

.nft-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-item-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* NFT Attributes in Detail Modal */
.nft-attributes {
    margin-top: 1rem;
}

.nft-attributes-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.nft-attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.nft-attribute {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
}

.nft-attribute-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.nft-attribute-value {
    font-size: 0.8rem;
    font-weight: 600;
}

.nft-description {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.nft-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.nft-description p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.btn-refresh:hover {
    opacity: 1;
}

.btn-refresh.spinning {
    animation: spin-refresh 1s linear infinite;
}

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

.tokens-section, .nfts-section, .activity-section {
    margin-bottom: 2rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ============================================
   Tokens List
   ============================================ */
.tokens-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.token-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: pointer;
}

.token-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.token-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.token-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.token-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

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

.token-balance .amount {
    font-size: 1rem;
    font-weight: 600;
}

.token-balance .symbol {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.token-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.token-action-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.token-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   NFTs Section - Mejorado
   ============================================ */
.nfts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nft-collection {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.3s ease;
}

.nft-collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.collection-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collection-name {
    font-weight: 600;
    font-size: 1rem;
}

.collection-symbol {
    padding: 0.2rem 0.5rem;
    background: var(--gradient-primary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.collection-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.collection-actions {
    display: flex;
    gap: 0.5rem;
}

.collection-address {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    word-break: break-all;
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.nft-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.nft-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.nft-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.nft-item {
    aspect-ratio: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nft-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.nft-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--gradient-primary);
    opacity: 0.7;
}

.nft-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    display: flex;
    flex-direction: column;
}

.nft-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-token-id {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-mono);
}

.nft-id {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* ============================================
   Activity List
   ============================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.activity-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-input);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.activity-amount {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
}

.activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
}

.activity-badge.badge-sent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.activity-badge.badge-received {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.activity-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-address {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    flex-shrink: 0;
    opacity: 0.8;
}

.activity-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.activity-link:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* ============================================
   Receive Modal
   ============================================ */
.receive-content {
    text-align: center;
}

.qr-container {
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 1.5rem 0;
    min-width: 220px;
    min-height: 220px;
}

.qr-container canvas {
    display: block;
}

.address-display {
    margin-bottom: 1.5rem;
}

.address-display label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.address-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.address-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--text-secondary);
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-copy:hover {
    opacity: 1;
}

.receive-info {
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

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

.btn-explorer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-explorer:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

/* ============================================
   Send Modal
   ============================================ */
.send-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s;
}

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

.address-input-group {
    display: flex;
    gap: 0.5rem;
}

.address-input-group input {
    flex: 1;
}

.btn-scan {
    width: 48px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-scan:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.amount-input {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.amount-input input {
    border: none;
    background: none;
}

.amount-input input:focus {
    box-shadow: none;
}

.token-symbol {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-left: 1px solid var(--border-color);
}

.balance-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-max {
    background: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 0.125rem 0.5rem;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.gas-estimate {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   Scanner Modal
   ============================================ */
.scanner-modal {
    max-width: 400px;
}

#qrReader {
    width: 100%;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#qrReader video {
    width: 100%;
    border-radius: var(--radius-md);
}

.scanner-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   Settings Modal
   ============================================ */
.settings-modal {
    max-width: 500px;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.current-network-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
}

.current-network-display .network-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.current-network-display .network-chain-id {
    font-size: 0.8rem;
    opacity: 0.8;
}

.network-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.network-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.network-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.network-item.active {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
}

.network-item-info {
    display: flex;
    flex-direction: column;
}

.network-item-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.network-item-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.network-item-actions {
    display: flex;
    gap: 0.5rem;
}

.network-item-check {
    color: var(--secondary);
    font-size: 1.2rem;
}

.btn-remove-network {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-network:hover {
    opacity: 1;
}

.btn-full {
    width: 100%;
}

.add-network-form {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.add-network-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.add-network-buttons button {
    flex: 1;
}

.settings-danger {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.settings-danger h3 {
    color: var(--danger);
}

.btn-danger {
    width: 100%;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.danger-warning {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    text-align: center;
}

/* ============================================
   Private Key Export
   ============================================ */
.private-key-box {
    background: var(--bg-input);
    border: 2px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem 0;
    cursor: pointer;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.private-key-box:hover {
    background: var(--bg-card-hover);
}

.private-key-masked {
    color: var(--text-muted);
    letter-spacing: 2px;
}

.private-key-visible {
    color: var(--danger);
}

.private-key-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.private-key-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
}

/* ============================================
   Export Options Checkboxes
   ============================================ */
.export-options {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: var(--primary);
}

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

.checkbox-label span {
    user-select: none;
}

/* ============================================
   Sign Modal
   ============================================ */
.sign-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sign-header h2 {
    margin-bottom: 0.5rem;
}

.sign-header p {
    color: var(--text-secondary);
}

.tx-details {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.tx-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tx-detail-row:last-child {
    border-bottom: none;
}

.tx-detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tx-detail-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

.sign-buttons {
    display: flex;
    gap: 1rem;
}

.sign-buttons .btn-secondary {
    flex: 1;
}

.sign-buttons .btn-primary {
    flex: 2;
}

/* ============================================
   Contract Modal
   ============================================ */
.contract-info {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.contract-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.preview-details p {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

/* ============================================
   NFT Detail Modal
   ============================================ */
.nft-detail-modal {
    max-width: 550px;
}

.nft-detail-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nft-detail-image {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nft-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-detail-image .nft-placeholder {
    font-size: 4rem;
    opacity: 0.5;
}

.nft-detail-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.nft-detail-collection {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.nft-detail-symbol {
    padding: 0.2rem 0.5rem;
    background: var(--gradient-primary);
    border-radius: 4px;
    font-size: 0.7rem;
    color: white;
    font-weight: 600;
}

.nft-detail-section {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.nft-detail-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.nft-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.nft-detail-row:last-child {
    border-bottom: none;
}

.nft-metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.nft-metadata-item {
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.nft-metadata-item .label {
    color: var(--text-muted);
    font-size: 0.7rem;
    display: block;
}

.nft-metadata-item .value {
    font-weight: 500;
    word-break: break-word;
}

.nft-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.nft-detail-actions button {
    flex: 1;
}

/* ============================================
   Token Detail Modal
   ============================================ */
.token-detail-modal {
    max-width: 450px;
}

.token-detail-content {
    text-align: center;
}

.token-detail-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
}

.token-detail-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.token-detail-symbol {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-primary);
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.token-detail-balance {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.token-detail-balance .balance-value {
    font-size: 2rem;
    font-weight: 700;
}

.token-detail-balance .balance-symbol {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.token-detail-section {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: left;
}

.token-detail-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.token-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.token-detail-row:last-child {
    border-bottom: none;
}

.token-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.token-detail-actions button {
    flex: 1;
}

.token-detail-actions.secondary-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.token-detail-actions.secondary-actions button {
    flex: none;
}

.btn-text.danger {
    color: var(--danger);
}

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

/* ============================================
   Transfer Form
   ============================================ */
.transfer-form {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.transfer-form h3 {
    margin-bottom: 1rem;
}

.transfer-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.transfer-preview img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.transfer-token-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.token-icon-small {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.token-transfer-balance {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.transfer-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.transfer-buttons button {
    flex: 1;
}

/* ============================================
   Processing State
   ============================================ */
.processing-state {
    text-align: center;
    padding: 2rem;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.processing-state h3 {
    margin-bottom: 0.5rem;
}

.processing-state p {
    color: var(--text-secondary);
}

/* ============================================
   Success State
   ============================================ */
.success-state {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-state h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.success-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tx-hash-box {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.tx-hash-box span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tx-hash-box a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.tx-hash-box a:hover {
    text-decoration: underline;
}

/* ============================================
   Utility Classes
   ============================================ */
.mono {
    font-family: var(--font-mono);
}

.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.clickable:hover {
    color: var(--primary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.3s ease;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-links span {
    color: var(--text-muted);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--secondary);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .balance-amount {
        font-size: 2rem;
    }

    .balance-actions {
        flex-direction: row;
    }

    .action-btn {
        padding: 0.75rem;
    }

    .action-icon {
        font-size: 1.25rem;
    }

    .action-btn span:last-child {
        font-size: 0.8rem;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
    }

    .header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }
    
    .nft-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

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

/* ============================================
   CONTRACTS TAB
   ============================================ */

/* Sub-tabs de Contracts */
.contracts-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.contracts-subtab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.contracts-subtab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.contracts-subtab.active {
    background: var(--primary);
    color: white;
}

.subtab-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.contracts-subtab-content {
    display: none;
}

.contracts-subtab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Deploy Cards Grid */
.deploy-header {
    margin-bottom: 20px;
}

.deploy-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.deploy-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.network-badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.deploy-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.deploy-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.deploy-card:hover {
    border-color: var(--card-color, var(--primary));
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.deploy-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.deploy-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.deploy-card-icon i {
    font-size: 1.5rem;
}

.deploy-card-title {
    flex: 1;
}

.deploy-card-title h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 4px;
}

.deploy-card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.info-toggle:hover {
    color: var(--primary);
}

.deploy-card-description {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: -1px;
    padding-top: 16px;
    animation: fadeIn 0.2s ease;
}

.deploy-card-description p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.deploy-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feature-tag {
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.deploy-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
}

.gas-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-deploy {
    padding: 8px 16px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-deploy:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

/* Contracts List */
.contracts-section {
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contract-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.contract-card:hover {
    border-color: var(--primary);
}

.contract-card.is-owner {
    border-left: 3px solid var(--secondary);
}

.contract-card-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.contract-icon {
    font-size: 1.5rem;
}

.contract-info {
    flex: 1;
}

.contract-info h5 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.contract-address {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contract-symbol {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--primary);
    margin-left: 8px;
}

.contract-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.contract-network {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.owner-badge {
    font-size: 0.7rem;
    color: var(--secondary);
}

.contract-card-actions {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--bg-input);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-icon-sm.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Import Form */
.import-container {
    max-width: 500px;
    margin: 0 auto;
}

.import-container h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.import-section {
    margin-bottom: 20px;
}

.import-section label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.abi-input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.abi-tab {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.abi-tab:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.abi-tab:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.abi-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.abi-tab-content {
    display: none;
}

.abi-tab-content.active {
    display: block;
}

.import-container textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
}

.import-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Deploy Modal */
.deploy-modal {
    max-width: 500px;
}

.deploy-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.deploy-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.deploy-params-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deploy-param label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.deploy-param label .required {
    color: var(--danger);
}

.deploy-param input {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
}

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

.param-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.deploy-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.deploy-actions .btn-secondary {
    flex: 1;
}

.deploy-actions .btn-primary {
    flex: 2;
}

/* Deploy Progress */
.deploy-progress {
    text-align: center;
    padding: 40px 20px;
}

.progress-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.deploy-success, .deploy-error {
    text-align: center;
    padding: 40px 20px;
}

.success-icon, .error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.contract-address-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-input);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.contract-address-box .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.contract-address-box .address {
    font-size: 0.85rem;
    word-break: break-all;
}

.btn-copy-sm {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.deploy-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Contract Detail Modal */
.contract-detail-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.contract-detail-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.contract-detail-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.contract-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.contract-type-badge {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.contract-info-section {
    margin-bottom: 24px;
}

.token-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.loading-info, .error-info {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.error-info {
    color: var(--danger);
}

/* Methods Section */
.methods-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.methods-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.btn-download-abi {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-download-abi:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.method-tab {
    padding: 8px 16px;
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.method-tab:hover {
    color: var(--text-primary);
}

.method-tab.active {
    background: var(--primary);
    color: white;
}

.methods-tab-content {
    max-height: 400px;
    overflow-y: auto;
}

.method-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.method-card.write {
    border-left: 3px solid var(--accent);
}

.method-card.read {
    border-left: 3px solid var(--secondary);
}

.method-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.method-header:hover {
    background: var(--bg-card-hover);
}

.method-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    flex: 1;
}

.method-returns {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 12px;
}

.method-body {
    padding: 16px;
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
}

.method-input {
    margin-bottom: 12px;
}

.method-input label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.type-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.method-input input {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.no-inputs {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.btn-execute {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-execute.read {
    background: var(--secondary);
    color: white;
}

.btn-execute.write {
    background: var(--accent);
    color: white;
}

.btn-execute:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.method-result {
    margin-top: 12px;
}

.executing {
    text-align: center;
    color: var(--text-secondary);
    padding: 12px;
}

.result-success, .result-error {
    padding: 12px;
    border-radius: var(--radius-sm);
}

.result-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary);
}

.result-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
}

.result-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    word-break: break-all;
}

.tx-preview {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.tx-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.tx-json {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0;
}

.tx-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.tx-link:hover {
    text-decoration: underline;
}

.result-cancelled {
    text-align: center;
    color: var(--text-muted);
    padding: 12px;
}

/* Events Section */
.events-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.events-info-box i {
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.events-info-box strong {
    display: block;
    margin-bottom: 4px;
}

.events-info-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.indexed-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 4px;
}

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.event-name {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.btn-listen {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-listen:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-listen.active .listen-icon {
    animation: pulse 1.5s infinite;
}

.event-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-input);
}

.event-param {
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.event-param.indexed {
    border: 1px solid var(--primary);
}

.event-logs {
    padding: 12px 16px;
    max-height: 200px;
    overflow-y: auto;
}

.logs-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
}

.listening-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
    font-size: 0.85rem;
}

.listening-indicator .pulse {
    width: 10px;
    height: 10px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulseGlow 1.5s infinite;
    box-shadow: 0 0 10px var(--secondary);
}

@keyframes pulseGlow {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 5px var(--secondary);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.3);
        box-shadow: 0 0 15px var(--secondary), 0 0 30px var(--secondary);
    }
}

/* Spinner pequeño para ejecutar métodos */
.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

.executing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: var(--text-secondary);
}

/* Botón de escucha activo */
.btn-listen.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-listen.active .listen-icon {
    animation: radarPulse 1.5s infinite;
}

@keyframes radarPulse {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.2);
    }
}

.event-log-entry {
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--secondary);
    animation: slideIn 0.3s ease;
}

.event-log-entry.new {
    background: rgba(16, 185, 129, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.log-args {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.log-arg {
    padding: 4px 8px;
    background: var(--bg-input);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.log-tx {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
}

.log-tx:hover {
    text-decoration: underline;
}

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

/* Contracts Loading */
.contracts-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* Deploy Notice - Función en desarrollo */
.deploy-notice {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
    max-width: 500px;
    margin: 0 auto;
}

.deploy-notice .notice-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.deploy-notice h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.deploy-notice p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.deploy-notice .notice-options {
    text-align: left;
    background: var(--bg-input);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.deploy-notice .notice-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.deploy-notice .notice-list li {
    padding: 8px 0;
    color: var(--text-secondary);
}

.deploy-notice .notice-list li strong {
    color: var(--text-primary);
}

.deploy-notice .notice-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.deploy-notice .notice-hint a {
    color: var(--primary);
    text-decoration: none;
}

.deploy-notice .notice-hint a:hover {
    text-decoration: underline;
}

.deploy-notice .btn-primary {
    margin-top: 10px;
}

/* Compile/Deploy Form */
.compile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.compile-container h3 {
    margin-bottom: 8px;
}

.compile-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.compile-section {
    margin-bottom: 20px;
}

.compile-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.compile-section label .required {
    color: var(--danger);
}

.compile-section input,
.compile-section select,
.compile-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.compile-section textarea {
    resize: vertical;
    min-height: 80px;
}

.mono-textarea {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.85rem;
}

.compile-section .input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.compile-section .type-hint {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.constructor-params {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.param-input label {
    font-size: 0.9rem;
}

.param-input input {
    margin-top: 4px;
}

.params-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.compile-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.compile-actions .btn-secondary {
    flex: 1;
}

.compile-actions .btn-primary {
    flex: 2;
}

/* Ajuste subtabs para 4 items */
.contracts-subtabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow-x: auto;
}

.contracts-subtab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.contracts-subtab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.contracts-subtab.active {
    background: var(--primary);
    color: white;
}
