/*
Theme Name: ESP32 Liquid Glass Theme
Theme URI: https://example.com/esp32-liquid-glass
Author: Gemini & Creative Developer
Description: Giao diện Kính Lỏng bóng bẩy dành cho tín đồ ESP32 và IoT, hỗ trợ Dark/Light mode và Customizer toàn diện.
Version: 1.0.1
Text Domain: esp32-liquid-glass
*/

:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --text-muted: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --cta-bg: #ffffff;
    --cta-text: #000000;
    --heading-grad: linear-gradient(180deg, #ffffff 0%, #a1a1a1 100%);
    --mockup-border: rgba(255, 255, 255, 0.3);
    --mockup-glow: rgba(255, 255, 255, 0.2);
}

/* Light Mode Configuration */
[data-theme="light"] {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --text-muted: #6e6e73;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --cta-bg: #1d1d1f;
    --cta-text: #ffffff;
    --heading-grad: linear-gradient(180deg, #1d1d1f 0%, #515154 100%);
    --mockup-border: rgba(0, 0, 0, 0.15);
    --mockup-glow: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Khối chất lỏng nền sinh động */
.liquid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    filter: blur(80px);
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.45;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); border-radius: 50% 50% 30% 70% / 50% 60% 40% 60%; }
    100% { transform: translate(120px, 60px) scale(1.25) rotate(360deg); border-radius: 30% 70% 70% 30% / 60% 40% 60% 40%; }
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- MENU LIQUID GLASS --- */
nav {
    width: 100%;
    max-width: 950px;
    margin-top: 20px;
    padding: 5px 25px;
    border-radius: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav:hover {
    transform: scale(1.01);
    box-shadow: 0 15px 40px rgba(0, 242, 254, 0.1);
}

/* Khớp cấu trúc ul li của WP Nav Menu */
nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    flex-grow: 1;
    justify-content: flex-start;
}

nav ul li a {
    color: var(--text-color);
    opacity: 0.75;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.5);
}

nav ul li a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) scale(1.05);
}

/* Nút Shortcut Chuyên mục tùy chỉnh trên Header */
.header-featured-cat-link {
    margin-left: 10px;
    margin-right: 15px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 14px;
    background: rgba(0, 242, 254, 0.12);
    border: 1px solid rgba(0, 242, 254, 0.25);
    color: #00f2fe;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-featured-cat-link:hover {
    background: #00f2fe;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.45);
    transform: translateY(-1px);
}

/* Cụm công cụ bên phải (Search + Dark/Light mode toggle) */
.nav-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle-btn, .search-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.3);
    background: rgba(255, 255, 255, 0.05);
}

.theme-toggle-btn:hover, .search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Hộp tìm kiếm ẩn/hiện mượt mà */
.search-overlay-container {
    max-height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 950px;
    transition: max-height 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.search-overlay-container.active {
    max-height: 100px;
    margin-top: 15px;
}

/* --- HERO SECTION --- */
.hero {
    margin-top: 60px;
    width: 100%;
    max-width: 900px;
    padding: 60px 40px;
    border-radius: 40px;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px var(--glass-shadow);
    transition: transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                border-radius 0.7s ease, 
                box-shadow 0.7s ease;
}

.hero:hover {
    transform: translateY(-8px) scale(1.005);
    border-radius: 60px 30px 60px 30px;
    box-shadow: 0 30px 60px rgba(0, 242, 254, 0.15);
}

.hero h1 {
    font-size: 58px;
    font-weight: 700;
    background: var(--heading-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 35px;
}

.cta-btn {
    display: inline-block;
    background: var(--cta-bg);
    color: var(--cta-text);
    padding: 14px 36px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.6);
}

.cta-btn:hover {
    transform: scale(1.1);
    background: #00f2fe;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.4);
}

/* --- ESP32 MOCKUP CHIP DESIGN --- */
.product-mockup {
    margin-top: 50px;
    width: 280px;
    height: 280px;
    border-radius: 35px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--mockup-border);
    box-shadow: inset 0 0 25px var(--mockup-glow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.3);
}

.product-mockup::before {
    content: '';
    position: absolute;
    width: 104%;
    height: 80%;
    border-left: 6px dashed #ffb703;
    border-right: 6px dashed #ffb703;
    opacity: 0.6;
    transition: opacity 0.4s;
}

.hero:hover .product-mockup {
    transform: scale(1.06) rotate(5deg);
    border-color: #00f2fe;
    box-shadow: inset 0 0 35px rgba(0, 242, 254, 0.25), 0 15px 30px rgba(0,0,0,0.4);
}

.product-mockup span {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-color);
    z-index: 2;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 8px;
}

.core-crystal {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    border-radius: 12px;
    margin-bottom: 15px;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0,242,254,0.5);
}

/* --- POSTS SECTION & APPLE-STYLE CARDS --- */
.posts-section {
    width: 100%;
    max-width: 1100px;
    margin-top: 80px;
    padding-bottom: 50px;
    z-index: 2;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--glass-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.post-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: rgba(0,0,0,0.1);
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumb img {
    transform: scale(1.05);
}

.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 14px;
}

.post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.post-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.esp-selector {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.esp-selector label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.model-dropdown {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    transition: background 0.3s ease;
}

.model-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .model-dropdown {
    background-color: rgba(0, 0, 0, 0.05);
}

.model-dropdown option {
    background: #222;
    color: #fff;
}

[data-theme="light"] .model-dropdown option {
    background: #fff;
    color: #000;
}

/* Style cho liên kết bọc toàn bộ thẻ card */
.post-card-link {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: block;
}
.post-card-link:hover {
    transform: scale(1.02);
}

/* Khu vực chứa tag phần cứng */
.esp-hardware-tags {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}
.hardware-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.board-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}
.board-badge.default {
    opacity: 0.5;
}

/* Cấu trúc trang chi tiết */
.post-detailed-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}
.entry-content p {
    margin-bottom: 25px;
}