body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.section-header {
    text-align: center;
    margin: 40px 0 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

/* Main section container for latest post */
.main-section-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

/* Updated form container to display all forms side by side */
.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Featured posts container - horizontal layout */
#featured-posts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}

/* Blog section specific grid layout - now horizontal */
.form-container:has(.blog-form) {
    display: flex;
    flex-direction: row;
    gap: 30px;
    max-width: 100%;
    margin: 0 auto 30px;
    align-items: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
}

form {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
}

form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #000000;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 3px rgba(0, 123, 255, 0.3);
}

button {
    width: 100%;
    padding: 12px;
    background: #a50f35;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

button:hover {
    background: #0056b3;
}

button[type="button"] {
    background: #6c757d;
}

button[type="button"]:hover {
    background: #5a6268;
}

/* Login form styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-form {
    max-width: 400px;
    width: 100%;
}

.login-form h2 {
    font-size: 24px;
    margin-bottom: 30px;
}

.content-container {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Current data display styling */
.current-data {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.post-preview {
    text-align: center;
}

.post-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.post-preview h3,
.post-preview h4 {
    margin: 10px 0;
    color: #333;
}

.post-preview .date {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.post-preview .excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-preview a {
    color: #007BFF;
    text-decoration: none;
    font-weight: 500;
}

.post-preview a:hover {
    text-decoration: underline;
}

.no-content {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Blog form styling - updated for horizontal layout */
.blog-form {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: 2px solid #e91e63;
    width: 550px !important;
    min-width: 550px !important;
    max-width: 550px;
    height: auto;
    max-height: none;
    overflow-y: visible;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 25px;
}

.blog-form h2 {
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
    font-size: 22px;
    margin-bottom: 15px;
    text-align: center;
}

.blog-form label {
    color: white;
    font-weight: 700;
    margin-bottom: 3px;
    font-size: 14px;
}

.blog-form input,
.blog-form select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.blog-form input:focus,
.blog-form select:focus {
    background: white;
    border-color: #e91e63;
    box-shadow: 0 0 5px rgba(233, 30, 99, 0.3);
}

/* Improved checkbox styling */
.form-actions {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.form-actions label {
    display: flex;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
}

.form-actions input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    margin-right: 10px;
    margin-bottom: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.form-actions input[type="checkbox"]:checked {
    background: #e91e63;
    border-color: white;
}

.form-actions input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.form-actions input[type="checkbox"]:hover {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.form-actions div {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.9;
}

.blog-form button {
    padding: 12px;
    font-size: 15px;
    margin-bottom: 10px;
}

/* Button group styling */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 45px;
    align-items: center;
}

.button-group .loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-style: italic;
    margin: 0;
}

.button-group .category-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.button-group .category-btn:hover {
    background: white;
    border-color: #e91e63;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button-group .category-btn.selected {
    background: #e91e63;
    color: white;
    border-color: white;
    box-shadow: 0 4px 8px rgba(233, 30, 99, 0.4);
}

.button-group .category-btn.selected:hover {
    background: #d81b60;
}

.button-group .clear-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: auto;
}

.button-group .clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Blog display section - updated for horizontal layout */
.blog-display {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 600px !important;
    min-width: 600px !important;
    max-width: 600px;
    height: auto;
    box-sizing: border-box;
    flex-shrink: 0;
}

.blog-display h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #f093fb;
    padding-bottom: 10px;
}

.category-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #f093fb;
}

.category-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.subcategory-section {
    margin-bottom: 18px;
}

.subcategory-title {
    font-weight: 500;
    color: #555;
    font-size: 14px;
    margin-bottom: 10px;
    text-decoration: underline;
    font-style: italic;
}

.post-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

.post-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.post-uid {
    font-size: 18px;
    color: #000000;
    font-weight: 500;
    margin-bottom: 5px;
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.post-title {
    font-size: 18px;
    color: #000000;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
}

.post-excerpt {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
}

.post-thumbnail {
    font-size: 18px;
    color: #007BFF;
    word-break: break-all;
    line-height: 1.2;
    text-decoration: underline;
}

.no-posts {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px dashed #dee2e6;
}

/* Scrollbar styling for blog sections */
.blog-form::-webkit-scrollbar,
.blog-display::-webkit-scrollbar {
    width: 8px;
}

.blog-form::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.blog-form::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.blog-form::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.blog-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.blog-display::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.blog-display::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design updates */
@media (max-width: 1400px) {
    .form-container:has(.blog-form) {
        flex-wrap: wrap;
    }

    #featured-posts-container {
        flex-wrap: wrap;
    }

    .blog-form {
        width: 350px !important;
        min-width: 350px !important;
    }

    .blog-display {
        width: 500px !important;
        min-width: 500px !important;
    }
}

@media (max-width: 1200px) {
    .form-container {
        justify-content: center;
    }

    #featured-posts-container {
        justify-content: center;
        flex-wrap: wrap;
    }

    .form-container:has(.blog-form) {
        flex-direction: column;
        align-items: center;
    }

    .blog-form,
    .blog-display {
        width: 100% !important;
        min-width: unset !important;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .main-section-container {
        flex-direction: column;
    }

    .form-container {
        flex-direction: column;
        align-items: center;
    }

    #featured-posts-container {
        flex-direction: column;
        align-items: center;
    }

    form,
    .blog-display,
    .blog-form {
        width: 100% !important;
        min-width: unset !important;
        max-width: 100%;
    }

    .section-header h1 {
        font-size: 24px;
    }

    .blog-form {
        max-height: 500px;
    }
}