* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    height: 100vh;
    overflow: hidden;
    padding: 5vh 5vw;
    box-sizing: border-box;
}

.browser-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid #fff;
    min-height: 0; /* Allow flex shrinking */
}

.tab-bar {
    border-bottom: 2px solid #fff;
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 10px;
    flex-shrink: 0; /* Don't let tab bar shrink */
}

.tab {
    border: 2px solid #fff;
    border-bottom: none;
    padding: 8px 15px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: #000;
    position: relative;
}

.tab.active {
    border-bottom: 2px solid #000;
    margin-bottom: -2px;
    background-color: #c4c4c4;
    color: #000;
}

.tab-title {
    margin-right: 10px;
}

.tab-close {
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
    border: 1px solid #fff;
    line-height: 1;
}

.tab-close:hover {
    background-color: #dddddd;
    color: #000;
}

.new-tab-btn {
    padding: 8px 15px;
    border: 2px solid #fff;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    font-family: monospace;
    margin-left: 10px;
}

.new-tab-btn:hover {
    background-color: #d6d6d6;
    color: #000
}

.effects-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
}

.help-button {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 1rem;
    cursor: pointer;
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button:hover {
    background: #333;
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.77);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.help-modal.active {
    display: flex;
}

.help-content {
    background: #000;
    border: 2px solid #fff;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    position: relative;
}

.help-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    padding: 5px;
    border: 1px solid #fff;
    line-height: 1;
}

.help-close:hover {
    background: #333;
}

.help-content h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #fff;
    padding-bottom: 10px;
}

.shortcut-list {
    list-style: none;
}

.shortcut-list li {
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #333;
}

.shortcut-key {
    background: #333;
    padding: 2px 6px;
    margin-right: 8px;
    border: 1px solid #fff;
    font-weight: bold;
}

/* Old TV Effect - Large Pixels */
.tv-effect {
    position: relative;
    overflow: hidden;
}

.tv-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(255,255,255,0.1) 8px,
            rgba(255,255,255,0.1) 10px,
            rgba(0,255,0,0.08) 10px,
            rgba(0,255,0,0.08) 12px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 8px,
            rgba(255,0,0,0.05) 8px,
            rgba(255,0,0,0.05) 10px,
            rgba(0,0,255,0.05) 10px,
            rgba(0,0,255,0.05) 12px
        );
    pointer-events: none;
    z-index: 500;
}

.tv-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at center, 
            transparent 15%, 
            rgba(0,0,0,0.3) 50%, 
            rgba(0,0,0,0.9) 100%),
        linear-gradient(
            0deg,
            rgba(0,150,0,0.1) 0%,
            transparent 50%,
            rgba(0,150,0,0.1) 100%
        );
    pointer-events: none;
    z-index: 501;
}

.tv-effect .browser-container {
    filter: contrast(1.6) brightness(1.3) saturate(1.8) hue-rotate(8deg);
}

.content-area {
    flex: 1;
    border: none;
    background-color: #000;
    display: flex;
    align-items: flex-start; /* Changed from center to flex-start */
    justify-content: center;
    font-size: 18px;
    padding: 20px;
    overflow-y: auto; /* Added scrolling */
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-height: 0; /* Allow flex shrinking */
}

/* Custom scrollbar for webkit browsers */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: #333;
    border: 1px solid #fff;
}

.content-area::-webkit-scrollbar-thumb {
    background: #fff;
    border: 1px solid #000;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.page-content {
    text-align: left;
    width: 100%;
    max-width: 800px;
    min-height: 100%; /* Ensure content takes full height */
}

.page-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #fff;
    padding-bottom: 10px;
}

.page-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.menu-container {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.menu-container h2 {
    font-size: 24px;
    margin-bottom: 30px;
    border-bottom: 2px solid #fff;
    padding-bottom: 10px;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-item {
    border: 2px solid #fff;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    position: relative;
}

.menu-item:hover {
    background-color: #333;
    transform: translateX(10px);
}

.menu-item.selected {
    background-color: #333;
    transform: translateX(10px);
}

.menu-item.selected::before {
    content: '> ';
    position: absolute;
    left: 10px;
    color: #0f0;
    font-weight: bold;
}

.back-button {
    cursor: pointer;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #fff;
    display: inline-block;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #333;
}

.empty-state {
    text-align: center;
    border: 2px solid #fff;
    padding: 40px;
    margin: 20px;
}

.browser-closed {
    display: none;
}

.launch-screen {
    display: flex;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: pointer;
}

.launch-screen.hidden {
    display: none;
}

.globe-icon {
    width: 120px;
    height: 120px;
    border: 3px solid #fff;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 48px;
}

.globe-icon:hover {
    background-color: #333;
    transform: scale(1.1);
}

.launch-text {
    font-size: 18px;
    margin-top: 10px;
}

.key-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    padding: 10px 20px;
    font-size: 16px;
    z-index: 1500;
    display: none;
}

.key-indicator.active {
    display: block;
}

.tv-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #fff;
    padding: 5px 10px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.tv-indicator.active {
    display: block;
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    border: 2px solid #ff6b6b;
    padding: 20px;
    margin: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}