/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Slim Transparent Header */
.header {
    background: rgba(242, 240, 237, 0.755); /* Semi-transparent color */
    backdrop-filter: blur(5px); /* Adds a glass-like blur effect */
    padding: 0.8rem 0; /* Reduced padding */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease-in-out; /* Smooth transition */
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Slightly reduced padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: rgb(79, 72, 72);
    font-size: 1.5rem; /* Slightly smaller */
    font-weight: 600;
    text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.4);
}


.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav a {
    color: rgb(81, 73, 73);
    text-decoration: none;
    padding: 0.5rem 1rem;
    text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.nav a:hover, .nav a.active {
    background-color: rgba(159, 146, 146, 0.4);
}

.login-btn {
    background-color: white;
    color: #1e3c72;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
}

/* Admin Panel */
.admin-panel {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.input-group textarea {
    min-height: 200px;
    resize: vertical;
}

.image-preview {
    margin-top: 1rem;
    max-width: 200px;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn.primary {
    background-color: #1e3c72;
    color: white;
}

.btn.secondary {
    background-color: #e9ecef;
    color: #333;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Grid Layout */
.grid-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.grid-item:hover {
    transform: translateY(-5px);
}

.grid-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: #e9ecef;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.post-content h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #1e3c72;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1rem;
}

.post-meta {
    font-size: 0.9rem;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Filter Container */
/* Arrange filters in a row */
.filter-container {
    display: flex; /* Enables flexbox */
    justify-content: space-between; /* Spaces elements out */
    align-items: center; /* Aligns items vertically */
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
    width: 300px; /* Set a fixed width */
}

.search-box input {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 0.8rem; /* Smaller padding */
    
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #1e3c72;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #1e3c72;
    color: #1e3c72;
}

.filter-btn.active {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1100;
}
.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
}
/* Continue Modal Styles */
.modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

/* Footer Styles */
.footer {
    background: rgba(83, 85, 91, 0.5); /* Semi-transparent color */
    backdrop-filter: blur(5px); /* Adds a glass-like blur effect */
    
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: white;
    color: #1e3c72;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background-color: #e9ecef;
    color: #333;
}

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

/* Messages */
.error-message,
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 4px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background-color: #dc3545;
    color: white;
}

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

/* No Posts State */
.no-posts {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
}

.no-posts h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
}

.no-posts p {
    color: #666;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav {
        flex-direction: column;
        width: 100%;
    }

    .nav a {
        width: 100%;
        text-align: center;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.hide {
    display: none !important;
}

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

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.p-2 {
    padding: 2rem;
}
