/* -------------------------------------------------------
   GENERAL LAYOUT
------------------------------------------------------- */
body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    background: #f6f8fb;
    color: #111827;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* -------------------------------------------------------
   FIXED SIDEBAR — NO OVERLAP
------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 240px;            /* FIXED WIDTH */
    min-width: 240px;        /* prevents shrinking */
    height: 100vh;

    background: linear-gradient(180deg, #2b2e83, #23256a);
    color: white;

    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
}

/* Prevent child elements from expanding sidebar width */
.sidebar * {
    max-width: 100%;
    overflow-wrap: break-word;
}

.sidebar-logo {
    text-align: center;
}

.sidebar-logo img {
    width: 52px;
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: block;
    padding: 10px;
    margin-bottom: 6px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------
   MAIN CONTENT — PUSHED RIGHT, NO OVERLAP
------------------------------------------------------- */
.dashboard-main {
    flex: 1;
    padding: 30px;

    margin-left: 260px !important;   /* sidebar width + safety margin */
}

.success-message {
    padding: 10px;
    background: #d4edda;
    border-left: 4px solid #28a745;
    margin-bottom: 20px;
    border-radius: 6px;
}

/* -------------------------------------------------------
   NEW POST FORM
------------------------------------------------------- */
.new-post {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e6eaff;
    margin-bottom: 25px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}

.new-post input,
.new-post textarea,
.new-post select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.small-btn {
    background: #2b2e83;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.small-btn:hover {
    background: #4043a8;
}

/* -------------------------------------------------------
   POSTS
------------------------------------------------------- */
.post {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e6eaff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}

/* Header: Title + Delete Button */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header h3 {
    margin: 0;
    color: #2b2e83;
}

.post-delete-btn {
    background: #e74c3c;
    color: white;
    padding: 6px 14px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
}

.post-delete-btn:hover {
    background: #c0392b;
}

.post-content {
    margin: 10px 0 15px;
    font-size: 0.95rem;
}

/* IMAGE PREVIEW */
.thumbnail {
    width: 220px;
    border-radius: 8px;
    margin: 10px 0;
    cursor: pointer;
    transition: 0.2s;
}

.thumbnail:hover {
    opacity: 0.8;
}

/* DOCUMENT DOWNLOAD BUTTON */
.download-btn {
    display: inline-block;
    background: #2b2e83;
    padding: 8px 14px;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 6px;
}

.download-btn:hover {
    background: #4043a8;
}

/* -------------------------------------------------------
   COMMENTS
------------------------------------------------------- */
.comment-section {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid #ececec;
}

.comment-section h4 {
    margin-bottom: 10px;
}

.comment {
    background: #f8f9ff;
    border: 1px solid #dce3f9;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;

    position: relative;
    padding-right: 110px;
}

.comment-delete-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #ff4d4d;
    padding: 6px 10px;
    color: white;
    border-radius: 6px;
    font-size: 0.78rem;
    text-decoration: none;
}

.comment-delete-btn:hover {
    background: #cc0000;
}

.comment-section textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    resize: vertical;
    margin-top: 12px;
}

.comment-section button {
    margin-top: 8px;
    padding: 8px 12px;
    background: #2b2e83;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}

.comment-section button:hover {
    background: #4043a8;
}

/* -------------------------------------------------------
   RESPONSIVE FIXES
------------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
    }
    .dashboard-main {
        margin-left: 220px !important;
    }
}

@media (max-width: 600px) {
    .sidebar {
        position: relative; /* stacked layout on mobile */
        width: 100%;
        height: auto;
        min-width: unset;
    }

    .dashboard-main {
        margin-left: 0 !important;
        padding: 20px;
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .comment {
        padding-right: 90px;
    }
}
