/* Components CSS - Extracted from inline styles */

/* CSRF Token Notification Styles */
.csrf-notification {
    position: relative;
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.csrf-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

.csrf-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.csrf-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #ff9800;
}

.csrf-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.csrf-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.csrf-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Controls Styles */
.admin-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: flex-start;
    align-items: center;
}

.admin-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    cursor: pointer;
}

.admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.admin-btn i {
    font-size: 14px;
}

/* Specific button styles */
.admin-btn.btn-primary {
    background-color: #007bff;
    color: white;
}

.admin-btn.btn-primary:hover {
    background-color: #0056b3;
    color: white;
}

.admin-btn.btn-success {
    background-color: #28a745;
    color: white;
}

.admin-btn.btn-success:hover {
    background-color: #1e7e34;
    color: white;
}

.admin-btn.btn-danger {
    background-color: #dc3545;
    color: white;
}

.admin-btn.btn-danger:hover {
    background-color: #c82333;
    color: white;
}

.post-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.post-footer .read-more-btn {
    align-self: flex-start;
}

.post-footer .post-stats {
    align-self: flex-end;
    margin-top: auto;
}

/* Make sure admin controls are visible */
.post-card .admin-controls {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-controls {
        justify-content: center;
        margin: 15px 0;
        flex-wrap: wrap;
    }

    .admin-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
    }

    .post-footer {
        align-items: center;
    }

    .post-footer .read-more-btn,
    .post-footer .post-stats {
        align-self: center;
    }
}

/* Auto-save notification styles */
.auto-save-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success, #28a745);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* File upload preview styles */
.file-preview {
    margin-top: 10px;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.file-name {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Search and Filter Bar Styles */
.search-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.section-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.clear-search-btn:hover {
    color: #dc3545;
    background-color: #f8f9fa;
}

.posts-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Blog Form Container Animation */
.blog-form-container {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-results .no-posts-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design for Search and Filter */
@media (max-width: 768px) {
    .search-filter-bar {
        flex-direction: column;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .section-header-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    #toggleFormBtn {
        width: 100%;
    }
}