/* Frontend CSS - Blog CMS */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #6b7280;
    --success: #10b981;
}

/* SÖTÉT MÓD VÁLTOZÓK */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #94a3b8;
    --dark: #f1f5f9;
    --light: #1e293b;
    --white: #0f172a;
    --border: #334155;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --success: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--light);
    transition: background 0.3s ease, color 0.3s ease;
}

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

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

[data-theme="dark"] .site-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.site-branding {
    flex: 0 0 auto;
}

.site-title {
    font-size: 28px;
    margin-bottom: 5px;
}

.site-title a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.site-description {
    color: var(--text-light);
    font-size: 14px;
}

/* THEME TOGGLE BUTTON - MEGFORMÁZVA */
.theme-toggle {
    background: var(--light);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.theme-toggle .theme-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(360deg);
}

.theme-toggle .theme-text {
    font-size: 14px;
    font-weight: 600;
}

/* Main Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.header-search {
    flex: 0 0 auto;
}

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

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 14px;
    width: 220px;
    background: var(--white);
    color: var(--text);
    transition: all 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Main Content */
.site-main {
    padding: 40px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.search-info {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 30px;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

[data-theme="dark"] .post-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

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

[data-theme="dark"] .post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.post-thumbnail {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

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

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
}

.post-category {
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.post-category:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.post-date {
    color: var(--text-light);
}

.post-title {
    font-size: 24px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.post-excerpt {
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
}

.read-more {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--primary-dark);
    transform: translateX(5px);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.widget {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

[data-theme="dark"] .widget {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

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

.category-list li {
    margin-bottom: 12px;
}

.category-list a {
    color: var(--text);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    background: var(--light);
    color: var(--primary);
    transform: translateX(5px);
}

.category-list .count {
    color: var(--text-light);
    font-size: 13px;
}

.popular-list {
    list-style: none;
}

.popular-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.popular-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.popular-list a:hover {
    color: var(--primary);
}

.popular-list .views {
    font-size: 12px;
    color: var(--text-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-link {
    padding: 10px 16px;
    background: var(--white);
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 40px 0;
    margin-top: 60px;
    transition: background 0.3s ease;
}

[data-theme="dark"] .site-footer {
    background: #0a0e1a;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2) rotate(5deg);
}

/* Single Post/Page */
.single-post,
.single-page {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

[data-theme="dark"] .single-post,
[data-theme="dark"] .single-page {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.single-post-header,
.page-header {
    margin-bottom: 30px;
}

.single-post-title,
.page-title {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--dark);
    line-height: 1.3;
}

.single-post-meta,
.page-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

.single-featured-image {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 30px;
}

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

.single-post-content,
.page-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
}

.single-post-content h2,
.page-content h2 {
    font-size: 28px;
    margin: 30px 0 15px;
    color: var(--dark);
}

.single-post-content h3,
.page-content h3 {
    font-size: 24px;
    margin: 25px 0 12px;
    color: var(--dark);
}

.single-post-content p,
.page-content p {
    margin-bottom: 20px;
}

.single-post-content img,
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.single-post-content ul,
.page-content ul,
.single-post-content ol,
.page-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.single-post-content li,
.page-content li {
    margin-bottom: 10px;
}

.single-post-content blockquote,
.page-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 15px 25px;
    margin: 25px 0;
    background: var(--light);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.single-post-content a,
.page-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.single-post-content a:hover,
.page-content a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.tag-item {
    background: var(--light);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

/* Comments Section */
.comments-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--dark);
}

.comment-item {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--dark);
}

.comment-date {
    color: var(--text-light);
    font-size: 14px;
}

.comment-content {
    color: var(--text);
    line-height: 1.6;
}

.comment-form {
    margin-top: 40px;
}

.comment-form h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--dark);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.btn-submit {
    background: var(--primary);
    color: var(--white);
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

[data-theme="dark"] .no-posts {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.no-posts h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--dark);
}

.no-posts p {
    color: var(--text-light);
    font-size: 18px;
}

#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

#scrollToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#scrollToTop.show {
    display: flex;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* Responsive Design */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

[data-theme="dark"] .mobile-menu-btn {
    color: var(--white);
}

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

    .sidebar {
        position: static;
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .header-content {
        /* Keep header items aligned horizontally on mobile header bar */
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0;
    }

    .mobile-menu-btn {
        display: block;
        order: 1;
        /* First item */
    }

    .site-branding {
        order: 2;
        /* Middle item */
        text-align: center;
        flex-grow: 1;
    }

    .header-actions {
        order: 3;
        /* Last item */
        width: auto;
        gap: 10px;
    }

    /* Hide search on mobile header initially or adjust */
    .header-search {
        display: none;
        /* Simplify header for now, maybe move search to menu later or keep simple */
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 4;
        /* Below header bar */
        margin-top: 15px;
        background: var(--light);
        padding: 20px;
        border-radius: 8px;
    }

    .main-nav.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .main-nav ul li {
        width: 100%;
        text-align: center;
    }

    .main-nav ul li a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    .main-nav ul li:last-child a {
        border-bottom: none;
    }

    .theme-toggle .theme-text {
        display: none;
    }

    .theme-toggle {
        padding: 8px 12px;
    }

    .post-thumbnail {
        height: 200px;
    }

    .single-featured-image {
        height: 250px;
    }

    .single-post,
    .single-page {
        padding: 20px;
    }

    .single-post-title,
    .page-title {
        font-size: 24px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}