/* ============================================================
   ICONS
   ============================================================ */

   .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 48px; height: 48px; }
.icon-hero { width: 64px; height: 64px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}
.btn-primary:hover {
    background: #33ddff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

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

.btn-danger {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 68, 102, 0.2);
}
.btn-danger:hover { background: rgba(255, 68, 102, 0.25); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-xs);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: scale(0);
    animation: rippleAnim 0.5s ease-out;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================================
   INPUTS
   ============================================================ */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace;
}
.input-group input,
.input-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}
.input-group input::placeholder,
.input-group textarea::placeholder { color: var(--text-dim); }
.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}

.input-password-wrap { position: relative; }
.input-password-wrap input { width: 100%; padding-right: 44px; }
.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.toggle-password:hover { color: var(--cyan); }
.toggle-password .icon { width: 18px; height: 18px; }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--cyan);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #000;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */

[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 100;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow);
    max-width: 360px;
    border: 1px solid transparent;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast .icon { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success {
    background: rgba(0, 204, 136, 0.15);
    color: var(--success);
    border-color: rgba(0, 204, 136, 0.2);
}
.toast.error {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
    border-color: rgba(255, 68, 102, 0.2);
}
.toast.info {
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyan);
    border-color: var(--border-cyan);
}

/* ============================================================
   CONNECTION BAR
   ============================================================ */

.connection-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 6px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    transition: transform 0.3s ease, opacity 0.3s;
    transform: translateY(-100%);
    opacity: 0;
}
.connection-bar.visible { transform: translateY(0); opacity: 1; }
.connection-bar.offline {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
    border-bottom: 1px solid rgba(255, 68, 102, 0.2);
}

/* ============================================================
   ACCOUNT CARD
   ============================================================ */

.account-card {
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.account-card p {
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.account-card p:last-child { margin-bottom: 0; }
.account-card strong { color: var(--text-secondary); font-weight: 500; min-width: 80px; }
.account-card .mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-dim); }
.copy-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}
.copy-btn:hover { color: var(--cyan); }
.copy-btn .icon { width: 14px; height: 14px; }

/* ============================================================
   SETTINGS ROWS
   ============================================================ */

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 14px; color: var(--text-primary); }
.settings-row-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ============================================================
   CONTEXT MENU
   ============================================================ */

.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    min-width: 180px;
    z-index: 3000;
    box-shadow: var(--shadow);
    display: none;
    animation: slideUp 0.12s ease;
}
.context-menu.visible { display: block; }

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background 0.12s;
    text-align: left;
}
.context-menu-item:hover { background: rgba(255,255,255,0.06); }
.context-menu-item .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.context-menu-item.context-menu-danger { color: var(--error); }
.context-menu-item.context-menu-danger .icon { color: var(--error); }