@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --bg-start: #242731;
    --bg-end: #1c1e26;
    --chrome-bg: rgba(36, 39, 49, 0.75);
    --chrome-border: rgba(255, 255, 255, 0.04);
    --content-bg: #2a2d39;
    --text-primary: #eceff4;
    --text-secondary: #949cbb;
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-border: rgba(255, 255, 255, 0.06);
    --btn-hover: rgba(255, 255, 255, 0.09);
    --tab-bg: rgba(255, 255, 255, 0.015);
    --tab-active-bg: #323644;
    --highlight: #9db2fc;
    --highlight-gradient: linear-gradient(135deg, #9db2fc, #cbb5ff);
    --shadow-soft: rgba(0, 0, 0, 0.12);
    --shadow-deep: rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.browser-chrome {
    background: var(--chrome-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--chrome-border);
    padding: 16px 24px 0 24px;
    z-index: 100;
    box-shadow: 0 4px 20px var(--shadow-soft);
}

.navigation-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 14px;
    width: 100%;
}

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

.nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover:not(:disabled) {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-soft);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

#search-form {
    display: flex;
    flex: 0 1 650px;
    width: 100%;
}

.address-bar {
    width: 100%;
    height: 42px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--btn-border);
    border-radius: 24px;
    padding: 0 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.address-bar:focus {
    border-color: rgba(157, 178, 252, 0.5);
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 3px rgba(157, 178, 252, 0.15), inset 0 2px 4px rgba(0,0,0,0.05);
}

.address-bar::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.tab-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 40px;
}

.tab {
    min-width: 160px;
    max-width: 220px;
    height: 34px;
    background: var(--tab-bg);
    border: 1px solid transparent;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
    position: relative;
    border-bottom: none;
    color: var(--text-secondary);
    margin-bottom: 0;
    animation: tabOpen 0.28s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
    transform-origin: bottom center;
}

@keyframes tabOpen {
    0% {
        opacity: 0;
        transform: scaleX(0.4) scaleY(0.7) translateY(8px);
        min-width: 0;
        max-width: 0;
    }
    60% {
        opacity: 1;
        transform: scaleX(1.04) scaleY(1.02) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scaleX(1) scaleY(1) translateY(0);
        min-width: 160px;
        max-width: 220px;
    }
}

@keyframes tabClose {
    0% {
        opacity: 1;
        transform: scaleX(1) scaleY(1) translateY(0);
        min-width: 160px;
        max-width: 220px;
    }
    40% {
        opacity: 0.6;
        transform: scaleX(1.02) scaleY(0.9) translateY(2px);
    }
    100% {
        opacity: 0;
        transform: scaleX(0.3) scaleY(0.5) translateY(10px);
        min-width: 0;
        max-width: 0;
        padding: 0;
        margin: 0;
    }
}

.tab.closing {
    animation: tabClose 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
    overflow: hidden;
}

.tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab.active {
    background: var(--tab-active-bg);
    color: var(--text-primary);
    height: 38px;
    font-weight: 500;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.tab-favicon {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tab-favicon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tab-title {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.tab-close {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    margin-left: 6px;
}

.tab-close:hover {
    background: rgba(255, 95, 86, 0.15);
    color: #ff5f56;
}

.new-tab-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.new-tab-btn:hover {
    background: var(--btn-hover);
    color: var(--text-primary);
}

.content-area {
    flex: 1;
    position: relative;
    background: var(--content-bg);
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: inset 0 10px 20px var(--shadow-soft);
}

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.tab-content.active {
    display: block;
    animation: contentIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes contentIn {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
        filter: blur(4px);
    }
    60% {
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

.tab-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}




.new-tab-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newtab-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.newtab-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
}

.newtab-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--highlight);
    top: -120px;
    left: -100px;
    animation: orbFloat1 14s ease-in-out infinite;
}

.newtab-orb-2 {
    width: 380px;
    height: 380px;
    background: #cbb5ff;
    bottom: -80px;
    right: -60px;
    animation: orbFloat2 18s ease-in-out infinite;
}

.newtab-orb-3 {
    width: 260px;
    height: 260px;
    background: #7dd3fc;
    top: 40%;
    left: 60%;
    animation: orbFloat3 22s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, 30px) scale(1.05); }
    66% { transform: translate(-20px, 50px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -40px) scale(1.08); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-30px, 30px) scale(0.92); }
    80% { transform: translate(20px, -20px) scale(1.04); }
}

.newtab-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    padding: 0 24px;
    animation: newtabReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes newtabReveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.newtab-clock {
    font-size: 86px;
    font-weight: 300;
    letter-spacing: -4px;
    line-height: 1;
    background: var(--highlight-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
    filter: drop-shadow(0 0 40px rgba(157, 178, 252, 0.25));
}

.newtab-date {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    margin-bottom: 40px;
    opacity: 0.8;
}

.newtab-search-wrap {
    width: 100%;
    max-width: 560px;
    margin-bottom: 52px;
}

.newtab-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0 10px 0 20px;
    height: 54px;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

.newtab-search-bar:focus-within {
    border-color: rgba(157, 178, 252, 0.45);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(157, 178, 252, 0.12), inset 0 1px 0 rgba(255,255,255,0.08);
}

.newtab-search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    opacity: 0.6;
}

.newtab-search-bar:focus-within .newtab-search-icon {
    color: var(--highlight);
    opacity: 1;
}

.newtab-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
}

.newtab-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.newtab-search-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: var(--highlight);
    color: #1c1e26;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.newtab-search-btn:hover {
    transform: scale(1.06);
    filter: brightness(1.1);
}

.newtab-shortcuts {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    max-width: 680px;
    width: 100%;
}

.newtab-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    backdrop-filter: blur(8px);
}

.newtab-shortcut:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.newtab-shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.newtab-shortcut:hover .newtab-shortcut-icon {
    background: rgba(0, 0, 0, 0.3);
}

.newtab-shortcut-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.newtab-shortcut:hover .newtab-shortcut-label {
    color: var(--text-primary);
}

@media (max-width: 700px) {
    .newtab-shortcuts {
        grid-template-columns: repeat(4, 1fr);
    }
    .newtab-clock {
        font-size: 64px;
    }
}

.dock-hint {
    position: fixed;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: #ffffff;
    opacity: 0.9;
    pointer-events: none;
    z-index: 10;
}

.hint-text {
    font-size: 28px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(0, 0, 0, 0.4);
}
