:root {
    /* Light Theme Variables */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --primary-color: #1e40af;
    --primary-hover: #1d4ed8;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-bg: #f1f5f9;
    --search-highlight: #fff9db;
    --verse-border: #cbd5e1;
    --verse-hover: #f0f9ff;
    --pagination-bg: #f1f5f9;
    --pagination-active: #dbeafe;
    --tool-card-bg: #f8fafc;
    --footer-bg: #1e293b;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --verse-transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-bg: #0f172a;
    --search-highlight: #52525b;
    --verse-border: #334155;
    --verse-hover: #1e293b;
    --pagination-bg: #1e293b;
    --pagination-active: #334155;
    --tool-card-bg: #0f172a;
    --footer-bg: #020617;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(120deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo i {
    font-size: 1.8rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    font-weight: 300;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

/* Footer Styles */
footer {
    background-color: var(--footer-bg);
    color: var(--text-secondary);
    padding: 2.5rem 0 1.5rem;
    margin-top: auto;
}

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

.footer-column h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--text-color);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Blog specific styles */
.blog-page {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.blog-header {
    padding: 2rem 0;
    text-align: center;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.blog-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-secondary);
}

.blog-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

.blog-sidebar {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.sidebar-widget {
    margin-bottom: 2rem;
}

.sidebar-widget:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.category-list a:hover {
    background-color: var(--sidebar-bg);
    color: var(--primary-color);
}

.category-list a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.popular-posts {
    list-style: none;
    padding: 0;
}

.popular-post-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-post-item:last-child {
    border-bottom: none;
}

.popular-post-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--sidebar-bg);
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex: 1;
}

.popular-post-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.blog-views {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.blog-view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.blog-view-btn:hover, .blog-view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Post List Styles */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    display: flex;
    gap: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.post-image {
    flex: 0 0 250px;
    height: 200px;
    border-radius: 16px 0 0 16px;
    overflow: hidden;
    background-color: var(--sidebar-bg);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    flex: 1;
    padding: 1.5rem;
}

.post-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--sidebar-bg);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-title:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-meta i {
    color: var(--primary-color);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* List View Styles */
.list-view .post-item {
    flex-direction: column;
    border-radius: 16px;
}

.list-view .post-image {
    flex: 0 0 100%;
    height: 250px;
    border-radius: 16px 16px 0 0;
}

/* Grid View Styles */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.grid-view .post-item {
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}

.grid-view .post-image {
    flex: 0 0 100%;
    height: 200px;
    border-radius: 16px 16px 0 0;
}

.grid-view .post-content {
    padding: 1.2rem;
}

/* Category View Styles */
.category-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.category-view .post-item {
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-view .post-image {
    flex: 0 0 100%;
    height: 180px;
    border-radius: 0;
}

.category-view .post-content {
    padding: 1rem;
}

.category-view .post-title {
    font-size: 1.2rem;
}

/* Text List View Styles */
.text-list-view .post-item {
    background-color: transparent;
    box-shadow: none;
    border: none;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.text-list-view .post-image {
    display: none;
}

.text-list-view .post-content {
    padding: 0;
}

.text-list-view .post-title {
    font-size: 1.3rem;
}

.text-list-view .post-excerpt {
    display: none;
}

/* Compact List View Styles */
.compact-list-view .post-item {
    background-color: transparent;
    box-shadow: none;
    border: none;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.compact-list-view .post-image {
    flex: 0 0 100px;
    height: 75px;
    border-radius: 8px;
}

.compact-list-view .post-content {
    padding: 0;
}

.compact-list-view .post-title {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.compact-list-view .post-excerpt {
    display: none;
}

/* Recommended Posts */
.recommended-posts {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.recommended-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.recommended-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.recommended-post-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.recommended-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.recommended-post-image {
    height: 150px;
    overflow: hidden;
}

.recommended-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-post-content {
    padding: 1rem;
}

.recommended-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-post-title:hover {
    color: var(--primary-color);
}

.recommended-post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Post specific styles */
.post-page {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.post-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-header {
    padding: 3rem 0 2rem;
    text-align: center;
}

.post-category {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: var(--sidebar-bg);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.post-meta i {
    color: var(--primary-color);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-image {
    width: 100%;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    background-color: var(--sidebar-bg);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    line-height: 1.8;
}

.post-content h2 {
    font-size: 2rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--text-color);
}

.post-content h3 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

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

.post-content ul, .post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.8rem;
}

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--primary-hover);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--sidebar-bg);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Related Posts */
.related-posts {
    margin: 3rem 0;
}

.related-posts h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.related-post-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.related-post-image {
    height: 200px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 1.2rem;
}

.related-post-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--sidebar-bg);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.related-post-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title:hover {
    color: var(--primary-color);
}

.related-post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}