:root {
    --bg-color: #0f0f12;
    --glass-bg: rgba(30, 30, 40, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #3b82f6; /* Cloudflare Blueに近い色 */
    --text-main: #fff;
    --text-sub: #a1a1aa;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
}
body.no-anim * { transition: none !important; animation: none !important; }

#bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: brightness(0.5);
    transition: background-image 0.5s ease;
}

#browser-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(15px);
}

#top-bar {
    display: flex;
    align-items: center;
    padding: 8px 10px 0;
    background: rgba(0,0,0,0.3);
    height: 42px;
}

#tabs-container {
    display: flex;
    overflow-x: auto;
    flex: 1;
    gap: 5px;
}
#tabs-container::-webkit-scrollbar { display: none; }

.tab {
    background: rgba(255,255,255,0.05);
    padding: 8px 15px;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
    min-width: 100px;
    user-select: none;
    transition: 0.2s;
    border-top: 2px solid transparent;
}
.tab.active {
    background: var(--glass-bg);
    border-top-color: var(--accent);
}
.tab span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab-close:hover { color: #ef4444; }

#add-tab-btn, #settings-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    padding: 0 15px;
    cursor: pointer;
    font-size: 16px;
}
#add-tab-btn:hover, #settings-btn:hover { color: var(--accent); }

#nav-bar {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    gap: 10px;
}
#nav-bar button {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
}
#nav-bar button:hover { color: var(--text-main); }

#url-input {
    flex: 1;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    outline: none;
    transition: 0.2s;
}
#url-input:focus { border-color: var(--accent); background: rgba(0,0,0,0.6); }

#go-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 20px;
    font-weight: bold;
    cursor: pointer;
}

#viewport {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
}
iframe { width: 100%; height: 100%; border: none; display: none; }
iframe.active { display: block; }

/* New Tab Page */
.new-tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #111;
    color: white;
}
.logo { font-size: 3rem; margin-bottom: 2rem; background: linear-gradient(45deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.search-box-large {
    background: rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    display: flex;
    width: 60%;
    max-width: 600px;
    border: 1px solid var(--glass-border);
}
.nt-search-input {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    width: 100%;
    margin-left: 10px;
    outline: none;
}
.features-grid { display: flex; gap: 20px; margin-top: 40px; }
.feature-card {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    width: 80px;
    transition: 0.2s;
}
.feature-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }
.feature-card i { display: block; font-size: 24px; margin-bottom: 8px; color: var(--accent); }

.footer-credit {
    margin-top: auto;
    padding: 20px;
    color: var(--text-sub);
    font-size: 0.8rem;
}
.footer-credit a, .sask-link { color: var(--accent); text-decoration: none; }

/* Settings Modal */
#settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    justify-content: flex-end;
}
#settings-modal.hidden { display: none; }
.settings-content {
    width: 350px;
    background: #18181b;
    height: 100%;
    padding: 20px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    overflow-y: auto;
    animation: slideIn 0.3s;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.settings-header { display: flex; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.setting-item { margin-bottom: 20px; }
.setting-item label { display: block; color: var(--text-sub); margin-bottom: 5px; font-size: 0.9rem; }
.setting-item input[type="text"], .setting-item select {
    width: 100%; padding: 8px; background: #27272a; border: 1px solid #3f3f46; color: white; border-radius: 6px; box-sizing: border-box;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #555; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

#about-section { border-top: 1px solid #333; padding-top: 20px; margin-top: 30px; }