/* =========================================================
   GLOBAL
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Segoe UI Historic", "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: #f2f4f7;
}


/* =========================================================
   MAIN LAYOUT
   DESKTOP:
   SIDEBAR 15% | TIMELINE 75% | AD 10%
========================================================= */

.container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}


/* =========================================================
   TOP MENU BAR
========================================================= */

.topbar {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 56px;

    background-color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 16px;

    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);

    z-index: 1000;
}

.topbar .menu {
    display: flex;
    gap: 15px;
}


/* =========================================================
   HAMBURGER
========================================================= */

.hamburger {
    font-size: 24px;
    cursor: pointer;
    display: none;
    margin-right: 10px;
}


/* =========================================================
   SIDEBAR
   DESKTOP = 15%
========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;

    width: 15%;
    height: 100vh;

    padding: 76px 16px 16px;

    margin: 0;

    background-color: #f2f4f7;

    overflow-y: auto;

    z-index: 900;

    transition: left 0.3s ease;
}

.sidebar a {
    display: block;

    padding: 10px;

    border-radius: 8px;

    text-decoration: none;

    color: #333;
}

.sidebar a:hover {
    background-color: #e4e6eb;
}


/* =========================================================
   TIMELINE
   DESKTOP = 60%
========================================================= */

.timeline {
    width: 60%;

    margin-left: 15%;
    margin-right: 10%;
    margin-top: 56px;

    min-height: calc(100vh - 56px);

    padding: 30px;

    background: #ffffff;

    /* Keep border on web */
    border: 1px solid #e1e4e8;

    border-radius: 8px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.08);
}

.timeline h2 {
    margin-top: 0;

    font-size: 24px;

    color: #333;
}

.timeline h4 {
    margin-top: 25px;
    margin-bottom: 15px;

    font-size: 16px;

    color: #1877f2;

    border-bottom: 1px solid #eee;

    padding-bottom: 8px;
}

.timeline label {
    display: block;

    margin-bottom: 6px;

    font-weight: 500;

    color: #444;
}

.timeline input,
.timeline textarea,
.timeline select {
    width: 100%;

    padding: 12px;

    border: 1px solid #ddd;

    border-radius: 8px;

    font-size: 14px;

    box-sizing: border-box;

    margin-bottom: 15px;

    background: #fff;
}

.timeline input:focus,
.timeline textarea:focus,
.timeline select:focus {
    outline: none;

    border-color: #1877f2;
}

.timeline textarea {
    min-height: 100px;

    resize: vertical;
}

.timeline input[readonly] {
    background: #f5f5f5;

    color: #777;

    cursor: not-allowed;
}

.timeline button {
    width: 100%;

    background: #1877f2;

    color: white;

    border: none;

    padding: 13px;

    border-radius: 8px;

    font-size: 16px;

    cursor: pointer;

    margin-top: 10px;
}

.timeline button:hover {
    background: #0f5ec7;
}

.timeline img {
    border-radius: 50%;

    object-fit: cover;
}


/* =========================================================
   RIGHT BAR / AD
   DESKTOP = 25%
========================================================= */

.rightbar {
    position: fixed;

    top: 0;
    right: 0;

    width: 25%;
    height: 100vh;

    padding: 76px 16px 16px;

    margin: 0;

    background-color: #f2f4f7;

    overflow-y: auto;

    z-index: 800;
}


/* =========================================================
   CARD
========================================================= */

.card {
    background: #ffffff;

    padding: 16px;

    border-radius: 12px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.06);

    margin-bottom: 16px;
}


/* =========================================================
   INPUTS
========================================================= */

textarea,
input {
    width: 100%;

    padding: 12px 14px;

    margin-bottom: 16px;

    border: 1px solid #ccd0d5;

    border-radius: 8px;

    font-size: 14px;

    outline: none;

    transition: border-color 0.2s;
}

textarea:focus,
input:focus {
    border-color: #1877f2;
}


/* =========================================================
   BUTTONS
========================================================= */

button.post-btn {
    background-color: #1877f2;

    color: white;

    border: none;

    padding: 12px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 16px;

    transition: background-color 0.2s;

    width: 100%;
}

button.post-btn:hover {
    background-color: #166fe5;
}


/* =========================================================
   POST ACTION BUTTONS
========================================================= */

.card .action-btn {
    background-color: transparent;

    color: #65676b;

    border: none;

    padding: 4px 8px;

    font-size: 13px;

    border-radius: 6px;

    cursor: pointer;

    margin-right: 8px;
}

.card .action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}


/* =========================================================
   CREATE POST EDITOR
========================================================= */

.create-post-card [contenteditable] {
    width: 100%;

    padding: 10px;

    border: 1px solid #ddd;

    border-radius: 8px;

    background: #fff;

    font-size: 14px;

    min-height: 80px;
}

#create-post input[type="file"] {
    display: block;
}

#create-post #image-preview img {
    max-width: 100%;

    border-radius: 8px;

    margin-top: 8px;
}


/* =========================================================
   REGISTER PAGE STYLES
========================================================= */

.register-container {
    background: #ffffff;

    padding: 32px;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    max-width: 400px;

    width: 90%;

    margin: 60px auto;
}

.register-container h1 {
    margin-bottom: 10px;

    font-size: 24px;

    text-align: center;

    color: #111;
}

.register-container p.description {
    font-size: 14px;

    color: #65676b;

    text-align: center;

    margin-bottom: 24px;

    line-height: 1.5;
}

.register-container form input {
    width: 100%;

    padding: 12px 14px;

    margin-bottom: 16px;

    border: 1px solid #ccd0d5;

    border-radius: 8px;

    font-size: 14px;

    outline: none;

    transition: border-color 0.2s;
}

.register-container form input:focus {
    border-color: #1877f2;
}

.register-container form button {
    width: 100%;

    padding: 12px;

    background-color: #1877f2;

    color: white;

    border: none;

    border-radius: 8px;

    font-size: 16px;

    cursor: pointer;

    transition: background-color 0.2s;
}

.register-container form button:hover {
    background-color: #166fe5;
}

.register-container .terms {
    font-size: 12px;

    color: #65676b;

    margin-top: 12px;

    line-height: 1.4;
}

.register-container .terms a {
    color: #1877f2;

    text-decoration: none;
}

.register-container .terms a:hover {
    text-decoration: underline;
}

.register-container .bottom-text {
    font-size: 13px;

    color: #65676b;

    text-align: center;

    margin-top: 16px;
}

.register-container .bottom-text a {
    color: #1877f2;

    text-decoration: none;

    margin-left: 4px;
}

.register-container .bottom-text a:hover {
    text-decoration: underline;
}


/* =========================================================
   LOGIN PAGE STYLES
========================================================= */

.login-container {
    background: #ffffff;

    padding: 32px;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    width: 100%;
    max-width: 420px;

    margin: 80px auto 40px;
}

.login-container h2 {
    font-size: 24px;

    text-align: center;

    margin-bottom: 12px;

    color: #111;
}

.login-container p.description {
    font-size: 14px;

    color: #65676b;

    text-align: center;

    margin-bottom: 24px;

    line-height: 1.5;
}

.login-container label {
    display: block;

    margin-bottom: 6px;

    font-size: 14px;

    font-weight: 600;
}

.login-container input {
    width: 100%;

    padding: 12px 14px;

    margin-bottom: 16px;

    border: 1px solid #ccd0d5;

    border-radius: 8px;

    font-size: 15px;
}

.login-container input:focus {
    border-color: #1877f2;
}

.login-container button {
    width: 100%;

    padding: 13px;

    background: #1877f2;

    color: #fff;

    border: none;

    border-radius: 8px;

    font-size: 16px;

    cursor: pointer;
}

.login-container button:hover {
    background: #166fe5;
}

.login-container .bottom-text {
    text-align: center;

    font-size: 14px;

    margin-top: 20px;
}

.login-container .bottom-text a {
    color: #1877f2;

    text-decoration: none;
}

.login-container .bottom-text a:hover {
    text-decoration: underline;
}


/* =========================================================
   MOBILE
   FULL SCREEN WHITE TIMELINE
========================================================= */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        min-width: 100%;

        margin: 0;
        padding: 0;

        background: #ffffff;

        overflow-x: hidden;
    }


    /* -----------------------------------------
       Main container
    ----------------------------------------- */

    .container {
        display: block;

        width: 100%;
        min-width: 100%;

        min-height: 100vh;

        margin: 0;
        padding: 0;

        background: #ffffff;
    }


    /* -----------------------------------------
       Topbar
    ----------------------------------------- */

    .topbar {
        height: 56px;

        padding: 0 12px;

        background: #ffffff;

        border: none;

        box-shadow: none;
    }

    .hamburger {
        display: block;
    }

    .topbar .menu {
        display: none;
    }


    /* -----------------------------------------
       Sidebar
    ----------------------------------------- */

    .sidebar {
        position: fixed;

        top: 0;
        left: -260px;

        width: 260px;
        height: 100vh;

        padding: 16px;

        padding-top: 70px;

        margin: 0;

        background-color: #ffffff;

        border: none;

        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);

        z-index: 2000;

        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }


    /* -----------------------------------------
       Timeline
       100% SCREEN WIDTH
    ----------------------------------------- */

    .timeline {
        display: block;

        width: 100% !important;

        max-width: none !important;

        min-width: 100%;

        margin: 0 !important;

        padding: 70px 0 20px !important;

        min-height: 100vh;

        background: #ffffff;

        border: none !important;

        border-radius: 0 !important;

        box-shadow: none !important;

        overflow-x: hidden;
    }


    /* -----------------------------------------
       Timeline cards
       Remove desktop borders/shadows
    ----------------------------------------- */

    .timeline .card,
    .timeline .create-post-card {
        width: 100% !important;

        max-width: none !important;

        margin: 0 0 10px !important;

        padding: 16px !important;

        background: #ffffff !important;

        border: none !important;

        border-radius: 0 !important;

        box-shadow: none !important;
    }


    /* -----------------------------------------
       Timeline inputs
    ----------------------------------------- */

    .timeline input,
    .timeline textarea,
    .timeline select {
        width: 100%;

        max-width: 100%;

        border-radius: 0;

        border-left: none;
        border-right: none;
    }


    /* -----------------------------------------
       Timeline headings
    ----------------------------------------- */

    .timeline h2 {
        margin-left: 16px;
        margin-right: 16px;

        font-size: 22px;
    }

    .timeline h4 {
        margin-left: 16px;
        margin-right: 16px;
    }


    /* -----------------------------------------
       Images
    ----------------------------------------- */

    .timeline img {
        max-width: 100%;

        height: auto;
    }

    #create-post #image-preview img {
        width: 100%;

        max-width: 100%;

        border-radius: 0;

        margin-top: 8px;
    }


    /* -----------------------------------------
       Right bar / Ads
    ----------------------------------------- */

    .rightbar {
        display: none !important;
    }


    /* -----------------------------------------
       Login mobile
       KEPT FROM YOUR ORIGINAL CSS
    ----------------------------------------- */

    .login-container {
        width: calc(100% - 16px);

        max-width: none;

        margin: 65px 8px 20px;

        padding: 28px 20px;

        border-radius: 12px;

        box-shadow: none;

        border: 1px solid #e5e7eb;
    }

    .login-container h2 {
        font-size: 24px;
    }

    .login-container p.description {
        font-size: 14px;
    }

    .login-container input {
        padding: 14px 16px;

        font-size: 16px;

        height: 48px;
    }

    .login-container button {
        padding: 14px;

        font-size: 17px;

        height: 50px;
    }
}


/* =========================================================
   MOBILE — TRUE FULL SCREEN MOBILE LAYOUT
========================================================= */

@media (max-width: 768px) {

    /* ---------- Page ---------- */

    html,
    body {
        width: 100%;
        min-width: 100%;
        margin: 0;
        padding: 0;

        background: #ffffff !important;

        overflow-x: hidden;
    }


    /* ---------- Main container ---------- */

    .container {
        display: block !important;

        width: 100% !important;
        max-width: none !important;
        min-width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        background: #ffffff !important;
    }


    /* ---------- Top bar ---------- */

    .topbar {
        position: fixed;

        top: 0;
        left: 0;

        width: 100% !important;
        max-width: none !important;

        height: 56px;

        padding: 0 16px;

        background: #ffffff !important;

        border: none !important;

        box-shadow: none !important;

        z-index: 3000;
    }

    .hamburger {
        display: block;
    }

    .topbar .menu {
        display: none;
    }


    /* ---------- Sidebar ---------- */

    .sidebar {
        position: fixed;

        top: 0;
        left: -280px;

        width: 280px !important;
        max-width: 280px !important;

        height: 100vh;

        margin: 0 !important;

        padding: 70px 16px 16px;

        background: #ffffff !important;

        border: none !important;

        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);

        z-index: 4000;

        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }


    /* =====================================================
       TIMELINE
       TRUE 100% MOBILE WIDTH
    ===================================================== */

    .timeline {
        display: block !important;

        position: relative;

        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;

        /* Remove desktop positioning */
        margin: 0 !important;

        /* Space for fixed topbar */
        padding: 76px 24px 40px !important;

        min-height: 100vh;

        background: #ffffff !important;

        /* Remove ALL desktop box styling */
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;

        overflow-x: hidden;
    }


    /* =====================================================
       REMOVE DESKTOP CARD APPEARANCE
    ===================================================== */

    .timeline .card,
    .timeline .create-post-card,
    .timeline > div {
        max-width: 100% !important;
    }


    .timeline .card,
    .timeline .create-post-card {
        width: 100% !important;

        margin: 0 0 18px !important;

        padding: 20px !important;

        background: #ffffff !important;

        border: none !important;

        border-radius: 0 !important;

        box-shadow: none !important;
    }


    /* =====================================================
       MOBILE FORM ELEMENTS
    ===================================================== */

    .timeline input,
    .timeline textarea,
    .timeline select {
        display: block;

        width: 100% !important;
        max-width: 100% !important;

        margin-bottom: 16px;

        padding: 14px;

        background: #ffffff !important;

        border: 1px solid #ddd;

        border-radius: 8px;

        font-size: 16px;
    }


    /* =====================================================
       MOBILE HEADINGS
    ===================================================== */

    .timeline h2 {
        margin-top: 0;

        margin-left: 0;
        margin-right: 0;

        font-size: 22px;
    }

    .timeline h4 {
        margin-left: 0;
        margin-right: 0;
    }


    /* =====================================================
       MOBILE IMAGES
    ===================================================== */

    .timeline img {
        max-width: 100% !important;

        height: auto;
    }

    #create-post #image-preview img {
        width: 100% !important;
        max-width: 100% !important;

        border-radius: 0;

        margin-top: 8px;
    }


    /* =====================================================
       HIDE DESKTOP RIGHT BAR
    ===================================================== */

    .rightbar {
        display: none !important;
    }
}