input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

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

html, body {
    height: 100%;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--main);
    overflow: hidden;
}

/* topbar */

#topbar {
    height: 100px;
    width: 100%;
    background-color: var(--main);
    color: var(--text-normal);
    display: flex;
    padding: 0 15px;
    flex-direction: row;
}

#topbar-logo {
    width: 75px;
    height: 75px;
    display: flex;
    align-self: center;
    margin-right: 10px;
    user-select: none;
}

/* tabs */

#tab-row {
    background-color: var(--main-dark);
    border-bottom-left-radius: 20px;
    height: 40%;
    width: 100%;
    display: flex;
    align-items: center;
    padding-left: 5px;
    gap: 6px;
}

@keyframes tab-in {
    from { max-width: 0; padding-left: 0; padding-right: 0; opacity: 0; }
    to   { max-width: 200px; padding-left: 2px; padding-right: 5px; opacity: 1; }
}

@keyframes tab-out {
    from { max-width: 200px; padding-left: 2px; padding-right: 5px; opacity: 1; }
    to   { max-width: 0; padding-left: 0; padding-right: 0; opacity: 0; }
}

.tab-div {
    display: flex;
    width: 100%;
    height: 75%;
    max-width: 200px;
    min-width: 0;
    border-radius: var(--br10px);
    background-color: var(--main-dark);
    align-items: center;
    padding-right: 5px;
    padding-left: 2px;
    font-family: var(--comfortaa);
    gap: 10px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.tab-div::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 80%;
    right: -4px;
    border-radius: 1px;
    background-color: var(--separator);
    z-index: 100;
}

.tab-div.new {
    animation: tab-in 0.3s cubic-bezier(.71,.08,.54,.87);
}

.tab-div.removing {
    animation: tab-out 0.3s cubic-bezier(.71,.08,.54,.87);
    pointer-events: none;
}

.tab-div.active {
    position: relative;
    background-color: var(--tab-bg-active);
}

.tab-div.active:hover {
    background-color: var(--tab-bg-active);
}

.tab-div.active::after {
    content: "";
    position: absolute;
    bottom: -3px;
    height: 2px;
    width: 96%;
    transform: translateX(50%);
    background-image: var(--tab-accent);
    border-radius: var(--br1px);
    padding-left: 0;
    padding-right: 0;
    left: 50%;
    transform: translateX(-50%)
}

.tab-div.active::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 80%;
    right: -4px;
    border-radius: 1px;
    background-color: var(--separator);
    z-index: 100;
}

.tab-div:hover {
    background-color: var(--tab-bg-hover);
}

#tab-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabs > img {
    height: 28px;
    width: 28px;
    min-width: 28px;
    border-radius: var(--br5px);
}

.tab-close-btn {
    margin-left: auto;
    width: 20px;
    height: 20px;
    aspect-ratio: 1/1;
    border-radius: var(--br10px);
    font-size: 20px;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    background-color: transparent;
    transition: background 0.3s ease;
    color: var(--text-normal)
}

.tab-close-btn:hover {
    background-color: var(--tab-close-hover)
}

.new-tab {
    height: 75%;
    aspect-ratio: 1/1;
    border: none;
    border-radius: var(--br10px);
    color: var(--text-normal);
    font-size: 20px;
    background-color: transparent;
    transition: background 0.3s ease;
    cursor: pointer;
}

.new-tab:hover {
    background-color: var(--button-hover);
}

#nav-row {
    display: flex;
    align-items: center;
    padding-bottom: 6px;
    padding-right: 6px;
    gap: 8px;
    height: 50%;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--br100prc);
    height: 90%;
    aspect-ratio: 1/1;
    transition: background 0.3s ease;
    justify-content: center;
    align-items: center;
    align-content: center;
    user-select: none;
    padding-top: 3px;
    overflow: none;
}

.nav-btn:hover {
    background: var(--button-hover);
}

.navbtn-svg {
    stroke: var(--button-color)
}

#url-bar-display {
    flex: 100;
    background-color: var(--main-dark);
    border-radius: var(--br40px);
    display: flex;
    align-items: center;
    height: 90%;
    transition: background 0.3s ease;
}

#url-bar-display:hover {
    background: var(--button-hover);
}

#url-bar-display:focus-within {
    background: var(--button-hover);
}

#url-input {
    align-items: center;
    margin: 10px;
    height: 100%;
    width: 100%;
    background-color: transparent;
    border: none;
    color: var(--text-norman);
    text-emphasis-color: transparent;
    font-family: "Comfortaa", sans-serif
}

#url-input::placeholder {
    color: var(--text-minimal);
}

.topbar-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-right: -15px;
}

/* defines bottom section of app */

#bottom {
    height: 100%;
    display: flex;
    flex-direction: row;
}

/* sidebar */

.sidebar {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.sidebar-bm-column {
    background: none;
    display: flex;
    height:100%;
    width: 120%;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border-bottom: 1px var(--separator) solid;
}

.bookmarks {
    width: 80%;
    aspect-ratio: 1/1;
    border-radius: var(--br20px);
    justify-content: center;
    align-items: center;
    border: none;
    background-color: transparent;
    transition: background 0.3s ease;
}

.bookmarks:hover {
    background-color: var(--button-hover)
}

#bookmark-favicon {
    height: 100%;
    width: 90%;
    margin-top: 2px;
}

.sidebar-app-select {
    background-color: transparent;
    display: flex;
    border: none;
    border-radius: var(--br10px);
    height: 70px;
    width: 80px;
    cursor: pointer;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
    color: var(--text-normal);
    font-weight: 600;
    font-family: "Comfortaa", sans-serif;
    padding-left: 5px;
    padding-right: 5px;
    overflow: hidden;
}

.sidebar-app-select:hover {
    background-color: var(--button-hover);
    color: var(--text-semibold);
}

.sidebar-apps-icon {
    stroke: var(--button-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.apps-text {
    max-width: 0;
    opacity: 0;
    transition: all 0.6s cubic-bezier(.71,.08,.54,.87);
}

.sidebar-app-select:hover .sidebar-apps-icon {
    width: 60px;
    height: 60px;
}

.sidebar-app-select:hover .apps-text {
    max-width: 100px;
    opacity: 1;
    margin-left: 8px;
}

.sidebar-footer {
    display: flex;
    padding-top: 15px;
    flex-direction: row;
    align-content: center;
    border-top: 1px var(--separator) solid;
    gap: 8px;
}

.settings-svg {
    stroke: var(--button-color);
}

.sidebar-footer-extras {
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-content: center;
    padding-top: 5px;
}

.sidebar-fe-button {
    background: transparent;
    display: flex;
    color: var(--text-minimal);
    height: 13px;
    border: none;
    cursor: pointer;
    font-size: 10px;
    justify-content: center;
    border-right: 1px solid var(--separator);
    padding-right: 2px;
    transition: color 0.3s ease;
}

.sidebar-fe-button:hover {
    color: var(--text-semibold);
}

.sidebar-fe-button-bottom {
    background: transparent;
    display: flex;
    color: var(--text-minimal);
    height: 13px;
    border: none;
    cursor: pointer;
    font-size: 10px;
    align-items: baseline;
    justify-content: center;
    transition: color 0.3s ease;
}

.sidebar-fe-button-bottom:hover {
    color: var(--text-semibold);
}

/* main content area, actual browser */

.main-content-area {
    background-color: var(--main);
    width: 100%;
    height: 100%;
    flex: 100;
    border-top-left-radius: var(--br20px);
    overflow: hidden;
}

#iframe-area {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tab-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

.tab-iframe.show {
    display: block;
}

/* music player overlay*/

.music-player {
    height: 200px;
    background: color-mix(in srgb, var(--main), transparent 50%);
    backdrop-filter: blur(10px);
    border-color: var(--button-hover);
    width: 420px;
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    bottom: 50px;
    right: 25px;
    border-radius: var(--br20px);
    gap: 10px;
    padding: 10px;
    display: none;
}

#musicplayer-top {
    display: flex;
    height: 60%;
    width: 100%;
    flex-direction: row;
}

#cover-art {
    width: 110px;
    height: 110px;
    border-radius: var(--br20px);
}

.songinfo {
    display: flex;
}

#music-info {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-normal);
    gap: 5px;
    font-family: var(--comfortaa);
}

#songname {
    border-bottom: 1px var(--separator) solid;
    padding-bottom: 5px;
}

.musicplayer-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#controls-top {
    display: flex;
    flex-direction: row;
    width: 100%;
    color: var(--text-normal);
    font-family: var(--comfortaa);
    padding-left: 20px;
    padding-right: 20px;
    gap: 10px;
    justify-content: center;
}

#song-progress {
    -webkit-appearance: none;
    justify-content: center;
    appearance: none;
    width: 100%;
    height: 5px;
    background: var(--button-color);
    border-radius: var(--br2px);
    outline: none;
    margin-top: 5px;
}

#song-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: var(--br50prc);
    background: var(--text-normal);
    cursor: pointer;
    border: none;
}

#song-progress::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border-radius: var(--br50prc);
    background: var(--text-normal);
    cursor: pointer;
    border: none;
}

#controls-bottom {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.songcontrol-btn {
    position: relative;
    display: flex;
    height: 30px;
    width: 30px;
    border-radius: var(--br50prc);
    padding: 0;
    border: none;
    align-items: center;
    justify-content: center;
    background-color: var(--button-color);
    cursor: pointer;
    z-index: 1;
}

.songcontrol-btn::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: var(--br50prc);
    background: linear-gradient(90deg, var(--brand-color-2), var(--brand-color-3));
    filter: blur(6px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.songcontrol-btn:hover::before {
    opacity: 1;
}

.songcontrol-btn:hover {
    background: linear-gradient(90deg, var(--brand-color-2), var(--brand-color-3));
}

.songcontrol-btn-side {
    display: flex;
    height: 30px;
    width: 30px;
    border-radius: var(--br50prc);
    padding: 0px;
    line-height: 0;
    border: none;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.songcontrol-btn-side:hover {
    background-color: var(--button-hover)
}

.songcontrol-btn-svg {
    height: 20px;
    width: 20px;
    display: block;
}

/* app selection popup */

#app-select-popup {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 200px;
    bottom: 60px;
    left: 120px;
    padding: 20px;
    border-radius: var(--br20px);
    background: color-mix(in srgb, var(--main), transparent 25%);
    backdrop-filter: blur(10px);
    gap: 5px;
    border-bottom-left-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-100px, 60px) scale(0.4);
    transition: all 0.4s cubic-bezier(.71,.08,.31,1.18)
}

#app-select-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translate(0, 0) scale(1);
    overflow: hidden;
}

.app-option-btn {
    display: flex;
    border: none;
    border-radius: var(--br10px);
    background: color-mix(in srgb, var(--main-dark), transparent 10%);
    color: var(--text-semibold);
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    font-family: var(--comfortaa);
    padding-left: 5px;
    padding-right: 20px;
    padding-top: 5px;
    padding-bottom: 5px;
    transition: background 0.3s ease;
    width: 100%;
    text-overflow: ellipsis;
    overflow: none;
    cursor: pointer;
    overflow: hidden;
}

.app-option-btn:hover {
    background-color: var(--button-hover);
}

.appbtn-svg {
    stroke: var(--button-color)
}

@supports (corner-shape: squircle) {
    * {
        corner-shape: squircle;
        --br10px: 14px;
        --br1px: 1px;
        --br5px: 7px;
        --br100prc: 100%;
        --br40px: 56px;
        --br20px: 28px;
        --br2px: 3px;
        --br50prc: 50%;
        --br25px: 35px;
    }

    #url-bar-display {
        corner-shape: round;
    }
}