* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header h1 a {
    color: white;
    text-decoration: none;
}

.main-header nav {
    margin-top: 1rem;
}

.main-header nav a {
    color: white;
    text-decoration: none;
    margin-right: 1.5rem;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.main-header nav a:hover {
    opacity: 1;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.blog-card-image {
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-content h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.blog-card-content h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card-content h2 a:hover {
    color: #667eea;
}

.blog-meta {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.blog-meta span {
    margin-right: 1rem;
}

.blog-excerpt {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.read-more:hover {
    color: #764ba2;
}

/* Single Blog Post */
.blog-post {
    background: white;
    border-radius: 12px;
    margin: 3rem 0;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.blog-post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.blog-post-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

.blog-post-meta span {
    margin-right: 1rem;
}

.blog-post-image {
    margin: 2rem 0;
}

.blog-post-image img {
    width: 100%;
    border-radius: 8px;
}

.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.blog-post-content h2 {
    margin: 1.5rem 0 1rem;
    color: #333;
}

.blog-post-content h3 {
    margin: 1.25rem 0 0.75rem;
    color: #555;
}

.blog-post-content p {
    margin-bottom: 1.25rem;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.blog-post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.btn-back {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #5a6268;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background: #667eea;
    color: white;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Admin Styles */
.admin-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #667eea;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.blog-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blog-table table {
    width: 100%;
    border-collapse: collapse;
}

.blog-table th,
.blog-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.blog-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.status-published {
    color: #28a745;
    font-weight: 600;
}

.status-draft {
    color: #dc3545;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete,
.btn-view {
    padding: 0.25rem 0.75rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-primary,
.btn-back,
.btn-submit,
.btn-login,
.btn-logout {
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-back {
    background: #6c757d;
    color: white;
}

.btn-submit {
    background: #28a745;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-logout {
    background: #dc3545;
    color: white;
}

/* Forms */
.blog-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.btn-login {
    width: 100%;
    background: #667eea;
    color: white;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Messages */
.success,
.error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.no-blogs {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .blog-table {
        overflow-x: scroll;
    }
    
    .blog-post-header h1 {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}