/*
Theme Name: TONYHOAIVU - Creative Tools & Photo Editor
Theme URI: https://tonyhoaivu.com
Author: TONYHOAIVU
Description: Theme WordPress chuyen nghiep cho kho cong cu tao anh online, khung avatar, tao chu nghe thuat, QR Code va quan ly quang cao AdSense.
Version: 2.0.0
Text Domain: tonyhoaivu
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f97316;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 16px;
}
.site-logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-logo span { color: var(--accent); }
.site-logo img { max-height: 44px; width: auto; }

.main-nav ul { display: flex; list-style: none; gap: 18px; align-items: center; }
.main-nav a {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
}
.main-nav a:hover { background: #eff6ff; color: var(--primary); }

.header-search { position: relative; display: flex; align-items: center; }
.header-search input {
    padding: 8px 36px 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    width: 230px;
    outline: none;
    background: #f8fafc;
}
.header-search input:focus { border-color: var(--primary); background: #fff; }
.header-search button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 24px;
}
.hero-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.hero-badge-tag {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.hero-banner h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.hero-banner p { color: #cbd5e1; font-size: 15px; max-width: 680px; margin: 0 auto 20px; }

/* Category Filter Bar */
.category-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.category-bar a {
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}
.category-bar a:hover, .category-bar a.active {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}
.section-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 22px;
    background: var(--primary);
    border-radius: 4px;
}
.section-more { font-size: 13px; font-weight: 600; color: var(--primary); }

/* Tools Grid (4 Cols Desktop, 2 Cols Mobile) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.07);
}
.tool-thumb {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}
.tool-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.tool-card:hover .tool-thumb img { transform: scale(1.06); }
.tool-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
}
.tool-body {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.tool-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tool-excerpt {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-tool {
    display: block;
    text-align: center;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.2s;
}
.tool-card:hover .btn-tool { background: var(--primary); color: #fff; }

/* Utilities Strip (QR, Text, Photobooth) */
.utilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.utility-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.2s;
}
.utility-box:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(37,99,235,0.08); }
.utility-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

/* Blog / Prompts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 36px;
}
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.post-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #e2e8f0; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 14px; }
.post-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.post-meta { font-size: 12px; color: var(--text-muted); }

/* Workspace / Tool Canvas Page */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
}
.control-group { margin-bottom: 16px; }
.control-group label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.control-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}
.range-row { display: flex; gap: 12px; }
.range-row > div { flex: 1; }
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: #10b981; margin-top: 10px; }
.btn-success:hover { background: #059669; }

.preview-area {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}
#thvCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    background: #fff;
}

/* AdSense Slot */
.adsense-slot {
    margin: 18px auto;
    text-align: center;
    overflow: hidden;
    min-height: 10px;
}

/* Content Box & Pagination */
.content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}
.content-box h2, .content-box h3 { margin: 16px 0 8px; }
.content-box p { margin-bottom: 12px; }

.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.pagination a, .pagination span {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 40px 0 24px;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}
.footer-title { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .main-nav.open {
        display: block;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .main-nav.open ul { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mobile-menu-toggle { display: block; }
    .header-search input { width: 160px; }
    .workspace-grid { grid-template-columns: 1fr; }
    .utilities-grid, .posts-grid, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero-banner h1 { font-size: 22px; }
}
