* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --edit: #f39c12;
    --delete: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}
header {
    background-color: var(--primary);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}
#logo1 {
    height: 40px;
    width: auto;
}
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}
nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
nav a:hover { color: var(--secondary); }
.add-blog-btn {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}
.admin-controls {
    background: #f8f9fa;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}
.admin-controls .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
#user-status { font-size: 14px; color: #666; }
.admin-actions { display: flex; gap: 10px; }
main { padding: 2rem 0; min-height: 70vh; }
.page-title {
    margin-bottom: 2rem;
    color: var(--primary);
    border-left: 5px solid var(--secondary);
    padding-left: 1rem;
    font-size: 2rem;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    cursor: pointer;
    position: relative;
}
.blog-card:hover { transform: translateY(-8px); }
.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.blog-content { padding: 1.5rem; position: relative; }
.blog-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}
.edit-btn, .delete-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.edit-btn { background: var(--edit); }
.delete-btn { background: var(--delete); }
.blog-category {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}
.blog-title {
    font-size: 1.4rem;
    margin: 0.8rem 0;
    color: var(--dark);
}
.blog-excerpt {
    color: #555;
    line-height: 1.6;
}
.blog-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #777;
}
.empty-state button {
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}
.editor-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}
.form-control {
    width: 100%;
    padding: 0.9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}
#blog-content-editor {
    min-height: 300px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}
.editor-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}
.btn-primary, .btn-secondary {
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary { background: var(--secondary); color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.blog-detail-container {
    max-width: 800px;
    margin: 0 auto;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f1f1;
    color: #333;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
}
.blog-detail-content img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin: 1.5rem 0;
}
.blog-detail-content h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
    color: var(--primary);
}
.blog-detail-content p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #444;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}
@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; }
    nav ul { justify-content: center; }
    .blog-grid { grid-template-columns: 1fr; }
    .admin-controls .container { flex-direction: column; text-align: center; }
}