.x-view {
    /* Light Theme Defaults */
    --bg-color: #ffffff;
    --text-color: #0f1419;
    --text-muted: #536471;
    --primary-color: #1d9bf0;
    --primary-hover: #1a8cd8;
    --border-color: #eff3f4;
    --hover-bg: rgba(15, 20, 25, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --search-bg: #eff3f4;
    --profile-banner: #cfd9de;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.x-view[data-theme="dark"] {
    /* Dark Theme Overrides */
    --bg-color: #000000;
    --text-color: #e7e9ea;
    --text-muted: #71767b;
    --border-color: #2f3336;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.85);
    --search-bg: #202327;
    --profile-banner: #333639;
}

.x-view, .x-view * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.x-view {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 15px;
    display: flex;
    justify-content: center;
    overflow-y: scroll;
    transition: background-color 0.3s, color 0.3s;
}

/* Splash Screen */
.x-view .splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: x-splash-container-fade 2.5s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

.x-view .splash-logo {
    width: 65px;
    fill: #ffffff;
    animation: x-splash-logo-anim 2.5s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes x-splash-container-fade {
    0%, 60% { opacity: 1; visibility: visible; pointer-events: all; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

@keyframes x-splash-logo-anim {
    0%, 40% { transform: scale(1); opacity: 1; }
    55% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.x-view .container {
    display: flex;
    width: 100%;
    max-width: 600px; 
    min-height: 100vh;
    position: relative;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

@media (max-width: 600px) {
    .x-view .container {
        border-left: none;
        border-right: none;
    }
}

.x-view .main-feed {
    width: 100%;
    padding-bottom: 53px; 
}

.x-view .view-section {
    display: none;
    min-height: 100vh;
}
.x-view .view-section.active {
    display: block;
}

.x-view .avatar {
    border-radius: 50%;
    background-color: #ccc;
    object-fit: cover;
}

.x-view .header-tabs {
    display: flex;
    height: 53px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.x-view .tab {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

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

.x-view .tab span {
    font-weight: 700;
    color: var(--text-muted);
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.3s;
}

.x-view .tab.active span {
    color: var(--text-color);
}

.x-view .tab.active span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 9999px;
}

.x-view .tweet {
    padding: 16px;
    display: flex;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.3s;
}

.x-view .tweet:hover {
    background-color: var(--hover-bg);
}

.x-view .tweet-content {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.x-view .tweet-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.x-view .tweet-name {
    font-weight: 700;
    margin-right: 4px;
    white-space: nowrap;
}

.x-view .tweet-verified {
    fill: var(--text-color);
    width: 18.75px;
    height: 18.75px;
    margin-right: 4px;
    flex-shrink: 0;
    transition: fill 0.3s;
}

.x-view .tweet-handle, .x-view .tweet-time {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.x-view .tweet-dot {
    color: var(--text-muted);
    margin: 0 4px;
    transition: color 0.3s;
}

.x-view .tweet-text {
    line-height: 20px;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.x-view .tweet-translate {
    color: var(--primary-color);
    font-size: 13px;
    margin-bottom: 12px;
    cursor: pointer;
    display: inline-block;
}

.x-view .tweet-translate:hover {
    text-decoration: underline;
}

.x-view .tweet-actions {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    margin-top: 12px;
    max-width: 425px;
    transition: color 0.3s;
}

.x-view .action-item {
    display: flex;
    align-items: center;
    transition: color 0.2s;
    font-size: 13px;
}

.x-view .action-item svg {
    width: 18.75px;
    height: 18.75px;
    fill: currentColor;
    margin-right: 8px;
    padding: 8px;
    box-sizing: content-box;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.x-view .action-item:hover.reply { color: var(--primary-color); }
.x-view .action-item:hover.reply svg { background-color: rgba(29, 155, 240, 0.1); }

.x-view .action-item:hover.retweet { color: #00ba7c; }
.x-view .action-item:hover.retweet svg { background-color: rgba(0, 186, 124, 0.1); }

.x-view .action-item:hover.like { color: #f91880; }
.x-view .action-item:hover.like svg { background-color: rgba(249, 24, 128, 0.1); }

.x-view .action-item:hover.views { color: var(--primary-color); }
.x-view .action-item:hover.views svg { background-color: rgba(29, 155, 240, 0.1); }

.x-view .search-box {
    background-color: var(--search-bg);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    transition: background-color 0.3s;
}

.x-view .search-box svg {
    width: 18.75px;
    height: 18.75px;
    fill: var(--text-muted);
    margin-right: 12px;
    transition: fill 0.3s;
}

.x-view .search-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    outline: none;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
    transition: color 0.3s;
}

.x-view .search-input::placeholder {
    color: var(--text-muted);
    transition: color 0.3s;
}

.x-view .trending-box {
    background: transparent;
}

.x-view .trend-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-view .trend-item:hover {
    background-color: var(--hover-bg);
}

.x-view .trend-category {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    transition: color 0.3s;
}

.x-view .trend-name {
    font-weight: 700;
    margin: 2px 0;
    font-size: 15px;
}

.x-view .trend-stats {
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.3s;
}

/* Mobile Elements */
.x-view .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.x-view .mobile-header .avatar { width: 32px; height: 32px; cursor: pointer; }
.x-view .mobile-header .logo svg { width: 24px; fill: var(--text-color); transition: fill 0.3s; }

.x-view .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    height: 53px;
    z-index: 20;
    transition: background-color 0.3s, border-color 0.3s;
}

.x-view .mobile-bottom-nav .nav-item {
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    cursor: pointer;
}

.x-view .mobile-bottom-nav .nav-item svg { 
    width: 26.25px; 
    height: 26.25px; 
    fill: var(--text-color); 
    transition: fill 0.3s;
}

.x-view .mobile-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: var(--primary-color);
    border-radius: 50%;
    z-index: 20;
    box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 15px, rgba(0, 0, 0, 0.15) 0px 0px 3px 1px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}
.x-view[data-theme="dark"] .mobile-fab {
    box-shadow: rgba(255, 255, 255, 0.2) 0px 0px 15px, rgba(255, 255, 255, 0.15) 0px 0px 3px 1px;
}
.x-view .mobile-fab:active {
    background-color: var(--primary-hover);
    transform: scale(0.95);
}
.x-view .mobile-fab svg { width: 24px; fill: white; }

@media (min-width: 601px) {
    .x-view .mobile-fab {
        right: calc(50% - 300px + 20px);
    }
}

/* Theme Toggle Button */
.x-view .theme-toggle {
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.x-view .theme-toggle:hover {
    background-color: var(--hover-bg);
}
.x-view .theme-toggle svg {
    width: 20px;
    fill: var(--text-color);
    transition: fill 0.3s;
}

body.is-x-open .desktop-container,
body.is-x-open .pagination,
body.is-x-open .dock-container,
body.is-x-open .system-status-bar {
    visibility: hidden;
    pointer-events: none;
}

.x-view {
    position: fixed;
    inset: 0;
    z-index: 1200;
    width: 100%;
    min-width: 280px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.x-view:focus {
    outline: none;
}

.x-view [role="button"]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}
