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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    padding: 1rem 0;
}

.nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #2563eb;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Featured Section */
.featured {
    padding: 4rem 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.featured-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Blog List */
.blog-list {
    padding: 4rem 0;
    background: #f8fafc;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.category {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.category:hover {
    background: #c7d2fe;
    color: #312e81;
}

.date {
    color: #6b7280;
}

.card-title {
    margin-bottom: 1rem;
}

.card-title a {
    text-decoration: none;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.card-title a:hover {
    color: #2563eb;
}

.card-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-author {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.page-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Post Page */
.post {
    padding: 4rem 0;
    background: white;
}

.post-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
    line-height: 1.2;
}

.post-author {
    color: #6b7280;
    font-size: 1.1rem;
}

.post-content {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h1, .post-content h2, .post-content h3 {
    margin: 2rem 0 1rem;
    color: #1f2937;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

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

.back-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #e5e7eb;
}

/* Admin Panel */
.admin-header {
    background: #1f2937;
}

.admin-header .logo {
    color: white;
}

.admin-header .nav-links a {
    color: #d1d5db;
}

.admin-header .nav-links a:hover {
    color: white;
}

.admin-container {
    background: #f8fafc;
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.editor-section {
    background: white;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.editor-section .container {
    padding: 2rem;
}

.blog-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Posts Management */
.posts-management {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.posts-management .container {
    padding: 2rem;
}

.posts-table {
    overflow-x: auto;
}

.posts-table table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th,
.posts-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.posts-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.draft {
    background: #fef3c7;
    color: #92400e;
}

.status.published {
    background: #d1fae5;
    color: #065f46;
}

.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Alert */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    text-align: center;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Main Content Layout */
.main-content {
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sidebar-widget h3 {
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.2rem;
}

.sidebar-widget p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Newsletter Widget */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-form input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.newsletter-form button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #1d4ed8;
}

/* Ad Widget */
.ad-placeholder {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.ad-placeholder p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.ad-placeholder small {
    color: #9ca3af;
}

/* Featured Images */
.card-image {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    aspect-ratio: 16/9;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .card-image img {
    transform: scale(1.05);
}

/* Featured post images - larger */
.featured-image {
    aspect-ratio: 3/2;
    height: 300px;
}

/* Latest post images - smaller */
.latest-image {
    aspect-ratio: 16/9;
    height: 200px;
}

/* Category page styles */
.category-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.category-description {
    color: #6b7280;
    font-size: 1.1rem;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

/* Create Form Styles */
.create-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.checkbox-group {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.editor-container {
    height: 400px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.image-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.remove-image {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.remove-image:hover {
    background: #b91c1c;
}

.current-image {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
}

.current-image img {
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        position: static;
        order: -1;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .nav .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .card-title a {
        font-size: 1.1rem;
    }
    
    .blog-card,
    .featured-card {
        padding: 1rem;
    }
    
    .create-form-container {
        padding: 1rem;
    }
}