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

body {
    font-family: TwitterChirp, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fff;
    color: #333;
    display: flex;
}


/* Aside Left */

.logo {
    padding: 16px;
    display: flex;
    align-items: flex-start;
}

.aside-left {
    flex: 0 0 clamp(275px, calc(50vw - 365px), 595px);
    position: sticky;
    top: 0;
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
}

.sidebar {
    width: 275px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    height: 100%;
}

.aside-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgb(51, 51, 51);
    text-decoration: none;
    border-radius: 9999px;
    transition: background-color 0.2s ease-in-out;
}

.aside-item:hover,
.aside-item:visited,
.aside-item:active {
    color: rgb(51, 51, 51);
    text-decoration: none;
}

.aside-item:hover {
    background-color: rgba(15, 20, 25, 0.1);
}

.aside-item img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

.aside-item span {
    font-size: 20px;
    font-weight: 400;
}

.aside-item.active {
    font-weight: 700;
}

.more-wrapper {
    position: relative;
    display: none;
}

.more-toggle-btn {
    cursor: pointer;
}

.more-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    z-index: 100;
    min-width: 220px;
}

.more-menu.open {
    display: block;
}

.more-menu .aside-item {
    padding: 12px 16px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.post-btn {
    display: block;
    margin-top: 16px;
    background-color: rgb(15, 20, 25);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    border-radius: 50px;
    padding: 16px;
    transition: background-color 0.2s ease-in-out;
}

.post-btn:hover {
    background-color: rgb(15, 20, 25);
    color: #fff;
    text-decoration: none;
}

.aside-bottom {
    margin-top: auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.aside-bottom:hover {
    background-color: rgb(231, 231, 231);
}

.aside-bottom-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.aside-bottom-text strong {
    font-size: 15px;
    color: rgb(15, 20, 25);
}

.aside-bottom-text span {
    font-size: 15px;
    color: rgb(83, 100, 113);
}

.aside-bottom-more {
    font-size: 18px;
    color: rgb(15, 20, 25);
}

/* Main */

.main {
    flex: 0 0 600px;
    min-height: 100vh;
    background-color: white;
    border-right: 1px solid #e1e8ed;
}

.post-menu-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: rgb(83, 100, 113);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    line-height: 1;
    transition: color 0.2s ease-in-out;
}

/* Main Post Container */

.main-tabs {
    display: flex;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.85);
    position: -webkit-sticky;
    border-bottom: 1px solid #e1e8ed;
    z-index: 10;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 500;
    color: rgb(83, 100, 113);
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.tab:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: rgb(15, 20, 25);
    text-decoration: none;
}

.tab.active {
    font-weight: 700;
    color: rgb(15, 20, 25);
    border-bottom: 2px solid rgb(29, 155, 240);
    border-bottom-width: 4px;
}

.post-container {
    padding: 0;
    height: auto;
}

.post {
    border-bottom: 1px solid #e1e8ed;
    padding: 16px 0;
}

.what-is-happening {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8ed;
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.post-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    flex-shrink: 0;
}

.post-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.what-is-happening .post-user-info input {
    font-size: 20px;
    color: rgb(83, 100, 113);
    border: none;
    outline: none;
    flex: 1;
}

.post-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    margin-left: 45px;
}

.invert-to-blue {
     filter: invert(45%) sepia(94%) saturate(1900%) hue-rotate(185deg) brightness(100%) contrast(95%);
}

.tab-list {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tab-list img {
    width: 18px;
    height: 18px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    box-sizing: content-box;
    transition: background-color 0.2s;
}

.tab-list img:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

.what-is-happening .post-btn {
    display: inline-block;
    margin-top: 0;
    padding: 8px 20px;
    font-size: 15px;
    width: auto;
}

/* Post Reel Cards */

.post-reel {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8ed;
    cursor: pointer;
    transition: background-color 0.2s;
    max-width: 600px;
}

.post-reel:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.post-reel-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 2px;
}

.post-reel .post-user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding-top: 0;
}

.post-display-name {
    font-size: 15px;
    font-weight: 700;
    color: rgb(15, 20, 25);
}

.post-handle,
.post-time {
    font-size: 15px;
    color: rgb(83, 100, 113);
    font-weight: 400;
}

.post-reel .post-content {
    font-size: 15px;
    line-height: 1.5;
    color: rgb(15, 20, 25);
    padding-left: 52px;
    margin-bottom: 8px;
}

.post-media {
    position: relative;
    margin-left: 52px;
    margin-bottom: 10px;
    border-radius: 16px;
    overflow: hidden;
}

.post-media img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.post-reel-footer {
    display: flex;
    align-items: center;
    padding-left: 52px;
    padding-top: 4px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.post-action span {
    font-size: 13px;
    color: rgb(83, 100, 113);
}

.post-action.icon-only {
    flex: 0;
    margin-left: auto;
    padding-left: 8px;
}

.post-reel-footer img {
    width: 18px;
    height: 18px;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.post-reel-footer img:hover {
    opacity: 1;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(15, 20, 25, 0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watch-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background-color: rgba(15, 20, 25, 0.75);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Video Modal */

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal[hidden] {
    display: none;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.video-modal-content {
    position: relative;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    border-radius: 16px;
    overflow: hidden;
    background-color: #000;
}

.video-modal-content video {
    width: 100%;
    display: block;
    max-height: 80vh;
    object-fit: contain;
}

.video-modal .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(15, 20, 25, 0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background-color 0.2s;
}

.video-modal .close-btn:hover {
    background-color: rgba(15, 20, 25, 0.95);
}

.video-modal .mute-btn {
    position: absolute;
    bottom: 18px;
    right: 14px;
    background-color: rgba(15, 20, 25, 0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.video-modal-content:hover .mute-btn {
    opacity: 1;
}

.video-modal .video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 3;
    cursor: pointer;
    transition: height 0.1s;
}

.video-modal .video-progress:hover {
    height: 6px;
}

.video-modal .video-progress-fill {
    height: 100%;
    background-color: rgb(29, 155, 240);
    width: 0%;
}

/* Aside Right */

.aside-right {
    flex: 0 0 390px;
    position: sticky;
    top: 0;
    padding: 12px 20px;
    align-self: flex-start;
}

.aside-right .search-bar {
    position: sticky;
    top: 0;
    background-color: white;
    padding: 8px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e1e8ed;
    margin-bottom: 16px;
}

.aside-right .search-bar input {
    border: none;
    outline: none;
    font-size: 15px;
    flex: 1;
}

.aside-right .subscribe {
    background-color: transparent;
    color: black;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e1e8ed;
}

.subscribe h3 {
    font-size: 20px;
    font-weight: 700;
}

.subscribe p {
    font-size: 15px;
    color: rgb(15, 20, 25);
    margin: 8px 0 16px;
    line-height: 1.4;
}

.aside-right .subscribe-btn {
    display: block;
    background-color: rgb(29, 155, 240);
    color: white;
    border-radius: 50px;
    border: none;
    padding: 8px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    width: fit-content;
}

.aside-right .subscribe-btn:hover {
    background-color: rgb(26, 140, 220);
    color: white;
    text-decoration: none;
}

/* Today's News */

.aside-right .news {
    background-color: transparent;
    color: black;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e1e8ed;
}

.news h3 {
    font-size: 20px;
    font-weight: 800;
}

.news ul {
    list-style: none;
    margin-top: 12px;
}

.news ul li {
    padding: 12px 16px;
    margin: 0 -16px;
}

.news ul li a {
    display: block;
}

.news ul li:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.news ul li a {
    font-size: 15px;
    color: rgb(15, 20, 25);
    font-weight: 700;
    text-decoration: none;
}

.news ul li span {
    display: block;
    font-size: 13px;
    color: rgb(83, 100, 113);
    font-weight: 400;
}

/* What's Happening */

.whats-happening {
    background-color: transparent;
    color: black;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e1e8ed;
}

.whats-happening h3 {
    font-size: 20px;
    font-weight: 800;
}

.whats-happening .trending-topics {
    list-style: none;
    margin-top: 4px;
}

.trend-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 0 -16px;
}

.trend-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.trend-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.trend-item .topic {
    display: block;
    font-size: 13px;
    color: rgb(83, 100, 113);
    font-weight: 400;
}

.trend-item a {
    display: block;
    font-size: 15px;
    color: rgb(15, 20, 25);
    font-weight: 700;
    text-decoration: none;
}

.trend-item .post-menu-btn {
    margin-left: 12px;
    flex-shrink: 0;
}

.show-more {
    display: block;
    padding: 16px 0 4px;
    font-size: 15px;
    color: rgb(29, 155, 240);
    text-decoration: none;
}

.show-more:hover {
    text-decoration: none;
    color: rgb(26, 140, 220);
}

/* Who to Follow */

.who-to-follow {
    background-color: transparent;
    color: black;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e1e8ed;
}

.who-to-follow h3 {
    font-size: 20px;
    font-weight: 800;
}

.who-to-follow ul {
    list-style: none;
    margin-top: 12px;
}

.who-to-follow ul li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 0 -16px;
}

.who-to-follow ul li:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.who-to-follow ul li img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.follow-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.follow-name {
    font-size: 15px;
    font-weight: 700;
    color: rgb(15, 20, 25);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-handle {
    font-size: 13px;
    color: rgb(83, 100, 113);
    font-weight: 400;
}

.follow-btn {
    background-color: rgb(15, 20, 25);
    color: #fff;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.follow-btn:hover {
    background-color: rgb(39, 44, 48);
    color: #fff;
    text-decoration: none;
}

.follow-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer Section */

.footer {
    padding: 12px 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 2px 4px;
}

.footer-links li::after {
    content: " · ";
    color: rgb(83, 100, 113);
    font-size: 13px;
}

.footer-links li:last-child::after {
    content: "";
}

.footer a {
    font-size: 13px;
    color: rgb(83, 100, 113);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-copy {
    font-size: 13px;
    color: rgb(83, 100, 113);
    margin-top: 4px;
}

.dark-toggle-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgb(51, 51, 51);
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

.dark-toggle-btn .material-symbols-outlined {
    margin-right: 12px;
    font-size: 24px;
}

.dark-toggle-btn span:last-child {
    font-size: 20px;
    font-weight: 400;
}

.dark-toggle-btn:hover {
    background-color: rgb(225, 232, 237);
}

/* Responsive Design */

/* Collapse aside items into More menu */
@media (max-width: 1600px) {
    .aside-item.collapsible {
        display: none;
    }

    .more-wrapper {
        display: block;
    }
}

/* Medium screens: icon-only sidebar, hide right sidebar, fluid main */
@media (max-width: 1280px) {
    .aside-left {
        flex: 0 0 68px;
        justify-content: center;
    }

    .sidebar {
        width: auto;
        align-items: center;
        padding: 8px 4px;
    }

    .aside-item span {
        display: none;
    }

    .dark {
        display: none;
    }

    .dark-toggle-btn {
        padding: 12px;
        justify-content: center;
    }

    .dark-toggle-btn .material-symbols-outlined {
        margin-right: 0;
    }

    .aside-item img {
        margin-right: 0;
    }

    .aside-item {
        padding: 12px;
        justify-content: center;
    }

    .post-btn {
        width: 35px;
        height: 35px;
        padding: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50px;
    }

    .aside-bottom-text,
    .aside-bottom-more {
        display: none;
    }

    .aside-bottom {
        padding: 12px;
        justify-content: center;
        gap: 0;
    }

    .main {
        flex: 1 1 600px;
        max-width: 600px;
    }

    .aside-right {
        display: none;
    }
}

/* Small screens: hide sidebar entirely, full-width main */
@media (max-width: 768px) {
    .aside-left {
        display: none;
    }

    .main {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .post-reel .post-content {
        padding-left: 0;
    }
    .post-reel-footer {
        padding-left: 0;
    }
    .post-actions-bar {
        margin-left: 0;
    }
    .post-header {
        gap: 8px;
    }
    .post-profile-pic {
        width: 30px;
        height: 30px;
    }
    .post-btn {
        padding: 6px 16px;
        font-size: 14px;
        border-radius: 50px;
        align-items: center;
        justify-content: center;
        display: flex;
    }
}

/* Non-AI Features */

body:has(#dark-toggle:checked) {
    background-color: rgb(15, 20, 25);
}

#dark-toggle:checked ~ .aside-left,
#dark-toggle:checked ~ .main,
#dark-toggle:checked ~ .aside-right {
    background-color: rgb(15, 20, 25);
}

#dark-toggle:checked ~ .aside-left .more-menu {
    background-color: rgb(25, 30, 35);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

#dark-toggle:checked ~ .aside-left .aside-item,
#dark-toggle:checked ~ .aside-left .aside-bottom,
#dark-toggle:checked ~ .main .main-tabs .tab,
#dark-toggle:checked ~ .aside-right .search-bar,
#dark-toggle:checked ~ .aside-right .subscribe,
#dark-toggle:checked ~ .aside-right .news,
#dark-toggle:checked ~ .aside-right .whats-happening,
#dark-toggle:checked ~ .aside-right .who-to-follow {
    background-color: rgb(15, 20, 25);
    color: rgb(225, 232, 237);
}



#dark-toggle:checked ~ .main .post-reel .post-content {
    color: rgb(225, 232, 237);
}

#dark-toggle:checked ~ .aside-left img[src$=".svg"],
#dark-toggle:checked ~ .main img[src$=".svg"],
#dark-toggle:checked ~ .aside-right img[src$=".svg"] {
    filter: invert(1);
}

#dark-toggle:checked ~ .aside-left .aside-item:hover,
#dark-toggle:checked ~ .aside-left .aside-bottom:hover,
#dark-toggle:checked ~ .main .main-tabs .tab:hover,
#dark-toggle:checked ~ .aside-right .search-bar:hover,
#dark-toggle:checked ~ .aside-right .subscribe:hover,
#dark-toggle:checked ~ .aside-right .news:hover,
#dark-toggle:checked ~ .aside-right .whats-happening:hover,
#dark-toggle:checked ~ .aside-right .who-to-follow:hover {
    background-color: rgb(39, 44, 48);
}

#dark-toggle:checked ~ .aside-left .aside-item span,
#dark-toggle:checked ~ .aside-left .aside-bottom-text strong,
#dark-toggle:checked ~ .aside-left .aside-bottom-text span,
#dark-toggle:checked ~ .main .post-reel-header .post-display-name,
#dark-toggle:checked ~ .main .post-reel-header .post-handle,
#dark-toggle:checked ~ .main .post-reel-header .post-time,
#dark-toggle:checked ~ .aside-right .subscribe h3,
#dark-toggle:checked ~ .aside-right .subscribe p,
#dark-toggle:checked ~ .aside-right .news h3,
#dark-toggle:checked ~ .aside-right .news ul li a,
#dark-toggle:checked ~ .aside-right .news ul li span,
#dark-toggle:checked ~ .aside-right .whats-happening h3,
#dark-toggle:checked ~ .aside-right .whats-happening .trend-item .topic,
#dark-toggle:checked ~ .aside-right .whats-happening .trend-item a,
#dark-toggle:checked ~ .aside-right .who-to-follow h3,
#dark-toggle:checked ~ .aside-right .who-to-follow .follow-item .follow-name,
#dark-toggle:checked ~ .aside-right .who-to-follow .follow-item .follow-handle {
    color: rgb(225, 232, 237);
}

#dark-toggle:checked ~ .aside-left .post-btn,
#dark-toggle:checked ~ .main .post-btn {
    background-color: #fff;
    color: rgb(15, 20, 25);
}

#dark-toggle:checked ~ .main .what-is-happening .post-user-info input,
#dark-toggle:checked ~ .aside-right .search-bar input {
    background-color: rgb(15, 20, 25);
    color: rgb(225, 232, 237);
}

#dark-toggle:checked ~ .aside-right .search-bar {
    border-color: rgb(47, 51, 54);
}

/* AI Features */

.what-is-happening .post-btn {
    border: none;
    cursor: pointer;
}

.what-is-happening .post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delete-post-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: rgb(83, 100, 113);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    line-height: 1;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-post-btn:hover {
    color: rgb(244, 33, 46);
    background-color: rgba(244, 33, 46, 0.1);
}

#dark-toggle:checked ~ .main .user-post .delete-post-btn {
    color: rgb(225, 232, 237);
}

#dark-toggle:checked ~ .main .user-post .delete-post-btn:hover {
    color: rgb(244, 33, 46);
    background-color: rgba(244, 33, 46, 0.15);
}
