* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --card: #ffffff;
    --text: #111111;
    --muted: #737373;
    --border: #dbdbdb;
    --hover: #f5f5f5;
    --accent: #0095f6;
}

body.dark {
    --bg: #000000;
    --card: #000000;
    --text: #f5f5f5;
    --muted: #a8a8a8;
    --border: #262626;
    --hover: #181818;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background .25s, color .25s;
}


/* ================= SIDEBAR ================= */

.sidebar {
    width: 245px;
    height: 100vh;
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg);
    padding: 28px 15px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 12px 35px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(
        135deg,
        #833ab4,
        #fd1d1d,
        #fcb045
    );
    color: white;
    font-size: 21px;
}

.brand h2 {
    font-family: "Grand Hotel", cursive;
    font-size: 29px;
    font-weight: 400;
    line-height: 20px;
}

.brand span {
    display: block;
    font-size: 15px;
    color: var(--muted);
    margin-top: 5px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 14px 13px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    transition: .2s;
}

.menu-item:hover {
    background: var(--hover);
}

.menu-item.active {
    font-weight: 700;
}

.menu-item i {
    width: 25px;
    font-size: 22px;
    text-align: center;
}

.small-avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
}

.more-btn {
    margin-top: auto;
}


/* ================= MAIN ================= */

.main {
    margin-left: 245px;
    min-height: 100vh;
    padding: 30px 30px 70px;
}

.page {
    max-width: 935px;
    margin: auto;
}

.hidden {
    display: none !important;
}


/* ================= STORIES ================= */

.stories-wrapper {
    max-width: 630px;
    margin: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 17px 15px;
    overflow: hidden;
}

.stories {
    display: flex;
    gap: 19px;
    overflow-x: auto;
    scrollbar-width: none;
}

.stories::-webkit-scrollbar {
    display: none;
}

.story {
    min-width: 66px;
    text-align: center;
    cursor: pointer;
}

.story-image {
    position: relative;
    width: 66px;
    height: 66px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(
        45deg,
        #feda75,
        #fa7e1e,
        #d62976,
        #962fbf,
        #4f5bd5
    );
}

.story-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
}

.story span {
    display: block;
    font-size: 11px;
    margin-top: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-story {
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-weight: bold;
}


/* ================= FEED ================= */

.feed {
    width: 630px;
    max-width: 100%;
    margin: 24px auto;
}

.post {
    border-bottom: 1px solid var(--border);
    padding-bottom: 22px;
    margin-bottom: 25px;
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-info img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-size: 14px;
    font-weight: 700;
}

.location {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.post-menu {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}

.post-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 7px;
}

.action-left {
    display: flex;
    gap: 17px;
}

.action-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 23px;
    cursor: pointer;
    transition: transform .15s;
}

.action-btn:hover {
    transform: scale(1.08);
}

.like-btn.liked {
    color: #ed4956;
}

.save-btn.saved {
    color: var(--text);
}

.likes {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 7px;
}

.caption {
    font-size: 14px;
    line-height: 1.5;
}

.caption strong {
    margin-right: 5px;
}

.comments {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.comment-box {
    display: flex;
    align-items: center;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.comment-box input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
}

.comment-box button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}


/* ================= PAGE TITLES ================= */

.page-title {
    margin-bottom: 25px;
}

.page-title h1 {
    font-size: 25px;
}


/* ================= SEARCH ================= */

.search-page {
    max-width: 700px;
}

.search-box {
    height: 48px;
    background: var(--hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 25px;
}

.search-box i {
    color: var(--muted);
}

.search-box input {
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    font-size: 15px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-user {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px;
    border-radius: 10px;
}

.search-user:hover {
    background: var(--hover);
}

.search-user img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.search-user div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-user span {
    color: var(--muted);
    font-size: 13px;
}


/* ================= EXPLORE ================= */

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.explore-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: .2s;
}

.explore-grid img:hover {
    opacity: .8;
}


/* ================= REELS ================= */

.reels-container {
    width: 420px;
    max-width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.reel-card {
    position: relative;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
}

.reel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(
        transparent,
        rgba(0,0,0,.8)
    );
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.reel-overlay p {
    font-size: 13px;
    margin-top: 7px;
}

.reel-actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.reel-actions button {
    border: 0;
    background: transparent;
    color: white;
    font-size: 24px;
}


/* ================= MESSAGES ================= */

.messages-layout {
    height: 700px;
    max-width: 900px;
    margin: auto;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 300px 1fr;
}

.chat-list {
    border-right: 1px solid var(--border);
    padding: 20px;
}

.chat-list h2 {
    margin-bottom: 25px;
}

.chat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 7px;
    border-radius: 8px;
    cursor: pointer;
}

.chat:hover,
.chat.active {
    background: var(--hover);
}

.chat img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.chat div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat span {
    font-size: 12px;
    color: var(--muted);
}

.chat-window {
    display: grid;
    place-items: center;
}

.empty-chat {
    text-align: center;
    max-width: 280px;
}

.empty-chat > i {
    width: 70px;
    height: 70px;
    border: 1px solid var(--text);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: auto auto 18px;
    font-size: 30px;
}

.empty-chat h2 {
    margin-bottom: 10px;
}

.empty-chat p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.empty-chat button {
    background: var(--accent);
    border: 0;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
}


/* ================= NOTIFICATIONS ================= */

.notification-list {
    max-width: 650px;
    margin: auto;
}

.notification {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 5px;
}

.notification img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.notification p {
    flex: 1;
    font-size: 13px;
}

.notification small {
    color: var(--muted);
    margin-left: 5px;
}

.follow-btn {
    border: 0;
    background: var(--accent);
    color: white;
    border-radius: 7px;
    padding: 8px 14px;
    font-weight: 700;
}


/* ================= PROFILE ================= */

.profile-header {
    display: flex;
    gap: 70px;
    padding: 30px 30px 50px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-info {
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.profile-name-row h2 {
    margin-right: 10px;
}

.profile-name-row button {
    border: 0;
    background: var(--hover);
    color: var(--text);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.profile-name-row .settings-btn {
    background: transparent;
    font-size: 18px;
}

.profile-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
}

.profile-stats div {
    display: flex;
    gap: 5px;
}

.profile-stats span {
    color: var(--muted);
}

.bio {
    font-size: 14px;
    line-height: 1.6;
}

.profile-tabs {
    display: flex;
    justify-content: center;
    gap: 70px;
    border-bottom: 1px solid var(--border);
}

.profile-tabs button {
    padding: 17px 10px;
    border: 0;
    border-top: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.profile-tabs button.active {
    color: var(--text);
    border-top-color: var(--text);
}

.profile-tabs i {
    margin-right: 5px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.profile-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}


/* ================= MODAL ================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    place-items: center;
    z-index: 500;
    padding: 20px;
}

.modal.show {
    display: grid;
}

.modal-box {
    background: var(--card);
    color: var(--text);
    width: 500px;
    max-width: 100%;
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 15px;
}

.modal-header button {
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

.upload-area {
    padding: 50px 30px;
    text-align: center;
}

.upload-area > i {
    font-size: 60px;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--muted);
    margin-bottom: 25px;
}

.upload-area input,
.upload-area textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: transparent;
    color: var(--text);
    margin-bottom: 12px;
    font-family: inherit;
}

.upload-area textarea {
    height: 90px;
    resize: none;
}

.upload-area button {
    width: 100%;
    border: 0;
    background: var(--accent);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}


/* ================= MOBILE HEADER ================= */

.mobile-header {
    display: none;
}


/* ================= MOBILE NAV ================= */

.mobile-nav {
    display: none;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {

    .sidebar {
        width: 75px;
        padding: 25px 10px;
    }

    .brand {
        justify-content: center;
        padding: 5px 0 35px;
    }

    .brand > div:last-child,
    .menu-item span,
    .more-btn span {
        display: none;
    }

    .sidebar.brand span {
        font-size: 25px;
        color: black;
    }

    .menu-item {
        justify-content: center;
        padding: 15px 5px;
    }

    .main {
        margin-left: 75px;
    }

    .profile-header {
        gap: 35px;
    }
}


@media (max-width: 700px) {

    body {
        padding-bottom: 58px;
    }

    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 0 0 25px;
    }

    .sidebar.brand span {
        font-size: 25px;
        color: black;
    }

    .mobile-header {
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 17px;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        background: var(--bg);
        z-index: 50;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 7px;
    }

    .mobile-brand i {
        font-size: 23px;
    }

    .mobile-brand strong {
        font-family: "Grand Hotel", cursive;
        font-size: 24px;
        font-weight: 400;
    }

    .mobile-brand small {
        color: var(--muted);
        font-size: 8px;
        align-self: flex-end;
        margin-bottom: 13px;
    }

    .mobile-actions {
        display: flex;
        gap: 18px;
    }

    .mobile-actions button {
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 21px;
    }

    .stories-wrapper {
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        padding: 13px 12px;
    }

    .feed {
        width: 100%;
        margin-top: 0;
    }

    .post {
        padding-bottom: 15px;
        margin-bottom: 12px;
    }

    .post-header {
        padding: 10px 13px;
    }

    .post-image {
        border-radius: 0;
    }

    .post-actions,
    .likes,
    .caption,
    .comments,
    .comment-box {
        margin-left: 13px;
        margin-right: 13px;
    }

    .mobile-nav {
        position: fixed;
        display: flex;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: var(--bg);
        border-top: 1px solid var(--border);
        z-index: 200;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav button {
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 22px;
        cursor: pointer;
    }

    .mobile-nav button img {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        object-fit: cover;
    }

    .explore-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-title {
        padding: 20px 15px 0;
    }

    .search-box {
        margin: 15px;
    }

    .search-results {
        padding: 0 15px;
    }

    .profile-header {
        flex-direction: column;
        gap: 25px;
        padding: 25px 15px;
    }

    .profile-avatar {
        width: 90px;
        height: 90px;
    }

    .profile-name-row {
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .profile-stats {
        gap: 25px;
        justify-content: space-between;
    }

    .profile-tabs {
        gap: 40px;
    }

    .messages-layout {
        height: calc(100vh - 116px);
        border: 0;
        display: block;
    }

    .chat-list {
        border: 0;
    }

    .chat-window {
        display: none;
    }

    .reel-card {
        height: calc(100vh - 130px);
        border-radius: 0;
    }

    .reels-container {
        width: 100%;
    }

    .notifications-page {
        padding: 0 15px;
    }
}


@media (max-width: 420px) {

    .profile-stats {
        gap: 12px;
    }

    .profile-tabs {
        gap: 20px;
    }

    .brand h2 {
        font-size: 24px;
    }
}