body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
}

header {
    background-color: #222222; /* Slightly lighter dark header */
    color: #f0f0f0;
    padding: 1.5em 0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-bottom: 1px solid #333;
}

h1 {
    margin: 0;
    font-size: 2.5em;
    color: #f0f0f0;
}

main {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px; /* Space between h2 and filter */
}

.section-header h2 {
    color: #f0f0f0;
    margin: 0;
    font-size: 2em;
    text-align: left; /* Align h2 to left */
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-container label {
    color: #b0b0b0;
    font-size: 0.9em;
}

#tag-filter {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    -webkit-appearance: none; /* Remove default dropdown arrow */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px; /* Make space for custom arrow */
}

#tag-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-item {
    background-color: #282828; /* Dark card background */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4); /* Darker, more pronounced shadow */
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    border: 1px solid #3a3a3a; /* Subtle border for definition */
}

.blog-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.blog-item-image-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    position: relative;
    overflow: hidden;
    background-color: #333; /* Darker placeholder background */
}

.blog-item-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-item-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #f0f0f0; /* Light text */
    font-size: 1.4em;
    line-height: 1.3;
}

.blog-item .meta-info {
    font-size: 0.85em;
    color: #b0b0b0; /* Slightly lighter grey for meta info */
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.blog-item .tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.blog-item .tag {
    background-color: #444;
    color: #eee;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
}

/* Pagination controls for list page */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #3a3a3a;
}

.pagination-controls button {
    background-color: #007bff; /* Accent color for buttons */
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s, opacity 0.2s;
    font-weight: bold;
}

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

.pagination-controls button:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

#page-info {
    color: #b0b0b0;
    font-size: 0.9em;
}

#blog-detail-section {
    background-color: #282828; /* Dark section background */
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid #3a3a3a;
}

#blog-detail-section img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 30px auto;
    border-radius: 5px;
}

#blog-detail-section h2 {
    color: #f0f0f0;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 2.2em;
    text-align: left;
}

#blog-detail-section .blog-date {
    font-size: 0.9em;
    color: #b0b0b0;
    margin-bottom: 25px;
    display: block;
}

#blog-detail-section p {
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 1em;
}

.blog-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #3a3a3a; /* Darker border for separation */
}

.blog-navigation button {
    background-color: #007bff; /* Accent color for buttons */
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.2s, opacity 0.2s;
    font-weight: bold;
}

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

.blog-navigation button:disabled {
    background-color: #444; /* Darker disabled state */
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

#back-to-list {
    background-color: #5a6268; /* Different shade for back button */
    margin-bottom: 25px;
}

#back-to-list:hover {
    background-color: #495057;
}

.hidden {
    display: none;
}

.active {
    display: block;
}

@media (max-width: 768px) {
    header {
        padding: 1em 0;
    }
    h1 {
        font-size: 2em;
    }
    main {
        margin: 20px auto;
        padding: 0 15px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .section-header h2 {
        text-align: center;
        width: 100%;
    }
    .filter-container {
        width: 100%;
        justify-content: center; /* Center filter on small screens */
    }
    #tag-filter {
        width: 100%;
        max-width: 250px;
    }
    #blog-list {
        grid-template-columns: 2fr;  
        gap: 25px;
    }
    /* .blog-item {
        max-width: 400px;  
        margin: 0 auto;  
    }
    .blog-item h3 {
        font-size: 1.2em;
    }
    .blog-item-content {
        padding: 15px;
    }
    #blog-detail-section {
        padding: 25px;
    }
    #blog-detail-section h2 {
        font-size: 1.8em;  
    } */
    .blog-navigation {
        flex-direction: column;
        gap: 15px;
    }
    .blog-navigation button {
        width: 100%;
    }
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
    .pagination-controls button {
        width: 100%;
        max-width: 200px; /* Limit width of pagination buttons */
    }
}