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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    line-height: 1.8;
    color: #222;
    background: #fefefe;
    transition: background 0.4s ease, color 0.4s ease;
}

a {
    color: #c0392b;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

/* ===== Header & Navigation ===== */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid #f0e6d3;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #c0392b;
    letter-spacing: 1px;
}

.logo span {
    color: #2c3e50;
    transition: color 0.3s ease;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

nav a {
    margin: 0 14px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #c0392b;
    transition: width 0.3s ease;
}

nav a:hover {
    color: #c0392b;
    text-decoration: none;
}

nav a:hover::after {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 200px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.search-box button {
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-box button:hover {
    background: #a93226;
    transform: scale(1.05);
}

.dark-mode-toggle {
    background: none;
    border: 1px solid #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.dark-mode-toggle:hover {
    background: rgba(192, 57, 43, 0.1);
    border-color: #c0392b;
}

/* ===== Breadcrumb ===== */
nav[aria-label="Breadcrumb"] {
    background: #f9f5f0;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    transition: background 0.4s ease;
}

nav[aria-label="Breadcrumb"] a {
    color: #c0392b;
}

/* ===== Banner Slider ===== */
.banner-slider {
    position: relative;
    overflow: hidden;
    height: 400px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease, transform 1.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.banner-slide.active {
    opacity: 1;
    transform: scale(1);
}

.banner-slide:nth-child(1) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.banner-slide:nth-child(2) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.banner-slide:nth-child(3) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10%, 10%); }
}

.hero h1 {
    font-size: 42px;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 18px;
    color: #555;
    max-width: 700px;
    margin: 0 auto 30px;
    position: relative;
    z-index: 1;
}

.hero .btn {
    background: #c0392b;
    color: #fff;
    padding: 14px 36px;
    border-radius: 30px;
    font-size: 18px;
    display: inline-block;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.3);
}

.hero .btn:hover {
    background: #a93226;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4);
    text-decoration: none;
}

/* ===== Section Common ===== */
.section {
    padding: 60px 0;
    transition: background 0.4s ease;
}

.section h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 20px;
    border-left: 5px solid #c0392b;
    padding-left: 18px;
    position: relative;
    transition: color 0.4s ease;
}

.section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #c0392b, transparent);
    border-radius: 2px;
}

.section h3 {
    font-size: 24px;
    color: #34495e;
    margin: 30px 0 15px;
    transition: color 0.4s ease;
}

.section h4 {
    font-size: 20px;
    color: #555;
    margin: 20px 0 10px;
    transition: color 0.4s ease;
}

/* ===== Grid Layouts ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

/* ===== Card ===== */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(240, 230, 211, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(192, 57, 43, 0.3);
}

.card h3 {
    margin-top: 0;
}

/* ===== FAQ ===== */
.faq-item {
    border-bottom: 1px solid #eee;
    padding: 16px 0;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.faq-item:hover {
    border-color: #c0392b;
}

.faq-question {
    font-weight: 600;
    font-size: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-item:hover .faq-question {
    color: #c0392b;
}

.faq-question span {
    font-size: 22px;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    padding-top: 0;
    color: #555;
}

.faq-answer.open {
    max-height: 600px;
    padding-top: 12px;
}

/* ===== Article List ===== */
.article-list article {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    transition: border-color 0.3s ease;
}

.article-list article:hover {
    border-color: #c0392b;
}

.article-list article h3 {
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.article-list article:hover h3 {
    color: #c0392b;
}

.article-meta {
    color: #888;
    font-size: 14px;
}

/* ===== HowTo ===== */
.howto-step {
    margin: 20px 0;
    padding-left: 20px;
    border-left: 3px solid #c0392b;
    transition: border-color 0.3s ease;
}

.howto-step:hover {
    border-left-color: #a93226;
}

.howto-step p {
    margin: 8px 0;
}

/* ===== Footer ===== */
.footer {
    background: #2c3e50;
    color: #eee;
    padding: 40px 0;
    transition: background 0.4s ease;
}

.footer a {
    color: #f5cba7;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 18px;
}

.footer ul li {
    margin: 6px 0;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #c0392b;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.3);
}

.back-to-top.show {
    opacity: 1;
}

.back-to-top:hover {
    background: #a93226;
    transform: scale(1.1);
}

/* ===== Dark Mode ===== */
body.dark {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark header {
    background: rgba(22, 33, 62, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: #0f3460;
}

body.dark .logo span {
    color: #e0e0e0;
}

body.dark nav a {
    color: #ccc;
}

body.dark .card {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: #0f3460;
}

body.dark .hero {
    background: #16213e;
}

body.dark .hero h1 {
    color: #e0e0e0;
}

body.dark .hero p {
    color: #bbb;
}

body.dark .section {
    background: transparent;
}

body.dark .section h2 {
    color: #e0e0e0;
}

body.dark .section h3 {
    color: #ccc;
}

body.dark .section h4 {
    color: #aaa;
}

body.dark .faq-item {
    border-color: #333;
}

body.dark .faq-answer {
    color: #bbb;
}

body.dark .article-list article {
    border-color: #333;
}

body.dark .article-meta {
    color: #999;
}

body.dark .footer {
    background: #0f3460;
}

body.dark nav[aria-label="Breadcrumb"] {
    background: #16213e;
    color: #bbb;
}

body.dark .search-box input {
    background: rgba(255, 255, 255, 0.1);
    border-color: #444;
    color: #e0e0e0;
}

body.dark .search-box input:focus {
    border-color: #c0392b;
}

body.dark .dark-mode-toggle {
    border-color: #555;
    color: #e0e0e0;
}

body.dark .banner-slider {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .logo {
        text-align: center;
    }

    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav a {
        margin: 4px 8px;
        font-size: 14px;
    }

    .search-box {
        justify-content: center;
        width: 100%;
    }

    .search-box input {
        width: 140px;
        flex: 1;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .banner-slider {
        height: 250px;
    }

    .banner-slide {
        font-size: 22px;
    }

    .section h2 {
        font-size: 26px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .section {
        padding: 40px 0;
    }

    .banner-slider {
        height: 200px;
    }

    .banner-slide {
        font-size: 18px;
    }
}

/* ===== Scroll Animations ===== */
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Hover Effects ===== */
.card,
.article-list article,
.faq-item,
.howto-step {
    will-change: transform, opacity;
}

/* ===== Print Styles ===== */
@media print {
    header,
    .back-to-top,
    .banner-slider {
        display: none;
    }

    .section {
        opacity: 1 !important;
        transform: none !important;
        page-break-inside: avoid;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}