/* ===== CSS Variables - Light Theme (default) ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --accent-color: #4a6cf7;
    --accent-hover: #3a5ce5;
    --accent-light: rgba(74, 108, 247, 0.1);
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --header-bg: #ffffff;
    --header-shadow: 0 1px 4px rgba(0,0,0,0.06);
    --footer-bg: #212529;
    --footer-text: #adb5bd;
    --overlay-bg: rgba(0,0,0,0.4);
    --side-menu-bg: #ffffff;
    --alert-success-bg: #d4edda;
    --alert-success-text: #155724;
    --alert-error-bg: #f8d7da;
    --alert-error-text: #721c24;
    --alert-info-bg: #d1ecf1;
    --alert-info-text: #0c5460;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-focus-border: #4a6cf7;
    --badge-bg: #e9ecef;
    --badge-text: #495057;
    --radius: 12px;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #6c757d;
    --border-color: #2d3748;
    --accent-color: #5b7cfa;
    --accent-hover: #7b9aff;
    --accent-light: rgba(91, 124, 250, 0.15);
    --card-bg: #16213e;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
    --header-bg: #16213e;
    --header-shadow: 0 1px 4px rgba(0,0,0,0.3);
    --footer-bg: #0f0f1a;
    --footer-text: #6c757d;
    --overlay-bg: rgba(0,0,0,0.6);
    --side-menu-bg: #16213e;
    --alert-success-bg: #1e4620;
    --alert-success-text: #a3d9a5;
    --alert-error-bg: #4a1c24;
    --alert-error-text: #f5c6cb;
    --alert-info-bg: #1a3a4a;
    --alert-info-text: #b8daff;
    --input-bg: #1a1a2e;
    --input-border: #2d3748;
    --input-focus-border: #5b7cfa;
    --badge-bg: #2d3748;
    --badge-text: #b0b3b8;
    --radius: 12px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    caret-color: transparent;
}

input,
textarea,
select,
[contenteditable="true"] {
    caret-color: auto;
}

h1, h2, h3, h4, h5, h6,
.header-nav .nav-link,
.side-menu-header h3,
.side-menu-link,
.page-title,
.post-card-title,
.single-post-title,
.category-filter a,
.comments-title,
.btn {
    font-family: 'Oxanium', sans-serif;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ===== Header ===== */
.site-header {
    background-color: var(--header-bg);
    box-shadow: var(--header-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 45px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-nav .nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1.2rem;
}

.header-nav .nav-link:hover {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

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

/* Header search bar */
.header-search {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.header-search:focus-within {
    border-color: var(--accent-color);
}

.header-search-input {
    background: none;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 180px;
    font-family: inherit;
}

.header-search-input::placeholder {
    color: var(--text-muted);
}

.header-search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.header-search-btn:hover {
    color: var(--accent-color);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Hamburger button */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 8px;
    transition: border-color 0.2s ease;
}

.hamburger-btn:hover {
    border-color: var(--accent-color);
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

/* Mobile nav - hidden on desktop */
.mobile-nav {
    display: none;
}

/* ===== Side Menu ===== */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background-color: var(--side-menu-bg);
    z-index: 201;
    transition: right 0.3s ease, background-color 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.side-menu-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.side-menu-close:hover {
    color: var(--text-primary);
}

.side-menu-body {
    padding: 15px 20px;
}

.side-menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.side-menu-user i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.side-menu-search {
    display: none;
}

.side-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.side-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: var(--text-primary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s ease;
}

.side-menu-link:hover {
    color: var(--accent-color);
}

.side-menu-link i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* ===== Hero Image ===== */
.hero-image {
    display: block !important;
    width: 100% !important;
    height: 450px !important;
    min-height: 450px !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-success {
    background-color: var(--alert-success-bg);
    color: var(--alert-success-text);
}

.alert-error {
    background-color: var(--alert-error-bg);
    color: var(--alert-error-text);
}

.alert-info {
    background-color: var(--alert-info-bg);
    color: var(--alert-info-text);
}

/* ===== Main Content ===== */
main {
    flex: 1;
    padding: 30px 0;
}

.blog-container {
    max-width: 1000px;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    margin-top: 20px;
    text-align: center;
    color: var(--text-primary);
}

/* ===== Blog Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.post-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, transform 0.2s ease, background-color 0.3s ease;
}

.post-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.post-card-image-wrap {
    position: relative;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-tertiary);
    display: block;
}

.post-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-light), var(--bg-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.post-card-body {
    padding: 20px;
}

.post-card-category {
    display: inline-block;
    background-color: var(--accent-light);
    color: var(--accent-color);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.post-card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

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

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

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    gap: 8px;
}

.post-card-meta i {
    margin-right: 4px;
}

.post-card-meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.post-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
    font-family: inherit;
}

.post-like-btn:hover:not(:disabled) {
    color: #e74c3c;
}

.post-like-btn.liked {
    color: #e74c3c;
}

.post-like-btn.liked:hover {
    color: #c0392b;
}

.post-like-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.post-like-btn i {
    margin-right: 0;
    transition: transform 0.2s ease;
}

.post-like-btn:active:not(:disabled) i {
    transform: scale(1.3);
}

.post-card-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    color: #ffffff;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.post-card-image-wrap:hover .post-card-edit-btn {
    opacity: 1;
}

.post-card-edit-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination a {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.pagination a:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.pagination .current {
    background-color: var(--accent-color);
    color: #fff;
}

/* ===== Single Post ===== */
.single-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.single-post-title {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 15px;
}

.single-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.single-post-meta i {
    margin-right: 4px;
}

.meta-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
}

.single-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.single-post-content [contenteditable] {
    -webkit-user-modify: read-only;
    outline: none;
    cursor: default;
    caret-color: transparent;
}

.single-post-content p,
.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5,
.single-post-content h6,
.single-post-content div,
.single-post-content span,
.single-post-content li,
.single-post-content blockquote {
    outline: none;
    caret-color: transparent;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    margin: 25px 0 15px;
}

.single-post-content p {
    margin-bottom: 15px;
}

.single-post-content img {
    border-radius: 8px;
    margin: 20px 0;
}

.single-post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    margin: 20px 0;
    background-color: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.single-post-content pre {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.single-post-content code {
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ===== Comments ===== */
.comments-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.comment {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

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

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.comment-actions a {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-actions a:hover {
    color: var(--accent-color);
}

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

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease, background-color 0.3s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
}

/* ===== Page Content ===== */
.page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 30px 20px;
}

.page-content h1 {
    font-size: 2rem;
    margin-top: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.page-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-body [contenteditable] {
    -webkit-user-modify: read-only;
    outline: none;
    cursor: default;
    caret-color: transparent;
}

.page-body p,
.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-body h5,
.page-body h6,
.page-body div,
.page-body span,
.page-body li,
.page-body blockquote {
    outline: none;
    caret-color: transparent;
}

.page-body p {
    margin-bottom: 15px;
}

/* ===== Forms ===== */
.form-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.6rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group label.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-group label.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, background-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--badge-bg);
    color: var(--badge-text);
}

.badge-admin {
    background-color: #dc3545;
    color: #fff;
}

.badge-editor {
    background-color: #fd7e14;
    color: #fff;
}

.badge-user {
    background-color: #28a745;
    color: #fff;
}

/* ===== User Avatar (admin table) ===== */
.user-avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}

.user-avatar-placeholder {
    background: var(--badge-bg);
    color: var(--text-muted);
    font-size: 10px;
    line-height: 20px;
    text-align: center;
}

/* ===== Sortable Table Headers ===== */
.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.th-sort:hover {
    color: inherit;
    opacity: 0.8;
}

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    gap: 0;
}

.sort-arrows i {
    font-size: 10px;
    line-height: 0.5;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.sort-arrows i.active {
    color: var(--text-primary);
    opacity: 1;
}

.badge-published {
    background-color: #28a745;
    color: #fff;
}

/* ===== Page Type Badges ===== */
.page-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.page-type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ===== Page Types Management Section ===== */
.page-types-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.page-types-section .admin-header {
    margin-bottom: 16px;
}

.page-types-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.page-types-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-type-selectable {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.page-type-selectable:hover {
    transform: scale(1.05);
}

.page-type-selectable.selected {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--text-primary);
    transform: scale(1.08);
}

/* ===== Unified Color Palette ===== */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.color-dot {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--text-primary);
    transform: scale(1.15);
}

/* ===== Color Bar (page types inline edit) ===== */
.color-bar {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.color-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.color-bar-inner .color-palette {
    margin-top: 0;
}

#colorBarDeleteBtn {
    height: 32px;
}

@media (max-width: 768px) {
    .page-types-badges {
        gap: 6px;
    }

}

/* ===== Tags ===== */
.tag-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.tag-badge-sm {
    padding: 2px 8px;
    font-size: 0.7rem;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.single-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag-color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 4px;
}

.tag-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.tag-color-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-color-option input[type="radio"] {
    display: none;
}

.tag-color-swatch {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.tag-color-option input[type="radio"]:checked + .tag-color-swatch {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.tag-color-option:hover .tag-color-swatch {
    transform: scale(1.05);
}

.tag-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tag-select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.tag-select-option {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.tag-select-option input[type="checkbox"] {
    display: none;
}

.tag-select-option .tag-badge {
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.tag-select-option input[type="checkbox"]:checked + .tag-badge {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--text-primary);
}

.tag-select-option:hover .tag-badge {
    opacity: 0.8;
    transform: scale(1.05);
}

.tag-select-option.disabled {
    cursor: not-allowed;
}

.tag-select-option.disabled .tag-badge {
    opacity: 0.25;
}

/* ===== Favicon Upload ===== */
.favicon-upload-area {
    padding: 15px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}

.favicon-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.favicon-preview-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    padding: 2px;
}

/* ===== Appearance Admin Page ===== */
.appearance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.appearance-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.appearance-card > form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.appearance-card > form > .mt-10 {
    margin-top: auto;
    padding-top: 12px;
}

.appearance-card .text-muted {
    display: block;
    text-align: center;
}

.appearance-card .mt-10 {
    text-align: center;
}

.appearance-card > form > .file-upload-wrap {
    text-align: center;
}

.appearance-card > form > .file-upload-wrap .file-upload-preview,
.appearance-card > form > .file-upload-wrap .file-upload-drop {
    display: inline-block;
}

.appearance-card-full {
    grid-column: 1 / -1;
}

.appearance-card-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.appearance-card-title i {
    margin-right: 6px;
    color: var(--accent-color);
}

.appearance-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 10px;
}

.appearance-row .appearance-col {
    flex: 0 1 auto;
}

.appearance-col {
    text-align: center;
}

.appearance-col label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.appearance-col .file-upload-preview,
.appearance-col .file-upload-drop {
    display: inline-block;
}

.appearance-preview {
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
}

.appearance-preview img {
    max-height: 45px;
    width: auto;
}

.appearance-preview-light {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
}

.appearance-preview-dark {
    background-color: #1a1a2e;
    border: 1px solid #2d3748;
}

.appearance-preview-cover {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.appearance-preview-cover img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* Color picker */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.color-input {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: none;
}

.color-hex-input {
    width: 90px;
    padding: 8px 10px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
}

.color-hex-input:focus {
    outline: none;
    border-color: var(--input-focus-border);
}

.color-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.color-preset-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.color-preset-btn:hover {
    transform: scale(1.15);
    border-color: var(--text-primary);
}

/* Layout toggle */
.layout-toggle {
    display: flex;
    gap: 10px;
}

.layout-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.layout-option input {
    display: none;
}

.layout-option.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: var(--accent-light);
}

.layout-option:hover {
    border-color: var(--accent-color);
}

/* Custom CSS editor */
.custom-css-editor {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    tab-size: 4;
    resize: vertical;
    min-height: 150px;
}

/* ===== Theme Colors Editor ===== */
.theme-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.theme-tab {
    padding: 8px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-tab:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.theme-tab.active {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.theme-tab i {
    margin-right: 4px;
}

.theme-tab-content {
    display: none;
}

.theme-tab-content.active {
    display: block;
}

.theme-colors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 1100px) {
    .theme-colors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .theme-colors-grid {
        grid-template-columns: 1fr;
    }
}

.theme-color-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.theme-color-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-color-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.theme-color-picker {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    background: none;
}

.theme-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.theme-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.theme-color-hex {
    width: 80px;
    padding: 5px 8px;
    font-size: 0.8rem;
    font-family: 'Courier New', Consolas, monospace;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    text-align: center;
}

.theme-color-reset {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-color-reset:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: var(--accent-light);
}

/* ===== Posts List Layout ===== */
.posts-grid.posts-list {
    grid-template-columns: 1fr;
    gap: 15px;
}

.posts-list .post-card {
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.posts-list .post-card-image-wrap {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

.posts-list .post-card-image,
.posts-list .post-card-image-placeholder {
    height: 100%;
    min-height: 180px;
}

.posts-list .post-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.posts-list .post-card-excerpt {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

@media (max-width: 1100px) {
    .appearance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .appearance-grid {
        grid-template-columns: 1fr;
    }

    .appearance-row {
        flex-direction: column;
        align-items: center;
    }

    .color-picker-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .layout-toggle {
        flex-direction: column;
    }

    .posts-list .post-card {
        flex-direction: column;
    }

    .posts-list .post-card-image-wrap {
        width: 100%;
        min-width: 100%;
    }

    .posts-list .post-card-image,
    .posts-list .post-card-image-placeholder {
        height: 200px;
        min-height: 200px;
    }
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 25px 0;
    margin-top: auto;
    transition: background-color 0.3s ease;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    color: var(--footer-text);
    font-size: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.footer-social-link:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ===== 404 ===== */
.not-found {
    text-align: center;
    padding: 60px 20px;
}

.not-found h1 {
    font-size: 5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.not-found p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ===== Category Filter ===== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    justify-content: center;
}

.category-filter.no-title {
    margin-top: 20px;
}

.page-body.no-title {
    margin-top: 20px;
}

.category-filter a {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.category-filter a:hover,
.category-filter a.active {
    background-color: var(--accent-color);
    color: #fff;
}

/* ===== Admin Panel ===== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.admin-sidebar-title {
    padding: 0 20px 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.admin-sidebar a i {
    width: 20px;
    text-align: center;
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    font-size: 1.6rem;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.admin-table td {
    font-size: 0.95rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background-color: var(--accent-light);
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Sortable drag & drop */
.sortable-th {
    width: 40px;
}

.sortable-handle-cell {
    width: 40px;
    text-align: center;
}

.sortable-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.sortable-handle:hover {
    color: var(--text-primary);
}

.sortable-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: var(--accent-light) !important;
}

.sortable-ghost td {
    background-color: var(--accent-light) !important;
}

.sort-arrow {
    display: none !important;
}

/* Statistics page */
.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stats-period-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stats-chart-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease;
}

.stats-chart-card h3 {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.stats-chart-card canvas {
    height: 220px !important;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.stats-table-wrap {
    overflow-x: auto;
}

.stats-export-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Admin form */
.admin-form {
    max-width: 800px;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

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

/* Admin dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: background-color 0.3s ease;
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ===== Mobile hamburger toggle for admin sidebar ===== */
.admin-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 150;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .header-logo {
        order: 1;
        flex: 1;
    }

    .header-actions {
        order: 2;
    }

    .header-search {
        display: none;
    }

    .side-menu-search {
        display: flex;
    }

    .header-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
        justify-content: center;
        gap: 5px;
        padding: 0 20px 10px;
        flex-wrap: wrap;
        background-color: var(--header-bg);
    }

    .mobile-nav .nav-link {
        color: var(--text-primary);
        font-weight: 500;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-nav .nav-link:hover {
        background-color: var(--accent-light);
        color: var(--accent-color);
    }

    .hero-image {
        width: 100% !important;
        height: 200px !important;
        min-height: 200px !important;
    }

    .page-title {
        font-size: 1.5rem;
        margin-top: 15px;
    }

    .page-content h1 {
        margin-top: 15px;
        font-size: 1.5rem;
    }

    .category-filter.no-title {
        margin-top: 15px;
    }

    .page-body.no-title {
        margin-top: 15px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .single-post-title {
        font-size: 1.6rem;
    }

    /* Admin responsive */
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100%;
        z-index: 180;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .admin-sidebar.active {
        left: 0;
    }

    .admin-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .admin-content {
        padding: 20px 15px;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: block;
        margin-bottom: 12px;
        background-color: var(--card-bg);
        border-radius: 8px;
        box-shadow: var(--card-shadow);
        padding: 10px 14px;
    }

    .admin-table tbody td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: left;
    }

    .admin-table tbody td[data-label] {
        justify-content: space-between;
    }

    .admin-table tbody td:last-child {
        border-bottom: none;
    }

    .admin-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-align: left;
        margin-right: 10px;
        white-space: nowrap;
    }

    .admin-table tbody td[data-label="Akce"] {
        justify-content: flex-end;
    }

    .admin-table tbody td[data-label="Akce"]::before {
        display: none;
    }

    .sortable-handle-cell {
        display: none !important;
    }

    .sort-arrow {
        display: inline-flex !important;
    }

    /* TinyMCE mobile fix */
    .tox-tinymce {
        min-height: 250px !important;
    }

    .tox .tox-toolbar__group {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-chart-card {
        padding: 15px;
    }

    .stats-chart-card canvas {
        height: 160px !important;
    }

    .stats-chart-card h3 {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .admin-table tbody td i {
        display: none;
    }

    .admin-table tbody td[data-label="Akce"] i {
        display: inline;
    }

    .stats-export-btns {
        width: 100%;
    }

    .form-container {
        margin: 20px 15px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-card i {
        font-size: 1.3rem;
    }

    .stat-card .stat-number {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .header-logo img {
        height: 35px;
    }
}

/* ===== Search Page ===== */
.search-page h1 {
    font-size: 1.8rem;
    margin-top: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.search-page h1 i {
    margin-right: 8px;
    color: var(--accent-color);
}

.search-form {
    margin-bottom: 30px;
}

.search-form-inner {
    display: flex;
    gap: 0;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.search-form-inner:focus-within {
    border-color: var(--accent-color);
}

.search-form-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    border: none;
    outline: none;
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
}

.search-form-input::placeholder {
    color: var(--text-muted);
}

.search-form-btn {
    padding: 14px 24px;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s ease;
}

.search-form-btn:hover {
    opacity: 0.9;
}

.search-results-info {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.search-result-card {
    display: flex;
    gap: 20px;
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.search-result-image {
    width: 200px;
    min-height: 150px;
    flex-shrink: 0;
}

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

.search-result-body {
    flex: 1;
    padding: 20px 20px 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-card:not(:has(.search-result-image)) .search-result-body {
    padding-left: 20px;
}

.search-result-title {
    font-size: 1.15rem;
    margin: 6px 0 8px;
}

.search-result-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.search-result-title a:hover {
    color: var(--accent-color);
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.search-result-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .search-result-card {
        flex-direction: column;
    }

    .search-result-image {
        width: 100%;
        min-height: 0;
        height: 180px;
    }

    .search-result-body {
        padding: 16px;
    }

    .search-form-btn span {
        display: none;
    }

    .search-page h1 {
        margin-top: 15px;
    }

    .search-results {
        margin-bottom: 30px;
    }
}

/* ===== Contact Form ===== */
.cf-wrapper {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 520px;
    margin: 20px auto;
    box-shadow: var(--card-shadow);
}

.cf-wrapper h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.cf-wrapper .cf-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.cf-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.cf-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cf-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.cf-group input,
.cf-group textarea {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.cf-group input::placeholder,
.cf-group textarea::placeholder {
    color: var(--text-muted);
}

.cf-group input:focus,
.cf-group textarea:focus {
    border-color: var(--accent-color);
}

.cf-group textarea {
    resize: vertical;
    min-height: 120px;
}

.cf-group-full {
    margin-bottom: 24px;
}

.cf-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.cf-submit:hover {
    opacity: 0.9;
}

@media (max-width: 480px) {
    .cf-row {
        flex-direction: column;
        gap: 20px;
    }

    .cf-wrapper {
        padding: 24px;
    }
}

/* ===== FAQ ===== */
.faq-wrapper {
    max-width: 700px;
    margin: 20px auto;
}

.faq-wrapper > h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.faq-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: var(--card-shadow);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    font-family: inherit;
    gap: 12px;
}

.faq-question i {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

@media (max-width: 480px) {
    .faq-question {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .faq-answer p {
        padding: 0 16px 14px;
        font-size: 0.9rem;
    }
}

/* ===== Styled File Upload ===== */
.file-upload-wrap {
    position: relative;
}

.file-upload-wrap input[type="file"] {
    display: none;
}

/* Drop zone (empty state) */
.file-upload-drop {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background-color: var(--bg-secondary);
}

.file-upload-drop:hover,
.file-upload-drop.dragover {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
}

.file-upload-drop-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.file-upload-drop-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.file-upload-drop-text strong {
    color: var(--accent-color);
}

.file-upload-drop-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Preview with overlay (existing image) */
.file-upload-preview {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
}

.file-upload-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    color: #fff;
    gap: 4px;
    border-radius: inherit;
}

.file-upload-preview:hover .file-upload-preview-overlay {
    opacity: 1;
}

.file-upload-preview-overlay i {
    font-size: 1.4rem;
}

.file-upload-preview-overlay span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* File selected info bar */
.file-upload-info {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: var(--accent-light);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.file-upload-info.visible {
    display: flex;
}

.file-upload-info i {
    color: var(--accent-color);
}

.file-upload-info-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-upload-info-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.file-upload-info-remove:hover {
    color: var(--danger-color, #e74c3c);
}

/* Appearance-specific previews inside file-upload-preview */
.file-upload-preview .appearance-preview {
    margin-bottom: 0;
}

.file-upload-preview .appearance-preview-cover {
    margin-bottom: 0;
}

.file-upload-preview .favicon-preview {
    margin-bottom: 0;
}

/* Favicon preview enlarged for overlay */
.file-upload-preview .favicon-preview-img {
    width: 64px;
    height: 64px;
}

/* Avatar upload styled */
.avatar-upload-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.avatar-upload-wrap input[type="file"] {
    display: none;
}

.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    color: #fff;
    gap: 2px;
}

.avatar-upload-wrap:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-overlay i {
    font-size: 1.3rem;
}

.avatar-upload-overlay span {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Avatar drop zone (no avatar) */
.avatar-upload-drop {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background-color: var(--bg-secondary);
    gap: 2px;
}

.avatar-upload-drop:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-light);
}

.avatar-upload-drop i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.avatar-upload-drop span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 768px) {
    .file-upload-drop {
        padding: 18px 12px;
    }

    .file-upload-preview-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.35);
    }

    .avatar-upload-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.35);
    }
}

/* ===== Profile Avatar ===== */
.profile-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    border: 3px solid var(--accent-color);
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-placeholder i {
    font-size: 5rem;
    color: var(--text-muted);
}

/* ===== Avatar Crop Modal ===== */
.crop-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.crop-modal-overlay.active {
    display: flex;
}

.crop-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.crop-modal h3 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.crop-modal .croppie-container {
    margin: 0 auto;
}

.crop-modal .cr-slider-wrap {
    margin: 12px auto 0;
}

.crop-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.crop-modal-actions .btn {
    min-width: 100px;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.no-posts {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}
.no-posts i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    color: var(--text-muted);
}

/* ===== PNG Icon Images ===== */
.icon-img {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    object-fit: contain;
    display: inline-block;
    flex-shrink: 0;
}

.admin-sidebar a .icon-img {
    width: 20px;
    height: 20px;
}

.stat-card .icon-img {
    width: 2rem;
    height: 2rem;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.theme-toggle .icon-img {
    width: 18px;
    height: 18px;
}

.side-menu-link .icon-img {
    width: 20px;
    height: 20px;
}

.side-menu-user .icon-img {
    width: 1.5rem;
    height: 1.5rem;
}

.btn .icon-img {
    width: 14px;
    height: 14px;
}

.btn-sm .icon-img {
    width: 14px;
    height: 14px;
}

.no-posts .icon-img {
    width: 3rem;
    height: 3rem;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-card-edit-btn .icon-img {
    width: 14px;
    height: 14px;
}

.post-card-image-placeholder .icon-img {
    width: 3rem;
    height: 3rem;
    opacity: 0.5;
}

.comments-title .icon-img {
    width: 1.2em;
    height: 1.2em;
}

.search-form-btn .icon-img {
    width: 16px;
    height: 16px;
}

.header-search-btn .icon-img {
    width: 14px;
    height: 14px;
}

.appearance-card-title .icon-img {
    width: 1.2em;
    height: 1.2em;
}

.sortable-handle.icon-img {
    width: 16px;
    height: 16px;
    cursor: grab;
}

.comment-actions .icon-img {
    width: 14px;
    height: 14px;
}

.crop-modal h3 .icon-img {
    width: 1.2em;
    height: 1.2em;
}

@media (max-width: 768px) {
    .stat-card .icon-img {
        width: 1.3rem;
        height: 1.3rem;
    }
}

/* ===== CookieConsent v3 Theme Overrides ===== */
#cc-main {
    --cc-bg: var(--card-bg);
    --cc-primary-color: var(--text-primary);
    --cc-secondary-color: var(--text-secondary);
    --cc-border-radius: var(--radius);
    --cc-btn-primary-bg: var(--accent-color);
    --cc-btn-primary-hover-bg: var(--accent-hover);
    --cc-btn-primary-color: #fff;
    --cc-btn-secondary-bg: var(--bg-secondary);
    --cc-btn-secondary-hover-bg: var(--bg-tertiary);
    --cc-btn-secondary-color: var(--text-primary);
    --cc-separator-border-color: var(--border-color);
    --cc-toggle-on-bg: var(--accent-color);
    --cc-overlay-bg: var(--overlay-bg);
    --cc-cookie-category-block-bg: var(--bg-secondary);
    --cc-cookie-category-block-hover-bg: var(--bg-tertiary);
    --cc-section-border: var(--border-color);
    --cc-font-family: inherit;
}

