/* CSS Variables for theming */ :root { /* Light theme colors */ --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --bg-secondary: rgba(255, 255, 255, 0.95); --bg-card: rgba(255, 255, 255, 0.95); --bg-input: rgba(255, 255, 255, 0.8); --bg-button: rgba(255, 255, 255, 0.2); --bg-button-secondary: rgba(255, 255, 255, 0.15); --bg-button-ghost: transparent; --text-primary: #2d3748; --text-secondary: #4a5568; --text-muted: #666; --text-inverse: white; --border-color: rgba(255, 255, 255, 0.3); --border-input: rgba(255, 255, 255, 0.3); --border-focus: #667eea; --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1); --shadow-button: 0 8px 25px rgba(79, 70, 229, 0.4); --accent-success: #10b981; --accent-error: #ef4444; --accent-warning: #f59e0b; --accent-info: #3b82f6; /* Spacing system */ --spacing-xs: 4px; --spacing-sm: 8px; --spacing-md: 12px; --spacing-lg: 16px; --spacing-xl: 20px; --spacing-2xl: 24px; --spacing-3xl: 32px; } /* Dark theme colors */ [data-theme="dark"] { --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); --bg-secondary: rgba(26, 32, 44, 0.95); --bg-card: rgba(45, 55, 72, 0.95); --bg-input: rgba(74, 85, 104, 0.8); --bg-button: linear-gradient(135deg, #4299e1 0%, #667eea 100%); --bg-button-secondary: rgba(74, 85, 104, 0.8); --bg-button-ghost: transparent; --text-primary: #ffffff; --text-secondary: #f7fafc; --text-muted: #cbd5e0; --text-inverse: #1a202c; --border-color: rgba(203, 213, 224, 0.2); --border-input: rgba(203, 213, 224, 0.3); --border-focus: #4299e1; --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3); --shadow-button: 0 8px 25px rgba(66, 153, 225, 0.3); --accent-success: #34d399; --accent-error: #f87171; --accent-warning: #fbbf24; --accent-info: #60a5fa; } /* Dark theme button text overrides */ [data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-secondary, [data-theme="dark"] .btn-ghost { color: white; } /* Dark theme buttons inside cards */ [data-theme="dark"] .card .btn-primary { background: linear-gradient(135deg, #4299e1 0%, #667eea 100%); color: white; border: 2px solid transparent; } [data-theme="dark"] .card .btn-primary:hover { background: linear-gradient(135deg, #3182ce 0%, #5a67d8 100%); box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4); } [data-theme="dark"] .card .btn-secondary { background: rgba(74, 85, 104, 0.8); color: white; border: 2px solid rgba(203, 213, 224, 0.2); } [data-theme="dark"] .card .btn-secondary:hover { background: rgba(74, 85, 104, 0.9); border-color: rgba(203, 213, 224, 0.3); } [data-theme="dark"] .card .btn-ghost { background: transparent; color: #4299e1; border: 1px solid rgba(66, 153, 225, 0.3); } [data-theme="dark"] .card .btn-ghost:hover { background: rgba(66, 153, 225, 0.1); border-color: rgba(66, 153, 225, 0.5); } /* Buttons inside cards (on white/light backgrounds) */ .card .btn-primary { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: white; border: 2px solid transparent; } .card .btn-primary:hover { background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%); box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4); } .card .btn-secondary { background: rgba(79, 70, 229, 0.1); color: #4f46e5; border: 2px solid rgba(79, 70, 229, 0.2); } .card .btn-secondary:hover { background: rgba(79, 70, 229, 0.15); border-color: rgba(79, 70, 229, 0.3); } .card .btn-ghost { background: transparent; color: #4f46e5; border: 1px solid rgba(79, 70, 229, 0.3); } .card .btn-ghost:hover { background: rgba(79, 70, 229, 0.1); border-color: rgba(79, 70, 229, 0.5); } * { margin: 0; padding: 0; box-sizing: border-box; } body { width: 400px; min-height: 600px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-primary); background-attachment: fixed; color: var(--text-primary); line-height: 1.6; margin: 0; padding: 0; overflow-x: hidden; } .container { position: relative; min-height: 100vh; display: flex; flex-direction: column; } /* Header */ .header { background: var(--bg-secondary); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-xl); } .logo { display: flex; align-items: center; } .logo-icon { font-size: 24px; margin-right: var(--spacing-md); } .logo h1 { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0; } .header-actions { display: flex; align-items: center; gap: var(--spacing-md); } .btn-icon-only { background: var(--bg-button-ghost); border: 1px solid var(--border-color); border-radius: 8px; padding: var(--spacing-sm); cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; } .btn-icon-only:hover { background: var(--bg-input); color: var(--text-primary); } .status-indicator { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: var(--spacing-md); } .status-indicator .status-content { display: flex; align-items: center; gap: var(--spacing-sm); } .status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-warning); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2); } .status-indicator.connected .status-dot { background: var(--accent-success); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); } #statusText { font-size: 14px; font-weight: 500; color: white; } /* Vault status specific styling */ .vault-status .status-indicator { color: white; } .vault-status #statusText { color: white; } /* Enhanced lock button styling */ #lockBtn { display: flex; align-items: center; gap: var(--spacing-xs); padding: var(--spacing-sm) var(--spacing-md); font-size: 13px; border-radius: 8px; } #lockBtn svg { width: 14px; height: 14px; } /* Vault status lock button styling */ .vault-status #lockBtn { background: rgba(255, 255, 255, 0.1); color: white; border-color: rgba(255, 255, 255, 0.3); } .vault-status #lockBtn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); } /* Sections */ .section { padding: var(--spacing-xl); flex: 1; } .section:last-child { padding-bottom: var(--spacing-xl); } .section.hidden { display: none; } /* Center the auth section */ #authSection { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); /* Account for header height */ padding: var(--spacing-3xl) var(--spacing-xl); } #authSection .card { width: 100%; max-width: 350px; margin: 0; } .hidden { display: none !important; } /* Cards */ .card { background: var(--bg-card); backdrop-filter: blur(20px); border-radius: 16px; padding: var(--spacing-xl); margin-bottom: var(--spacing-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-card); } .card h2, .card h3 { margin-bottom: var(--spacing-lg); color: var(--text-primary); font-weight: 600; } .card h2 { font-size: 18px; } .card h3 { font-size: 16px; } /* Forms */ .form-group { margin-bottom: var(--spacing-lg); } .form-row { display: flex; gap: var(--spacing-sm); align-items: end; } label { display: block; margin-bottom: var(--spacing-xs); font-weight: 500; color: var(--text-secondary); font-size: 14px; } input, select, textarea { width: 100%; padding: var(--spacing-md) var(--spacing-lg); border: 2px solid var(--border-input); border-radius: 12px; background: var(--bg-input); font-size: 14px; color: var(--text-primary); } input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-focus); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } /* Placeholder styling */ input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; } /* Dark theme placeholder styling */ [data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #e2e8f0; opacity: 0.8; } .select { flex: 1; } /* Buttons */ .btn { padding: var(--spacing-md) var(--spacing-2xl); border: none; border-radius: 12px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; } .btn-primary { background: var(--bg-button); color: white; border: 2px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(10px); } .btn-primary:hover { background: rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.5); } .btn-secondary { background: var(--bg-button-secondary); color: white; border: 2px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px); } .btn-secondary:hover { background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.4); } .btn-ghost { background: var(--bg-button-ghost); color: white; border: 1px solid rgba(255, 255, 255, 0.3); } .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.5); } .btn-small { padding: var(--spacing-sm) var(--spacing-lg); font-size: 12px; } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn.loading { position: relative; color: transparent !important; pointer-events: none; } .btn.loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid transparent; border-top: 2px solid currentColor; border-radius: 50%; animation: btn-spin 0.8s linear infinite; color: white; } .btn-secondary.loading::after { color: var(--text-secondary); } @keyframes btn-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Inline Loading Components */ .inline-loading { display: flex; align-items: center; justify-content: center; gap: var(--spacing-sm); padding: var(--spacing-sm); color: var(--text-muted); font-size: 14px; } .inline-spinner { width: 16px; height: 16px; border: 2px solid rgba(102, 126, 234, 0.2); border-top: 2px solid var(--border-focus); border-radius: 50%; animation: btn-spin 0.8s linear infinite; } .button-group { display: flex; gap: var(--spacing-md); } .btn-copy { background: var(--bg-button-secondary); border: 1px solid var(--border-color); cursor: pointer; padding: 8px; border-radius: 8px; color: var(--text-secondary); flex-shrink: 0; height: fit-content; margin-top: 2px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; } .btn-copy:hover { background: rgba(102, 126, 234, 0.1); border-color: rgba(102, 126, 234, 0.3); } .encrypt-result .btn-copy:hover { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); } .decrypt-result .btn-copy:hover { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); } .btn-copy svg { width: 14px; height: 14px; stroke-width: 2; } /* Vault Header */ .vault-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-xl); } /* Vault Status Section */ .vault-status { padding: 0 0 var(--spacing-lg) 0; margin-bottom: var(--spacing-lg); } .vault-header h2 { color: white; font-size: 20px; font-weight: 600; } /* Add Keypair Toggle */ .add-keypair-toggle { margin-bottom: var(--spacing-lg); text-align: center; } .btn-icon { margin-right: var(--spacing-sm); font-weight: bold; } .add-keypair-form { max-height: 0; overflow: hidden; padding: 0; margin-bottom: 0; } .add-keypair-form:not(.hidden) { max-height: 300px; padding: var(--spacing-xl); margin-bottom: var(--spacing-lg); } .form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-lg); padding-bottom: var(--spacing-md); border-bottom: 1px solid rgba(102, 126, 234, 0.1); } .form-header h3 { margin: 0; color: var(--text-primary); } .btn-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: var(--spacing-xs) var(--spacing-sm); border-radius: 6px; line-height: 1; } .btn-close:hover { background: rgba(239, 68, 68, 0.1); color: var(--accent-error); } .form-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; } /* Keypairs List */ .keypairs-list { max-height: 240px; overflow-y: auto; overflow-x: hidden; padding: var(--spacing-xs); margin: -var(--spacing-xs); } .keypair-item { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-lg); border-radius: 12px; margin-bottom: var(--spacing-md); background: var(--bg-input); border: 1px solid var(--border-color); min-width: 0; /* Allow flex items to shrink */ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); } .keypair-item:last-child { margin-bottom: 0; } .keypair-item:hover { background: var(--bg-card); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); } .keypair-item.selected { background: rgba(16, 185, 129, 0.1); border-color: var(--accent-success); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15); } .keypair-item.selected .keypair-name { color: var(--accent-success); font-weight: 600; } .keypair-item.selected .keypair-type { background: rgba(16, 185, 129, 0.2); color: var(--accent-success); } .keypair-item.selected .select-btn { background: rgba(16, 185, 129, 0.2); color: var(--accent-success); border-color: rgba(16, 185, 129, 0.3); } .keypair-item.selected .select-btn:hover { background: rgba(16, 185, 129, 0.3); } .select-btn { background: var(--bg-button-secondary); color: var(--text-secondary); border: 1px solid var(--border-color); padding: var(--spacing-xs) var(--spacing-md); border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; } .select-btn:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-focus); } .keypair-info { flex: 1; min-width: 0; /* Allow shrinking */ margin-right: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-xs); } .keypair-name { font-weight: 500; color: var(--text-primary); word-break: break-word; /* Break long names */ overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 1.4; } .keypair-type { font-size: 11px; font-weight: 500; color: var(--text-primary); background: rgba(102, 126, 234, 0.15); padding: 2px 6px; border-radius: 6px; display: inline-block; width: fit-content; max-width: fit-content; letter-spacing: 0.5px; text-transform: uppercase; } .empty-state, .loading { text-align: center; color: var(--text-muted); font-style: italic; padding: 20px; } /* Selected Keypair Info */ .keypair-info .info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 8px 0; border-bottom: 1px solid rgba(102, 126, 234, 0.1); } .keypair-info .info-row:last-child { border-bottom: none; } .keypair-info label { font-weight: 500; color: var(--text-secondary); margin: 0; } .public-key-container, .signature-container { display: flex; align-items: flex-start; gap: 12px; flex: 1; margin-left: 12px; } .keypair-info code, .signature-result code, .encrypt-result code, .decrypt-result code { background: var(--bg-input); padding: 12px 16px; border-radius: 8px; font-size: 12px; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; word-break: break-all; flex: 1; color: var(--text-primary); border: 1px solid var(--border-color); line-height: 1.4; max-height: 120px; overflow-y: auto; white-space: pre-wrap; } .encrypt-result code { background: var(--bg-card); border-color: rgba(16, 185, 129, 0.2); color: var(--text-primary); } .decrypt-result code { background: var(--bg-card); border-color: rgba(59, 130, 246, 0.2); color: var(--text-primary); } /* Signature Result */ .signature-result { margin-top: 16px; padding: 16px; background: rgba(16, 185, 129, 0.1); border-radius: 12px; border: 1px solid rgba(16, 185, 129, 0.2); } .signature-result label { color: var(--accent-success); font-weight: 500; margin-bottom: 8px; } /* Loading Overlay */ .loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-secondary); backdrop-filter: blur(8px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; color: var(--text-primary); } .spinner { width: 40px; height: 40px; border: 3px solid rgba(102, 126, 234, 0.3); border-top: 3px solid var(--border-focus); border-radius: 50%; margin-bottom: 16px; } /* Enhanced Toast Notifications */ .toast-notification { position: fixed; top: 20px; right: 20px; min-width: 320px; max-width: 400px; padding: 16px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 1001; backdrop-filter: blur(20px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); display: flex; align-items: flex-start; gap: 12px; border: 1px solid transparent; transform: translateX(100%); opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .toast-notification.toast-show { transform: translateX(0); opacity: 1; } .toast-notification.toast-hide { transform: translateX(100%); opacity: 0; } .toast-icon { flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-top: 2px; } .toast-content { flex: 1; min-width: 0; } .toast-message { line-height: 1.5; word-wrap: break-word; } .toast-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; font-weight: bold; line-height: 1; opacity: 0.7; padding: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: all 0.2s ease; flex-shrink: 0; margin-top: 2px; } .toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); } /* Success Toast */ .toast-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%); color: white; border-color: rgba(16, 185, 129, 0.3); } .toast-success .toast-icon { background: rgba(255, 255, 255, 0.2); color: white; } /* Error Toast */ .toast-error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%); color: white; border-color: rgba(239, 68, 68, 0.3); } .toast-error .toast-icon { background: rgba(255, 255, 255, 0.2); color: white; } /* Info Toast */ .toast-info { background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%); color: white; border-color: rgba(59, 130, 246, 0.3); } .toast-info .toast-icon { background: rgba(255, 255, 255, 0.2); color: white; } /* Responsive toast positioning */ @media (max-width: 480px) { .toast-notification { left: 16px; right: 16px; min-width: auto; max-width: none; transform: translateY(-100%); } .toast-notification.toast-show { transform: translateY(0); } .toast-notification.toast-hide { transform: translateY(-100%); } } /* Scrollbar Styles */ .keypairs-list::-webkit-scrollbar, .encrypt-result code::-webkit-scrollbar, .decrypt-result code::-webkit-scrollbar, .signature-result code::-webkit-scrollbar { width: 6px; } .keypairs-list::-webkit-scrollbar-track, .encrypt-result code::-webkit-scrollbar-track, .decrypt-result code::-webkit-scrollbar-track, .signature-result code::-webkit-scrollbar-track { background: rgba(102, 126, 234, 0.1); border-radius: 3px; } .keypairs-list::-webkit-scrollbar-thumb, .encrypt-result code::-webkit-scrollbar-thumb, .decrypt-result code::-webkit-scrollbar-thumb, .signature-result code::-webkit-scrollbar-thumb { background: rgba(102, 126, 234, 0.3); border-radius: 3px; } .keypairs-list::-webkit-scrollbar-thumb:hover, .encrypt-result code::-webkit-scrollbar-thumb:hover, .decrypt-result code::-webkit-scrollbar-thumb:hover, .signature-result code::-webkit-scrollbar-thumb:hover { background: rgba(102, 126, 234, 0.5); } /* Responsive adjustments */ @media (max-width: 400px) { body { width: 350px; } .form-row { flex-direction: column; gap: 12px; } .button-group { flex-direction: column; } } /* Operation Tabs */ .operation-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid rgba(102, 126, 234, 0.1); gap: 4px; overflow-x: auto; /* Enable horizontal scrolling */ overflow-y: hidden; scrollbar-width: none; /* Hide scrollbar in Firefox */ -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */ scroll-behavior: smooth; /* Smooth scrolling animation */ } /* Hide scrollbar for webkit browsers */ .operation-tabs::-webkit-scrollbar { display: none; } .tab-btn { background: transparent; border: none; padding: 12px 20px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 3px solid transparent; flex-shrink: 0; /* Prevent tabs from shrinking */ min-width: fit-content; white-space: nowrap; text-align: center; } .tab-btn:hover { background: rgba(102, 126, 234, 0.1); color: var(--border-focus); } .tab-btn.active { background: rgba(102, 126, 234, 0.1); color: var(--border-focus); border-bottom-color: var(--border-focus); font-weight: 600; } .tab-content { display: none; } .tab-content.active { display: block; } /* Result Styling */ .encrypt-result, .decrypt-result, .verify-result { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid rgba(102, 126, 234, 0.2); } .encrypt-result { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1); } .encrypt-result label { color: var(--accent-success); font-weight: 600; margin-bottom: 12px; display: block; font-size: 14px; } .decrypt-result { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1); } .decrypt-result label { color: var(--accent-info); font-weight: 600; margin-bottom: 12px; display: block; font-size: 14px; } .verify-result { background: rgba(102, 126, 234, 0.1); border-color: rgba(102, 126, 234, 0.2); box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1); } .verification-status { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; } .verification-status.valid { color: var(--accent-success); } .verification-status.invalid { color: var(--accent-error); } .verification-status.valid #verificationIcon { color: var(--accent-success); } .verification-status.invalid #verificationIcon { color: var(--accent-error); }