/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: black;
    transition: background 0.3s, color 0.3s;
}

/* Container */
.container {
    width: 80%;
    margin: auto;
    padding: 20px;
}

/* Heading */
h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
    color: black;
}

/* Blog Form Styling */
.blog-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Input Fields */
.blog-form input,
.blog-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    resize: none;
}

/* Button Styling */
button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Blog Posts Container */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Auto-fit grid for responsive design */
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Blog Card */
.blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: white;
    transition: transform 0.3s;
}

.blog-card:hover {
    transform: scale(1.02);
}

.blog-header {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.blog-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.blog-content {
    padding: 10px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #007bff;
}

.blog-card h2 {
    margin: 0;
    font-size: 22px;
    color: black;
}

.blog-card p {
    font-size: 16px;
    color: black;
    margin: 5px 0;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    opacity: 0.8;
}

/* Dark Mode Styling */
.dark-mode {
    background-color: #222;
    color: white;
}

.dark-mode .blog-card {
    background: #444;
    color: white;
}

.dark-mode .blog-form {
    background: #333;
    color: white;
    border: 1px solid white;
}

.dark-mode .blog-form input,
.dark-mode .blog-form textarea {
    background: #444;
    color: white;
    border: 1px solid white;
}

/* Navbar Styling */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #333;
    padding: 15px 20px;
    color: white;
}

/* Logo */
.nav-left .logo {
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

/* Centered Search Bar */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-center input {
    width: 50%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    outline: none;
}

/* Right-side Navigation */
.nav-right {
    display: flex;
    gap: 15px;
}

.nav-right a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    transition: 0.3s;
}

.nav-right a:hover {
    background: #555;
    border-radius: 5px;
}

/* My Blogs Page */
h2 {
    text-align: center;
    margin-top: 20px;
    font-size: 28px;
}

/* Blog Cards */
#my-posts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
}

/* Individual Blog Card */
.blog-card {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    width: 320px;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

.blog-card:hover {
    transform: scale(1.02);
}

.blog-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.blog-card p {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.blog-card .read-more {
    color: #007bff;
    font-weight: bold;
    cursor: pointer;
}

.blog-card .read-more:hover {
    text-decoration: underline;
}

/* Buttons for Edit & Delete */
.blog-card button {
    margin-top: 10px;
    padding: 7px 12px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.blog-card button:first-of-type {
    background-color: #ffc107;
    color: black;
}

.blog-card button:first-of-type:hover {
    background-color: #e0a800;
}

.blog-card button:last-of-type {
    background-color: #dc3545;
    color: white;
}

.blog-card button:last-of-type:hover {
    background-color: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .nav-center {
        margin-top: 10px;
        width: 100%;
    }

    #search-bar {
        width: 80%;
    }

    .blog-card {
        width: 90%;
    }
}

/* ✅ Category Dropdown Styling */
#category-filter {
    width: 200px;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #007BFF;  /* Blue border */
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

/* ✅ Dropdown Hover Effect */
#category-filter:hover {
    background-color: #007BFF;  /* Blue background on hover */
    color: white;
}

/* ✅ When dropdown is focused */
#category-filter:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 8px rgba(0, 91, 187, 0.5);
}

/* ✅ Styling the Category Dropdown Options */
#category-filter option {
    font-size: 14px;
    background-color: white;
    color: black;
}
/* ✅ Search Box Styling */
.search-container {
    text-align: center;
    margin: 20px 0;
}

#search-box {
    width: 250px;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 2px solid #007BFF;
    outline: none;
    transition: 0.3s ease-in-out;
}

/* ✅ Search Box Focus Effect */
#search-box:focus {
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 91, 187, 0.5);
}
