.blog-form-container {
    width: min(900px, 92vw);
    margin: 4rem auto;
    background-color: var(--surface-color);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    text-align: left;
}

.blog-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    color: var(--text-color-black);
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 1px solid rgba(22, 35, 42, 0.2);
    border-radius: var(--radius);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color-black);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 80, 86, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 250px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.submit-btn {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast-notification {
    background-color: var(--surface-color);
    color: var(--text-color-black);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-left: 4px solid var(--accent-color);
    pointer-events: auto;
    animation: slideInToast 0.4s ease forwards, fadeOutToast 0.4s ease 3.6s forwards;
    max-width: 350px;
}

.toast-error {
    border-left-color: #D64933; /* AITT Red */
}

.toast-success {
    border-left-color: #98CE00; /* AITT Green */
}

@keyframes slideInToast {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutToast {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Markdown Toolbar */
.md-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 0.5rem;
    background-color: var(--surface-color);
    padding: 0.5rem;
    border: 1px solid rgba(22, 35, 42, 0.2);
    border-bottom: 1px solid rgba(22, 35, 42, 0.2);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.md-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: all 0.2s ease;
}

#uploadImageBtn {
    width: auto;
    padding: 0 1rem;
    gap: 0.5rem;
}

.md-btn:hover {
    background-color: rgba(22, 35, 42, 0.05);
    border-color: rgba(22, 35, 42, 0.1);
    color: var(--primary-color);
}

/* Markdown Tabs */
.md-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: all 0.2s ease;
}

.md-tab-btn:hover {
    color: var(--primary-color);
}

.md-tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
}

/* View Page Flex Layout */
.view-main-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 2000px;
    margin: 0 auto;
    padding: 1rem 0rem;
    gap: 1rem;
}

.view-main-layout .blog-form-container {
    margin: 0;
    width: 100%;
    max-width: 650px;
}

/* Table of Contents - Medium Sidebar */
#mediumSidebar {
    position: sticky;
    top: 100px;
    width: 200px;
    /* max-width: 150px; */
    background: transparent;
    border: none;
    box-shadow: none;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#mediumSidebar a {
    display: block; 
    color: #6b6b6b; 
    text-decoration: none; 
    font-size: 0.9rem; 
    margin-bottom: 0.8rem; 
    font-family: 'Manrope', sans-serif; 
    transition: color 0.2s ease;
}

#mediumSidebar a:hover {
    color: var(--primary-color);
}

/* Sidebar & Layout Mobile Responsiveness */
@media (max-width: 1150px) {
    .view-main-layout {
        flex-direction: column;
        align-items: center;
    }
    
    #mediumSidebar {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 850px;
    }
}

/* KaTeX Safety Rule */
.katex-display { overflow-x: auto; overflow-y: hidden; padding-bottom: 0.5rem; }

/* Blogs Feed Sidebar Layout */
.blogs-main-layout {
    display: flex;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    align-items: flex-start;
}

.blogs-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(22, 35, 42, 0.05);
    position: sticky;
    top: 100px;
}

.blogs-feed {
    flex-grow: 1;
    min-width: 0;
}

#clearFiltersBtn:hover {
    background-color: var(--primary-color) !important;
}

@media (max-width: 1024px) {
    .blogs-main-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .blogs-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
}
