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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

.browser-window {
    width: 100vw;
    height: 100vh;
    background: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

.browser-header {
    transition: transform 0.3s ease-in-out;
}

.browser-header.fullscreen-hidden {
    transform: translateY(-100%);
}

.fullscreen-toggle {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 0 0 4px 4px;
    z-index: 3000;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.fullscreen-toggle.visible {
    opacity: 1;
}

.fullscreen-toggle:hover {
    background: rgba(255,255,255,0.6);
    height: 12px;
}

.title-bar {
    height: 32px;
    background: linear-gradient(to bottom, #e8e8e8, #d0d0d0);
    border-bottom: 1px solid #aaa;
    display: flex;
    align-items: center;
    padding: 0 10px;
    justify-content: space-between;
}

.window-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #999;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn { background: linear-gradient(to bottom, #ff5f57, #ff3b30); }
.minimize-btn { background: linear-gradient(to bottom, #ffbd2e, #ff9500); }
.maximize-btn { background: linear-gradient(to bottom, #28cd41, #28a745); }

.toolbar {
    height: 50px;
    background: linear-gradient(to bottom, #f5f5f5, #e5e5e5);
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #aaa;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: linear-gradient(to bottom, #fff, #f0f0f0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

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

.address-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #aaa;
    border-radius: 20px;
    padding: 0 12px;
    height: 36px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.address-bar {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.security-icon {
    color: #28a745;
    margin-right: 8px;
}

.menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #aaa;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    position: relative;
    transition: all 0.2s;
}

.menu-btn:hover {
    background: linear-gradient(to bottom, #fff, #f0f0f0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.tab-bar {
    height: 40px;
    background: linear-gradient(to bottom, #e8e8e8, #d8d8d8);
    border-bottom: 1px solid #bbb;
    display: flex;
    align-items: flex-end;
    padding: 0 10px;
    overflow-x: auto;
}

.tab {
    min-width: 180px;
    max-width: 240px;
    height: 32px;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    border: 1px solid #aaa;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    margin-right: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    border-bottom: 1px solid white;
    z-index: 1;
    margin-bottom: -1px;
}

.tab-favicon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 2px;
}

.tab-title {
    flex: 1;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    cursor: pointer;
}

.tab-close:hover {
    background: #ff5f57;
    color: white;
}

.new-tab-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #aaa;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    margin-left: 5px;
}

.new-tab-btn:hover {
    background: linear-gradient(to bottom, #fff, #f0f0f0);
}

.content-area {
    flex: 1;
    background: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.webpage-frame {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease-in-out;
}

.fullscreen .content-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
}

.fullscreen .webpage-frame {
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: #4285f4;
    transition: width 0.3s;
    z-index: 1000;
}

.status-bar {
    height: 24px;
    background: linear-gradient(to bottom, #e8e8e8, #d8d8d8);
    border-top: 1px solid #bbb;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    color: #666;
}

.status-bar-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.open-in-tab-btn {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #aaa;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    cursor: pointer;
    font-size: 11px;
    color: #333;
    transition: all 0.2s;
    display: none;
}

.open-in-tab-btn:hover {
    background: linear-gradient(to bottom, #fff, #f0f0f0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.open-in-tab-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 2000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.menu-icon {
    font-size: 16px;
}

.fullscreen-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2000;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
}

.history-panel {
    position: absolute;
    left: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background: #f8f8f8;
    border-right: 1px solid #ddd;
    transition: left 0.3s;
    z-index: 1500;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

.history-panel.open {
    left: 0;
}

.history-header {
    padding: 15px;
    background: #e8e8e8;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.history-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.history-item:hover {
    background: #e8e8e8;
}

.history-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.history-url {
    color: #666;
    margin-bottom: 4px;
    word-break: break-all;
}

.history-time {
    color: #999;
    font-size: 10px;
}

.bookmarks-panel, .settings-panel {
    position: absolute;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100%;
    background: #f8f8f8;
    border-left: 1px solid #ddd;
    transition: right 0.3s;
    z-index: 1500;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
}

.bookmarks-panel.open, .settings-panel.open {
    right: 0;
}

.panel-header {
    padding: 15px;
    background: #e8e8e8;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.bookmark-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.bookmark-item:hover {
    background: #e8e8e8;
}

.bookmark-favicon {
    font-size: 16px;
}

.bookmark-info {
    flex: 1;
}

.bookmark-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.bookmark-url {
    font-size: 11px;
    color: #666;
}

.settings-group {
    margin: 20px 15px;
}

.settings-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.settings-label {
    font-size: 12px;
}

.settings-toggle {
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.settings-toggle.active {
    background: #4285f4;
}

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

.settings-toggle.active::after {
    left: 22px;
}

.three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
}

.fullscreen .browser-window {
    border-radius: 0;
    box-shadow: none;
}

.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}
