:root {
    --primary: rgb(0, 20, 36);
    --secondary: rgb(255, 255, 255);
    --font: rgb(255, 255, 255);
    --accent: rgb(0, 153, 255);
    --dark-bg: var(--primary);
    --control-bg: rgba(0, 20, 36, 0.7);
    --control-hover: rgba(0, 153, 255, 0.3);
    --control-active: rgba(0, 153, 255, 0.5);
    --control-radius: 12px;
    --url-bar-bg: rgba(0, 20, 36, 0.7);
    --icon-color: var(--accent);
    --backdrop-blur: 10px;
    --transition-speed: 0.3s;
    --search-glow: 0 0 15px rgba(0, 153, 255, 0.5);
    --control-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --ripple-color: rgba(0, 153, 255, 0.5);
    --sidebar-width: 200px;
    --nav-height: 25px;
    --tab-height: 32px;
    --accent-glow: 0 0 20px rgba(0, 153, 255, 0.2);
}

@font-face {
    font-family: "font";
    src: url("../fonts/font.otf");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "font", sans-serif;
}

body {
    background-color: var(--primary);
    color: var(--font);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    margin: 0;
    padding: 0;
}

body::before {
    display: none;
}

.browser-container {
    flex: 1;
    height: 100vh;
    padding: 15px 15px 15px 0;
    margin-left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--primary);
}

.browser-container.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.top-nav {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    background-color: var(--control-bg);
    border-radius: 12px;
    backdrop-filter: blur(var(--backdrop-blur));
    box-shadow: none;
    width: 100%;
    height: var(--nav-height);
    min-height: var(--nav-height);
    border: none;
}

@keyframes slideInDown {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.horizontal-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.vertical-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: none;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group.vertical {
    flex-direction: column;
    padding: 12px 6px;
    background-color: var(--control-bg);
    border-radius: var(--control-radius);
    box-shadow: var(--control-shadow);
}

.control-button {
    background: transparent;
    border: none;
    color: var(--icon-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed),
        transform var(--transition-speed),
        color var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.control-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.5s, height 0.5s, opacity 0.5s;
    z-index: -1;
}

.control-button:hover {
    background-color: var(--control-hover);
    transform: scale(1.1);
}

.control-button:hover::before {
    width: 120%;
    height: 120%;
    opacity: 0.1;
}

.control-button:active {
    background-color: var(--control-active);
    transform: scale(0.95);
}

.control-button svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-speed);
}

.control-button:hover svg {
    transform: scale(1.1);
}

.url-bar-container {
    flex: 1;
    height: 45px;
    min-height: 45px;
    margin: 0 15px;
    display: flex;
    align-items: center;
}

#url-bar {
    width: 100%;
    height: 75%;
    background-color: rgba(0, 40, 70, 0.8);
    color: var(--font);
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    backdrop-filter: blur(var(--backdrop-blur));
}

#url-bar:focus {
    border-color: var(--accent);
}

.iframe-container {
    flex: 1;
    width: 100%;
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary);
    position: relative;
}

.browser-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--primary);
}

@media (max-width: 768px) {
    .top-nav {
        padding: 6px 10px;
    }

    .control-button {
        width: 36px;
        height: 36px;
    }

    .control-button svg {
        width: 18px;
        height: 18px;
    }

    #url-bar {
        height: 40px;
        font-size: 14px;
    }
}

.ripple {
    position: absolute;
    background-color: var(--ripple-color);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: translateX(-100%);
    animation: loading 1.5s infinite ease-in-out;
    opacity: 0;
    z-index: 1000;
}

.browser-container.loading .loading-indicator {
    opacity: 1;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: var(--font);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    backdrop-filter: blur(var(--backdrop-blur));
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Collapsible sidebar styles */
.tab-sidebar {
    transition: transform var(--transition-speed) ease;
}

.tab-sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-toggle {
    position: fixed;
    bottom: 15px;
    left: 15px;
    background: var(--control-bg);
    border: 2px solid var(--accent);
    color: var(--accent);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed),
        transform var(--transition-speed);
    z-index: 1001;
    box-shadow: 0 0 10px rgba(0, 153, 255, 0.5);
}

.sidebar-toggle:hover {
    background: var(--control-hover);
    transform: scale(1.1);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-speed);
}

.tab-sidebar.collapsed+.browser-container .sidebar-toggle svg {
    transform: rotate(180deg);
}

.browser-container {
    transition: margin-left var(--transition-speed) ease;
    margin-left: var(--sidebar-width);
}

.browser-container.sidebar-collapsed {
    margin-left: 0;
}

.tab-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border-bottom: none;
    height: calc(var(--nav-height) + 30px);
}

.tab-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tab-logo {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 5px rgba(0, 153, 255, 0.2));
}

.tab-header-text {
    color: var(--font);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.new-tab-button {
    background: rgba(0, 153, 255, 0.1);
    border: none;
    color: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-tab-button:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.tabs-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.tab {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    gap: 10px;
}

.tab:hover {
    background: rgba(0, 153, 255, 0.08);
    transform: translateX(4px);
}

.tab.active {
    background: rgba(0, 153, 255, 0.12);
}

.tab-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.tab-title {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--font);
    opacity: 0.9;
}

.tab-close {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--font);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover .tab-close {
    opacity: 0.7;
}

.tab-close:hover {
    background: rgba(255, 59, 59, 0.15);
    color: #ff4444;
    opacity: 1;
}

.tabs-container::-webkit-scrollbar {
    width: 8px;
}

.tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: var(--control-hover);
}

/* Add this to your existing sidebar-related CSS */
.browser-container {
    transition: margin-left var(--transition-speed) ease, width var(--transition-speed) ease;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.browser-container.sidebar-collapsed {
    margin-left: 0;
    width: 100%;
}

/* Make sure the iframe container expands properly */
.iframe-container {
    flex: 1;
    width: 100%;
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--primary);
    position: relative;
    transition: width var(--transition-speed) ease;
    margin-left: 7px;
}

/* URL bar container should expand smoothly */
.url-bar-container {
    flex: 1;
    height: 45px;
    min-height: 45px;
    margin: 0 15px;
    display: flex;
    align-items: center;
    transition: width var(--transition-speed) ease;
}

/* Top navigation should adjust properly */
.top-nav {
    width: 100%;
    transition: width var(--transition-speed) ease;
}

/* Control buttons area should expand smoothly */
.control-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    transition: width var(--transition-speed) ease;
}

.tab {
    cursor: grab;
    transition: background-color 0.2s, transform 0.2s;
    position: relative;
    user-select: none;
}

.tab.dragging {
    opacity: 0.7;
    background-color: rgba(0, 0, 0, 0.05);
    cursor: grabbing;
}

.tab.drag-over {
    background-color: rgba(66, 133, 244, 0.1);
}

/* Drop indicators */
.tab.drop-above {
    border-top: 2px solid #4285f4;
}

.tab.drop-below {
    border-bottom: 2px solid #4285f4;
}

/* Ensure the tab being dragged is visible above others */
.tab.dragging {
    z-index: 10;
}

/* Subtle hover effect */
.tab:hover:not(.dragging) {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Active tab styling */
.tab.active {
    background-color: rgba(66, 133, 244, 0.1);
    border-left: 3px solid #4285f4;
}