/* style.css - Ultra-fast, hardware-accelerated browser UI */

:root {
  /* Light theme - solid colors, no transparency */
  --bg-window: #ffffff;
  --bg-tabbar: #e8e8ed;
  --bg-tab-inactive: #d8d8dd;
  --bg-tab-active: #ffffff;
  --bg-navbar: #f5f5f7;
  --bg-button: transparent;
  --bg-button-hover: #e0e0e5;
  --bg-address: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-inactive: #3a3a3c;
  --accent: #0066cc;
  --border-light: #c6c6c8;
  --border-focus: #0066cc;
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark mode - solid dark colors, no transparency */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-window: #1c1c1e;
    --bg-tabbar: #2c2c2e;
    --bg-tab-inactive: #3a3a3c;
    --bg-tab-active: #1c1c1e;
    --bg-navbar: #2c2c2e;
    --bg-button-hover: #3a3a3c;
    --bg-address: #3a3a3c;
    --text-primary: #ffffff;
    --text-secondary: #98989e;
    --text-inactive: #8e8e93;
    --accent: #0a84ff;
    --border-light: #38383a;
    --border-focus: #0a84ff;
    --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* No background effects on body - solid color for performance */
body {
  overflow: hidden;
  height: 100vh;
  background: #000000; /* Solid black for contrast */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* Browser window - solid background, simple border */
.browser {
  width: 100%;
  height: 100%;
  background: var(--bg-window);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-small); /* Single lightweight shadow */
  transform: translateZ(0); /* GPU acceleration */
  will-change: transform;
}

/* macOS controls - absolutely positioned, no effects */
.window-controls {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none; /* Let clicks pass through */
}

.window-control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: auto; /* Re-enable clicks */
  cursor: pointer;
  transition: transform 0.1s ease; /* Only transform animation */
}

.window-control:hover {
  transform: scale(1.1);
}

.window-control.close { background: #ff5f57; border: 1px solid #e0443e; }
.window-control.minimize { background: #febc2e; border: 1px solid #e6a023; }
.window-control.maximize { background: #28c840; border: 1px solid #1fab2f; }

/* Tab bar - solid background, no blur */
.tab-bar {
  display: flex;
  align-items: center;
  padding: 6px 6px 0 80px; /* Space for window controls */
  background: var(--bg-tabbar);
  height: 44px;
  border-bottom: 1px solid var(--border-light);
}

.tabs-container {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  height: 38px;
  align-items: center;
  gap: 2px;
  scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
  display: none;
}

/* Simple tab design - minimal styles, no shadows */
.tab {
  display: flex;
  align-items: center;
  min-width: 120px;
  max-width: 180px;
  height: 32px;
  background: var(--bg-tab-inactive);
  border: 1px solid var(--border-light);
  border-radius: 8px 8px 0 0;
  padding: 0 6px 0 10px;
  cursor: pointer;
  color: var(--text-inactive);
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
  border-bottom: none;
  transition: background 0.1s ease, color 0.1s ease; /* Only color transitions */
  transform: translateZ(0);
}

.tab:hover {
  background: var(--bg-tab-active);
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-tab-active);
  color: var(--text-primary);
  border-bottom: 1px solid var(--bg-tab-active);
  margin-bottom: -1px;
  font-weight: 600;
}

.tab-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Simple close button */
.tab-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  opacity: 0.7;
}

.tab-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  opacity: 1;
}

/* New tab button - simple */
.new-tab-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, border-color 0.1s ease;
  margin-left: 2px;
}

.new-tab-btn:hover {
  background: var(--bg-tab-active);
  border-color: var(--accent);
  color: var(--accent);
}

/* Navigation bar - solid */
.nav-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-navbar);
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  height: 52px;
}

/* Navigation buttons */
.nav-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg-button);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  flex-shrink: 0;
}

.nav-btn:hover:not(:disabled) {
  background: var(--bg-button-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Simple address bar - solid, no effects */
.address-bar {
  flex: 1;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background: var(--bg-address);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.1s ease; /* Only border transitions */
  min-width: 0; /* Prevent flex overflow */
}

.address-bar:focus {
  border-color: var(--accent);
}

.address-bar::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Webview container - simple */
.webview-container {
  flex: 1;
  background: var(--bg-window);
  position: relative;
  overflow: hidden;
}

/* Webview - simple display */
webview {
  display: none;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

webview.active {
  display: flex;
}

/* Ultra-minimal loading indicator - optional, very light */
.tab.loading .tab-title::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border: 1px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .tab {
    min-width: 100px;
  }
  .window-controls {
    padding: 10px 12px;
  }
  .tab-bar {
    padding-left: 70px;
  }
}