* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #FAF9F6;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.site-title a {
    color: white;
    text-decoration: none;
}

/* Navigation */
nav {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu li a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-menu li a:hover {
    background: #667eea;
    color: white;
}

/* Search Box */
.search-container {
    background: white;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 0.8rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #764ba2;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.post-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #667eea;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-meta {
    color: #999;
    font-size: 0.9rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Post Detail */
.post-detail {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 900px;
}

.post-content {
    margin: 2rem 0;
    line-height: 1.8;
}

.post-content h2 {
    margin: 1.5rem 0 1rem;
    color: #667eea;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Social Share */
.social-share {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.social-share h3 {
    margin-bottom: 1rem;
    color: #333;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.3s;
    font-weight: bold;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.twitter { background: #1DA1F2; }
.social-icon.facebook { background: #4267B2; }
.social-icon.reddit { background: #FF4500; }
.social-icon.gmail { background: #D44638; }
.social-icon.linkedin { background: #0077B5; }

/* Related Posts */
.related-posts {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-posts h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.related-posts ul {
    list-style: none;
}

.related-posts li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

.related-posts li:last-child {
    border-bottom: none;
}

.related-posts a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.related-posts a:hover {
    color: #667eea;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    text-align: center;
    color: #999;
}

/* Admin Panel */
.admin-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

textarea.form-control {
    min-height: 400px;
    font-family: 'Courier New', monospace;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.posts-list {
    list-style: none;
    margin-top: 2rem;
}

.posts-list li {
    padding: 1rem;
    background: #f9f9f9;
    margin-bottom: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .social-icons {
        gap: 0.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}
/* Language Switcher Styles */
.language-switcher {
    position: relative;
    display: inline-block;
}

.lang-button {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.lang-button:hover {
    background: #45a049;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    margin-top: 5px;
    min-width: 180px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.lang-dropdown.active {
    display: block;
}

.lang-option {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.current {
    background: #e8f5e9;
    font-weight: bold;
}

/* RTL Support */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .language-switcher {
        width: 100%;
    }
    
    .lang-button {
        width: 100%;
        justify-content: center;
    }
    
    .lang-dropdown {
        width: 100%;
    }
}
/* Pagination styles */
.pagination {
    text-align: center;
    margin: 3rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-info {
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    border-radius: 6px;
    font-weight: 500;
    color: #666;
}

/* Button improvements */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Mobile responsive improvements */
@media (max-width: 480px) {
    .pagination {
        flex-direction: column;
    }
    
    .pagination .btn {
        width: 100%;
        text-align: center;
    }
    
    .page-info {
        order: -1;
        width: 100%;
        text-align: center;
    }
}