:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent-cyan: #0284c7; /* Sky blue */
  --accent-purple: #7c3aed; /* Violet */
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-height: 90px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Container */
.browser-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

/* Header Section */
.browser-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.nav-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: #f1f5f9;
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Address Bar */
.address-bar-container {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 12px;
  flex-grow: 1;
  gap: 8px;
  transition: border-color 0.2s, background-color 0.2s;
}

.address-bar-container:focus-within {
  border-color: var(--accent-cyan);
  background: #ffffff;
}

.secure-icon {
  color: var(--accent-green);
  display: flex;
  align-items: center;
}

#address-input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  width: 100%;
  outline: none;
}

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

.tab-indicator-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 12px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Viewport & Web Pages */
.browser-viewport {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.web-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: scale(0.98);
  padding: 16px;
  background: #f8fafc;
}

.web-page.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Custom Scrollbars */
.web-page::-webkit-scrollbar {
  width: 6px;
}
.web-page::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.03);
}
.web-page::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
}

/* Search Homepage layout */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80%;
  padding-top: 20px;
  text-align: center;
}

.brand-logo {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.logo-orbit {
  color: var(--text-primary);
}

.logo-search {
  color: var(--accent-cyan);
  text-shadow: 0 2px 10px rgba(2, 132, 199, 0.2);
}

.search-box {
  width: 100%;
  max-width: 450px;
  display: flex;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 28px;
  padding: 6px 16px;
  margin-bottom: 30px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.15);
}

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 16px;
  outline: none;
  font-family: var(--font-family);
}

.search-box button {
  background: none;
  border: none;
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Quick Links grid */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 450px;
  margin-bottom: 35px;
}

.quick-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.quick-link-item:active {
  transform: scale(0.9);
}

.link-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.quick-link-item:hover .link-icon {
  background: #f1f5f9;
  border-color: var(--accent-cyan);
}

.link-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Discover section */
.discover-section {
  width: 100%;
  max-width: 450px;
  text-align: left;
}

.discover-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.discover-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.discover-card:active {
  transform: scale(0.98);
}

.discover-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.discover-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.discover-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Search results styles */
.results-container {
  max-width: 600px;
  margin: 0 auto;
}

.results-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.search-result-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.search-result-card h4 {
  color: var(--accent-cyan);
  font-size: 16px;
  margin-bottom: 4px;
}

.search-result-card .result-url {
  font-size: 11px;
  color: var(--accent-green);
  margin-bottom: 6px;
  display: block;
}

.search-result-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Simulated site common styles */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.network-badge {
  font-size: 11px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--accent-green);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* OrbitSwap DEX Styles */
.swap-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.swap-input-group {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-row input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  width: 60%;
  outline: none;
  font-family: var(--font-family);
}

.input-row select {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: var(--font-family);
  font-weight: 600;
  outline: none;
}

.swap-divider {
  display: flex;
  justify-content: center;
  margin: -10px 0;
  position: relative;
  z-index: 2;
}

.reverse-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}

.reverse-btn:active {
  transform: rotate(180deg);
}

.swap-details {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.action-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: transform 0.1s;
}

.action-btn:active {
  transform: scale(0.98);
}

.swap-chart {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
}

.price-up {
  color: var(--accent-green);
}

.svg-chart-container {
  width: 100%;
  height: 150px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

/* OrbitAI Chat Styles */
.ai-container {
  display: flex;
  flex-direction: column;
  height: 98%;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.status-indicator {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-indicator::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.ai-chat-history {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.chat-message.bot {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-message.user {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.message-time {
  font-size: 9px;
  color: var(--text-secondary);
  align-self: flex-end;
  margin-top: 4px;
}

.ai-input-row {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 12px 6px 16px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.ai-input-row input {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  font-family: var(--font-family);
  font-size: 14px;
}

.ai-input-row button {
  background: var(--accent-cyan);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* OrbitMarket Tickers Styles */
.market-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.ticker-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.ticker-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.ticker-name {
  font-weight: 600;
  display: block;
}

.ticker-symbol {
  font-size: 11px;
  color: var(--text-secondary);
}

.ticker-price {
  font-weight: 700;
  display: block;
  text-align: right;
}

.ticker-pct {
  font-size: 12px;
  font-weight: 600;
  display: block;
  text-align: right;
}

.ticker-card.positive .ticker-pct {
  color: var(--accent-green);
}

.ticker-card.negative .ticker-pct {
  color: var(--accent-red);
}

.market-depth {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.market-depth h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

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

.depth-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
}

.depth-tx-in {
  color: var(--accent-green);
}

.depth-tx-out {
  color: var(--accent-cyan);
}

/* MemeHub Feed */
.meme-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meme-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.meme-image-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #bae6fd, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
}

.meme-emoji-large {
  font-size: 50px;
  animation: pulse-emoji 2s infinite ease-in-out;
}

.meme-caption {
  padding: 14px;
}

.meme-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.meme-author {
  font-size: 11px;
  color: var(--text-secondary);
}

.meme-actions {
  display: flex;
  border-top: 1px solid var(--border-color);
  padding: 10px 14px;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.meme-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

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

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  width: 100%;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
  box-shadow: 0 -5px 25px rgba(0,0,0,0.08);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.close-btn {
  background: #f1f5f9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.action-btn-small {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 12px;
  cursor: pointer;
}

.tab-list, .bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.modal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.modal-item:hover {
  background: #f1f5f9;
}

.delete-item-btn {
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 14px;
}

.active-border {
  border-color: var(--accent-cyan);
}

/* Animations */
@keyframes pulse-emoji {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
