/* Browser App Styles */
.browser-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #f3f3f3;
    position: relative;
}

.browser-toolbar {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: #f2f2f2;
    border-bottom: 1px solid #d3d3d3;
    align-items: center;
    order: 2;
}

.browser-btn {
    padding: 4px 10px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #c6c6c6;
    border-radius: 2px;
    font-size: 13px;
    transition: all 0.2s ease;
    font-weight: normal;
}

.browser-btn:hover {
    background: #ededed;
    border-color: #bdbdbd;
}

.browser-btn:active {
    transform: none;
}

.nav-btn {
    width: 26px;
    height: 24px;
    padding: 0;
    min-width: 26px;
}

.address-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #bfbfbf;
    border-radius: 2px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.address-bar-wrap:focus-within {
    border-color: #4d90fe;
    box-shadow: 0 0 0 1px rgba(77, 144, 254, 0.4);
}

.address-bar {
    flex: 1;
    padding: 5px 8px;
    border: none;
    font-size: 13px;
    font-family: Arial, sans-serif;
    background: transparent;
    color: #333;
    outline: none;
}

.address-bookmark-btn {
    width: 24px;
    height: 22px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 14px;
    padding: 0 6px 0 4px;
}

.address-bookmark-btn.active {
    color: #f4b400;
}

.bookmark-menu-btn {
    margin-left: auto;
    width: 26px;
    height: 24px;
    padding: 0;
    min-width: 26px;
    font-size: 14px;
    line-height: 1;
}

.go-btn {
    padding: 4px 12px;
    background: #4d90fe;
    color: #fff;
    border-color: #3079ed;
}

.go-btn:hover {
    background: #357ae8;
    border-color: #2f5bb7;
}

.browser-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px 0 8px;
    background: #e8e8e8;
    border-bottom: 1px solid #cfcfcf;
    align-items: center;
    overflow-x: hidden;
    min-height: 32px;
    order: 1;
}

.new-tab-btn {
    flex: 0 0 auto;
    width: 28px;
    height: 24px;
    border: 1px solid #c4c4c4;
    background: #ededed;
    border-radius: 2px;
    font-size: 16px;
    line-height: 1;
    color: #333;
}

.new-tab-btn:hover {
    background: #e3e3e3;
}


.bookmark-menu {
    position: absolute;
    right: 10px;
    top: 66px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #c6c6c6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    display: none;
    z-index: 10;
    max-height: 260px;
    overflow: visible;
}

.bookmark-menu.show {
    display: block;
}

.bookmark-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    font-size: 12px;
    background: #fff;
    border: none;
    color: #333;
}

.bookmark-menu-item:hover {
    background: #f2f2f2;
}

.bookmark-menu-empty {
    padding: 8px 10px;
    font-size: 12px;
    color: #777;
}

.bookmark-menu-separator {
    height: 1px;
    background: #e2e2e2;
    margin: 4px 0;
}

.bookmark-menu-label {
    padding: 6px 10px 4px;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.bookmark-menu-flyout {
    position: relative;
}

.bookmark-menu-flyout-btn {
    display: flex;
    justify-content: space-between;
}

.bookmark-menu-flyout-panel {
    position: absolute;
    right: 100%;
    top: -4px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #c6c6c6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 11;
}

.bookmark-menu-flyout:hover .bookmark-menu-flyout-panel {
    display: block;
}

.browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #dcdcdc;
    border: 1px solid #c4c4c4;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    user-select: none;
    transition: all 0.2s ease;
    height: 28px;
    flex: 1 1 0;
    min-width: 80px;
    max-width: 220px;
}

.browser-tabs.tab-dragging .browser-tab {
    transition: transform 0.08s ease;
}

.browser-tab.dragging {
    opacity: 0.75;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.browser-tab.dragging {
    opacity: 0.6;
}

.browser-tab.drag-over {
    box-shadow: inset 0 0 0 2px #4d90fe;
}

.browser-tab:hover {
    background: #d2d2d2;
}

.browser-tab.active {
    background: #fdfdfd;
    border-color: #c4c4c4;
    border-bottom: 1px solid #fdfdfd;
    font-weight: normal;
}

.tab-title {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    flex: 1 1 auto;
}

.tab-close {
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: auto;
}

.tab-close:hover {
    background: rgba(242, 92, 92, 0.2);
    color: #c0392b;
}

.browser-viewport {
    flex: 1;
    overflow: hidden;
    background: #fff;
    order: 3;
    position: relative;
}

.page-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
    display: none;
}

.page-iframe.active {
    display: block;
}

/* About App Styles */
.about-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 24px;
    gap: 18px;
    color: #333;
    background: #f9f9f9;
}

.about-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.about-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.about-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.about-subtitle {
    font-size: 12px;
    color: #666;
}

.about-body {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 14px;
    display: grid;
    gap: 8px;
}

.about-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #444;
}

.about-footer {
    text-align: center;
    font-size: 11px;
    color: #777;
}

/* Aliases App Styles */
.aliases-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 15px;
    gap: 10px;
}

.aliases-search {
    display: flex;
    gap: 8px;
}

.aliases-search-input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

.aliases-search-input:focus {
    outline: none;
    border-color: #3a8ee6;
    box-shadow: 0 0 5px rgba(58, 142, 230, 0.5);
}

.aliases-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alias-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.alias-entry:hover {
    background: #f0f0f0;
    border-color: #3a8ee6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.alias-key {
    font-weight: 600;
    color: #3a8ee6;
    min-width: 100px;
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
}

.alias-details {
    flex: 1;
    min-width: 0;
}

.alias-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.alias-url {
    color: #666;
    font-size: 0.85rem;
    font-family: Arial, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alias-open-btn {
    padding: 6px 12px;
    background: #3a8ee6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.alias-open-btn:hover {
    background: #2f6ac3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Network App Styles */
.network-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    gap: 16px;
    background: #f9f9f9;
}

/* Settings App Styles */
.settings-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 18px;
    gap: 12px;
    background: #f5f6f8;
    color: #333;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
}

.settings-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.settings-title {
    font-size: 18px;
    font-weight: bold;
}

.settings-subtitle {
    font-size: 12px;
    color: #666;
}

.settings-version {
    font-size: 11px;
    color: #777;
    background: #f2f2f2;
    padding: 4px 8px;
    border-radius: 999px;
}

.settings-body {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    height: 100%;
    min-height: 0;
}

.settings-sidebar {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 8px;
    display: grid;
    gap: 6px;
    align-content: start;
}

.settings-nav {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    background: #f7f7f7;
    border: none;
    text-align: left;
}

.settings-nav.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: bold;
}

.settings-content {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 12px;
    overflow-y: auto;
    display: grid;
    gap: 14px;
    align-content: start;
}

.settings-section {
    display: none;
    gap: 8px;
    align-content: start;
}

.settings-section.active {
    display: grid;
}

.settings-section-title {
    font-size: 12px;
    color: #444;
    font-weight: bold;
}

.settings-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
}

.settings-card-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.settings-card-body {
    font-size: 12px;
    color: #666;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #444;
}

.settings-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.settings-switch-track {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #cfcfcf;
    transition: background 0.15s ease;
}

.settings-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.settings-switch.is-on .settings-switch-track {
    background: #1a73e8;
}

.settings-switch.is-on .settings-switch-track::after {
    transform: translateX(16px);
}

.settings-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #444;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 6px 8px;
}

.settings-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-actions-top {
    justify-content: flex-end;
}

.settings-button {
    border: 1px solid #d0d0d0;
    background: #f7f7f7;
    color: #333;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.settings-button.danger {
    border-color: #d13a3a;
    background: #fce8e8;
    color: #b3261e;
}

.settings-button.danger:hover {
    background: #f9d6d6;
}

.settings-button:hover {
    background: #ededed;
}

.settings-cookie-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.settings-storage-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.settings-cookie-item {
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 8px 10px;
    background: #fafafa;
    font-size: 12px;
    display: grid;
    gap: 4px;
}

.settings-storage-item {
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 8px 10px;
    background: #fafafa;
    font-size: 12px;
    display: grid;
    gap: 4px;
}

.settings-cookie-name {
    font-weight: bold;
    color: #333;
}

.settings-storage-name {
    font-weight: bold;
    color: #333;
}

.settings-cookie-value {
    color: #666;
    word-break: break-word;
}

.settings-storage-value {
    color: #666;
    word-break: break-word;
}

.server-panel {
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 16px;
    display: grid;
    gap: 10px;
}

.server-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
}

.server-subtitle {
    font-size: 12px;
    color: #666;
}

.server-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}

.server-metric {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    display: grid;
    gap: 4px;
}

.metric-label {
    font-size: 11px;
    color: #666;
}

.metric-value {
    font-size: 18px;
    font-weight: bold;
    color: #1a73e8;
}

.server-chart {
    display: grid;
    gap: 6px;
}

.chart-label {
    font-size: 11px;
    color: #666;
}

.chart-canvas {
    width: 100%;
    height: 70px;
    border: 1px solid #e3e3e3;
    background: #fafafa;
    border-radius: 4px;
}

/* Home App Styles */
.home-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 30px;
    background: white;
    gap: 20px;
}

.home-header {
    text-align: center;
}

.home-title {
    font-size: 32px;
    font-weight: bold;
    color: #3a8ee6;
    margin-bottom: 10px;
}

.home-subtitle {
    color: #666;
    font-size: 14px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    flex: 1;
}

.home-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.home-card:hover {
    background: #f0f0f0;
    border-color: #3a8ee6;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.home-card-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.home-card-description {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.home-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 12px;
}
