/* AUTHONOS - Sovereign Commerce Infrastructure */
/* Where merchants own their fucking destiny */

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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    --background-dark: #0a0a0a;
    --surface-dark: rgba(17, 17, 17, 0.5);
    --surface-light: rgba(26, 26, 46, 0.6);
    --border-color: rgba(102, 126, 234, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);`
    
    --bg-primary: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    --bg-secondary: rgba(26, 26, 46, 0.9);
    --bg-tertiary: rgba(26, 26, 46, 0.6);
    --bg-card: rgba(26, 26, 46, 0.4);
    --border-color: rgba(102, 126, 234, 0.2);
    --border-hover: rgba(102, 126, 234, 0.4);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-muted: #888;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
}

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background with subtle gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(240, 147, 251, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}









/* Header Updates */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.header-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.header-icon-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.header-icon-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

/* Navigation Icons */
.nav-item i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Relay Monitor Styles */
.relay-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.monitor-card {
    background: rgba(20, 20, 35, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

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

.monitor-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitor-card h3 i {
    opacity: 0.7;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.status-indicator.online {
    color: #10b981;
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.monitor-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.detail-row code {
    font-family: 'SF Mono', monospace;
    font-size: 0.9rem;
    color: #667eea;
}

/* Event Stream */
.event-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.filter-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.event-stream {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    font-family: 'SF Mono', monospace;
    font-size: 0.85rem;
}

.event-item {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideIn 0.3s ease;
}

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

/* NIP Support */
.nip-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.nip-item.supported {
    color: #10b981;
}

.nip-item.planned {
    color: #f59e0b;
    opacity: 0.7;
}

/* Connections List */
.connections-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.connection-pubkey {
    flex: 1;
    font-family: 'SF Mono', monospace;
    font-size: 0.875rem;
}

.connection-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Relay Stats Grid */
.relay-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    text-align: center;
}

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

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}














/* Header - Clean and Premium */
.header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-transform: uppercase;
}

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


/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

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

/* Navigation - Smooth and Modern */
.main-nav {
    background: var(--surface-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(42, 42, 62, 0.3);
    position: sticky;
    top: 83px;
    z-index: 999;
    padding: 0 2rem;
}

.nav-items {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-items::-webkit-scrollbar {
    display: none;
}

.nav-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.7;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.nav-item:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.05);
}

.nav-item.active {
    opacity: 1;
    color: var(--text-primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: scaleX(0);
        opacity: 0;
    }
    to { 
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Main Content Areas */
.main-content {
    animation: fadeInUp 0.4s ease;
}

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

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

.content-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats Grid - Premium Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s;
}
.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  border-color: var(--border-hover);
}


.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--secondary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.2);
        transform: scale(1.02);
    }
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Forms - Clean and Modern */
.form-group {
    margin-bottom: 1.5rem;
}


.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(10, 10, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(10, 10, 20, 0.8);
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 4px 12px rgba(102, 126, 234, 0.1);
}

.form-input[readonly] {
    opacity: 0.8;
    cursor: default;
    background: rgba(10, 10, 20, 0.3);
}

/* Buttons - Juicy and Interactive */
.btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    letter-spacing: 0.2px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.3),
        0 4px 8px rgba(118, 75, 162, 0.2);
}

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

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

/* Chat/Messages Interface */
.chat-container-enhanced {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 1rem;
    height: calc(100vh - 220px);
    background: rgba(17, 17, 17, 0.3);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chat-sidebar {
    background: rgba(20, 20, 35, 0.4);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-search {
    padding: 1rem;
    border-bottom: 1px solid rgba(42, 42, 62, 0.2);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.2) transparent;
}

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.3);
}

.chat-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(42, 42, 62, 0.1);
    cursor: pointer;
    display: flex;
    gap: 1rem;
    transition: all 0.2s ease;
}

.chat-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.chat-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-left: 2px solid #667eea;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.chat-preview {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.chat-last-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

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

.chat-unread {
    background: var(--primary-gradient);
    color: white;
    border-radius: 10px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Chat Main Area */
.chat-main {
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 20, 0.3);
}

.chat-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(20, 20, 35, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.5;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: grayscale(50%);
}

.chat-input-container {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(20, 20, 35, 0.3);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 20, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: all 0.2s ease;
}

.message-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(10, 10, 20, 0.8);
}

.send-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
}

.chat-input-info {
    margin-top: 0.5rem;
    text-align: center;
}

.chat-input-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Settings Cards */
.settings-card {
    background: rgba(20, 20, 35, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.settings-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
}

.settings-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .chat-container-enhanced {
        grid-template-columns: 280px 1fr;
    }
    
    .chat-context {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-container-enhanced {
        grid-template-columns: 1fr;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .nav-items {
        padding: 0 1rem;
    }
    
    .nav-item {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-small {
    font-size: 0.875rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* Selection Colors */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}








/* Settings Page Enhancements */
.settings-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: rgba(20, 20, 35, 0.3);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.settings-nav::-webkit-scrollbar {
    display: none;
}

.settings-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.settings-tab:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--text-primary);
}

.settings-tab.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.settings-panel {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.settings-panel.active {
    display: block;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-addon {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Fix Toggle Switches */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-input:checked ~ .toggle-switch {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-input:checked ~ .toggle-switch::after {
    transform: translateX(24px);
}

/* Make toggle text not wrap */
.toggle-label span:last-child {
    white-space: nowrap;
}

/* Relay List */
.relay-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.relay-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(10, 10, 20, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.relay-item:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.relay-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.relay-status.connected {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.relay-status.disconnected {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.relay-url {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
}

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

/* Danger Zone */
.danger-zone {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.03);
}

.danger-zone h3 {
    color: #ef4444;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    margin-right: 0.5rem;
}

.btn-danger:hover {
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Mini Stats */
.stat-mini {
    display: inline-flex;
    flex-direction: column;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    margin-right: 1rem;
}

.stat-mini .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-mini .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}



/*** Animation ***/
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* settings.js */

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.form-input.mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9rem;
}

.relay-latency {
    color: #10b981;
    font-size: 0.875rem;
    margin-left: auto;
    margin-right: 1rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}









/* Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.profile-sidebar {
    position: sticky;
    top: 140px;
    height: fit-content;
}

.profile-card {
    background: rgba(20, 20, 35, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.profile-avatar-large {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.change-avatar-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid var(--border-color);
}

.profile-info-card {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.profile-nip05 {
    color: #667eea;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.profile-stats-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-stat {
    text-align: center;
}

.profile-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.profile-stat .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-save-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        position: static;
    }
}





.event-item {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideIn 0.3s ease;
}

.event-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.event-kind {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-kind.kind-0 {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.event-kind.kind-1 {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

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

.event-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.event-pubkey {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'SF Mono', monospace;
}





/* Relay Manager Section */
.relay-manager-header {
    margin-bottom: 30px;
}

.relay-manager-header h1 {
    font-size: 28px;
    color: #fff;
    margin-bottom: 10px;
}

.relay-manager-header p {
    color: #888;
    font-size: 14px;
}

.relay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.relay-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 24px;
}

.relay-card h3 {
    color: #8b5cf6;
    font-size: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.relay-info {
    space-y: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #999;
    font-size: 14px;
}

.relay-url {
    color: #8b5cf6;
    font-family: monospace;
}

.relay-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 12px;
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.relay-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

#relay-list {
    max-height: 300px;
    overflow-y: auto;
}

.relay-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 8px;
}

.relay-item span {
    color: #ccc;
    font-size: 14px;
    font-family: monospace;
}

.btn-remove {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.3);
}

.default-label {
    color: #666;
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}







/* Contacts Page Layout */

.contacts-toolbar {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
}

.search-bar {
    flex: 1;
}

.search-bar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-buttons .btn {
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.filter-buttons .btn.active {
    background: rgba(139, 92, 246, 0.3);
}

.contacts-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.mini-stat .value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #8b5cf6;
    margin-bottom: 8px;
}

.mini-stat .label {
    display: block;
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.contact-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

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

.contact-pubkey {
    font-family: monospace;
    color: #fff;
    margin-bottom: 5px;
}

.contact-meta {
    font-size: 13px;
    color: #888;
}

/* Modal fixes */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #1a1a2e;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}








/* Review Management Styles */

.review-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #8b5cf6;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.review-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(139, 92, 246, 0.2);
}

.filter-btn.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
}

.filter-slider {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-slider label {
    color: #aaa;
    font-size: 14px;
}

.filter-slider input[type="range"] {
    width: 150px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.review-card.filtered {
    opacity: 0.5;
    border-color: rgba(255, 0, 0, 0.3);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-pubkey {
    font-family: monospace;
    color: #aaa;
}

.verified-badge,
.purchase-badge {
    padding: 3px 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 4px;
    font-size: 11px;
    color: #4ade80;
}

.review-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    color: #888;
    font-size: 13px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
}

.trust-score {
    color: #8b5cf6;
}

.review-rating {
    font-size: 24px;
    margin: 15px 0;
    color: #fbbf24;
}

.review-content {
    color: #e5e5e5;
    line-height: 1.6;
    margin: 15px 0;
}

.merchant-response {
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid #8b5cf6;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.review-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.warning {
    color: #f59e0b;
    font-size: 12px;
    margin-left: auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 18px;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: rgba(139, 92, 246, 0.2);
    height: 4px;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #8b5cf6;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    margin-top: -6px;
}

input[type="range"]::-moz-range-track {
    background: rgba(139, 92, 246, 0.2);
    height: 4px;
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    background: #8b5cf6;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    border: none;
}