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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  background: #1a1a1a;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Title Bar */
.titlebar {
  height: 40px;
  background: rgba(30, 30, 30, 0.95);
  -webkit-app-region: drag;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
}

.titlebar-drag-region {
  flex: 1;
  height: 100%;
}

.titlebar-controls {
  -webkit-app-region: no-drag;
  display: flex;
  gap: 8px;
  order: -1;
}

.titlebar-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0;
}

.titlebar-button svg {
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 6px;
  height: 6px;
}

.titlebar:hover .titlebar-button svg {
  opacity: 1;
}

.titlebar-button.close {
  background: #ff5f57;
}

.titlebar-button.close:hover {
  background: #ff4842;
}

.titlebar-button.close svg path {
  stroke: #8b0000;
}

.titlebar-button.minimize {
  background: #febc2e;
}

.titlebar-button.minimize:hover {
  background: #ffb000;
}

.titlebar-button.minimize svg path {
  stroke: #8b6914;
}

.titlebar-button.maximize {
  background: #28c840;
}

.titlebar-button.maximize:hover {
  background: #1fa832;
}

.titlebar-button.maximize svg rect {
  stroke: #0f5d1a;
}

/* Navigation Bar */
.navbar {
  height: 50px;
  background: rgba(40, 40, 40, 0.95);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
}

.nav-controls {
  display: flex;
  gap: 8px;
}

.nav-button {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.nav-button:active:not(:disabled) {
  transform: scale(0.95);
}

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

.nav-button.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* URL Bar */
.url-bar-container {
  flex: 1;
  max-width: 800px;
}

.url-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.url-bar:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(100, 150, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.1);
}

.lock-icon {
  color: #4caf50;
  margin-right: 8px;
  flex-shrink: 0;
}

#url-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#url-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.go-button {
  margin-left: 8px;
  padding: 4px 12px;
  background: rgba(100, 150, 255, 0.2);
  color: #6096ff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.go-button:hover {
  background: rgba(100, 150, 255, 0.3);
  transform: scale(1.05);
}

.go-button:active {
  transform: scale(0.95);
}

/* Sidebar Toggle */
.sidebar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.sidebar-toggle.active {
  background: rgba(100, 150, 255, 0.2);
  color: #6096ff;
}

/* Main Container */
.main-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.browser-container {
  flex: 1;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.browser-container.sidebar-visible {
  flex: 1;
}

#browser-view {
  width: 100%;
  height: 100%;
  border: none;
}

/* Sidebar */
.sidebar {
  width: 420px;
  background: rgba(25, 25, 25, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
}

.sidebar.visible {
  transform: translateX(0);
}

.sidebar-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(30, 30, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.3px;
}

.sidebar-close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-close:hover {
  background: rgba(255, 95, 87, 0.2);
  color: #ff5f57;
  transform: scale(1.05);
}

.sidebar-close:active {
  transform: scale(0.95);
}

#claude-view {
  flex: 1;
  border: none;
  background: #1a1a1a;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Smooth transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

button, input {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Loading animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}
