/* =========================================================
   BASIC PAGE
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: #24301f;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 160, 0.95), transparent 28%),
        radial-gradient(circle at 80% 25%, rgba(163, 255, 183, 0.90), transparent 30%),
        radial-gradient(circle at 50% 75%, rgba(173, 226, 255, 0.90), transparent 32%),
        linear-gradient(135deg, #fff6a8, #c9ffb8, #b8edff, #ffd0ec);
    background-attachment: fixed;
}

/* =========================================================
   FIXED HEADER
   ========================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 72px;
    background: rgba(255, 255, 255, 0.90);
    border-bottom: 2px solid rgba(52, 120, 55, 0.25);
    backdrop-filter: blur(8px);
}

.site-header h1 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: #22652f;
}

/* =========================================================
   HAMBURGER - ALWAYS VISIBLE
   ========================================================= */

.hamburger {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    padding: 7px;
    border: 0;
    border-radius: 8px;
    background: #67c76f;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    margin: 5px 0;
    border-radius: 3px;
    background: #ffffff;
    transition: 0.25s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =========================================================
   SLIDE-OUT MENU
   ========================================================= */

.primary-menu {
    position: fixed;
    top: 72px;
    left: -250px;
    bottom: 52px;
    width: 240px;
    z-index: 900;
    padding: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    transition: left 0.25s ease;
}

.primary-menu.open {
    left: 0;
}

.primary-menu a {
    display: block;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    color: #245b2c;
    text-decoration: none;
    font-weight: bold;
    background: #e7ffe5;
}

.primary-menu a:hover {
    background: #c8f7c7;
}

/* =========================================================
   FLOATING FRUIT BACKGROUND
   ========================================================= */

.fruit-background {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.fruit {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.16));
    will-change: transform;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.content-box {
    position: relative;
    z-index: 10;
    width: min(900px, calc(100% - 30px));
    margin: 100px auto 82px auto;
    padding: 26px;
    border: 2px solid rgba(255, 255, 255, 0.80);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 40px rgba(27, 81, 35, 0.18);
    backdrop-filter: blur(7px);
}

.content-box h2 {
    margin-top: 0;
    color: #2e7b39;
}

.content-box h3 {
    color: #388b42;
}

.content-box p {
    line-height: 1.65;
}

.content-box section {
    margin-top: 34px;
}

.button-link {
    display: inline-block;
    padding: 11px 16px;
    border-radius: 9px;
    background: #52b65d;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.button-link:hover {
    background: #3d9848;
}

.post-meta {
    margin-top: -8px;
    color: #687067;
    font-size: 0.9rem;
}

/* =========================================================
   FIXED FOOTER
   ========================================================= */

.site-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 52px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    text-align: center;
    color: #245b2c;
    background: rgba(255, 255, 255, 0.92);
    border-top: 2px solid rgba(52, 120, 55, 0.25);
    backdrop-filter: blur(8px);
}

/* =========================================================
   SMALL SCREENS
   ========================================================= */

@media (max-width: 600px) {
    .site-header {
        height: 64px;
        padding: 0 58px;
    }

    .hamburger {
        left: 10px;
        width: 40px;
        height: 40px;
    }

    .primary-menu {
        top: 64px;
    }

    .fruit-background {
        top: 64px;
    }

    .content-box {
        width: calc(100% - 18px);
        margin-top: 82px;
        padding: 18px;
        border-radius: 13px;
    }
}

/* =========================================================
   VERSION 2 - CONTENT IMAGES
   ========================================================= */

.content-image {
    float: right;
    width: min(42%, 340px);
    height: auto;
    margin: 0 0 18px 24px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.post-thumb {
    float: right;
    width: 180px;
    height: 130px;
    object-fit: scale-down;
    margin: 0 0 12px 18px;
    border-radius: 12px;
}

.clear-float {
    clear: both;
}

.post-list-item {
    padding: 22px 0;
    border-bottom: 1px solid rgba(46, 123, 57, 0.20);
}

.post-list-item:last-child {
    border-bottom: 0;
}

.post-list-item h3 a {
    color: #2e7b39;
    text-decoration: none;
}

.page-text {
    line-height: 1.65;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-box {
    width: min(460px, calc(100% - 30px));
    margin: 90px auto;
    padding: 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 40px rgba(27, 81, 35, 0.18);
}

.login-box h2 {
    margin-top: 0;
    color: #2e7b39;
}

.login-box label,
.admin-form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: bold;
}

.login-box input,
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #b9cdb9;
    border-radius: 8px;
    font: inherit;
    background: #ffffff;
}

.login-box button,
.admin-form button {
    margin-top: 18px;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: #52b65d;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
}

.error-message {
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffe6e6;
    color: #8b1e1e;
}

.success-message {
    padding: 10px 12px;
    border-radius: 8px;
    background: #e8ffe7;
    color: #245b2c;
}

/* =========================================================
   ADMIN
   ========================================================= */

.admin-body {
    background: #f3f7f2;
    color: #24301f;
}

.admin-header {
    padding: 20px;
    background: #ffffff;
    border-bottom: 2px solid #d7e5d5;
}

.admin-header h1 {
    margin: 0 0 14px;
    color: #22652f;
}

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

.admin-header nav a {
    padding: 9px 12px;
    border-radius: 7px;
    color: #245b2c;
    background: #e7ffe5;
    text-decoration: none;
    font-weight: bold;
}

.admin-content {
    width: min(1200px, calc(100% - 30px));
    margin: 24px auto 60px;
    padding: 24px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.admin-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-form {
    max-width: 900px;
}

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

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.admin-preview {
    max-width: 320px;
    max-height: 260px;
    border-radius: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0 30px;
}

.stat-card {
    padding: 22px;
    border-radius: 12px;
    background: #efffec;
    text-align: center;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    color: #2e7b39;
}

.stat-card span {
    display: block;
    margin-top: 6px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 28px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border: 1px solid #d9e4d8;
    text-align: left;
    vertical-align: top;
}

th {
    background: #edf8eb;
}

.small-cell {
    max-width: 320px;
    overflow-wrap: anywhere;
}

.detail-table th {
    width: 220px;
}

.inline-form {
    display: inline;
}

.link-button {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #245b2c;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

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

@media (max-width: 600px) {
    .content-image,
    .post-thumb {
        float: none;
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0 0 18px;
    }

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

    .admin-content {
        width: calc(100% - 16px);
        padding: 15px;
    }
}


/* =========================================================
   VERSION 3 - SEO, THEMES, MODERN ADMIN DASHBOARD
   ========================================================= */

.admin-form select {
    width: 100%;
    padding: 11px;
    border: 1px solid #b9cdb9;
    border-radius: 8px;
    font: inherit;
    background: #ffffff;
}

.admin-panel {
    margin: 28px 0;
    padding: 20px;
    border: 1px solid #d9e4d8;
    border-radius: 12px;
    background: #fbfefb;
}

.compact-form {
    max-width: 760px;
}

.seo-fieldset {
    margin: 24px 0 10px;
    padding: 18px;
    border: 1px solid #ccdccc;
    border-radius: 10px;
}

.seo-fieldset legend {
    padding: 0 8px;
    color: #2e7b39;
    font-weight: bold;
}

.form-help {
    margin: 4px 0 8px;
    color: #5e6c5c;
    font-size: 0.92rem;
}

.form-help code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #edf4ec;
}

.modern-dashboard-grid {
    align-items: stretch;
}

.gauge-card {
    min-height: 215px;
    padding: 18px;
    border: 1px solid #dce8da;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f4fbf2);
    box-shadow: 0 8px 22px rgba(38, 91, 44, 0.08);
    text-align: center;
}

.gauge-card canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto -6px;
}

.gauge-card strong {
    display: block;
    font-size: 1.8rem;
    color: #2e7b39;
}

.gauge-card span {
    display: block;
    margin-top: 5px;
    color: #586557;
}

.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.table-controls input[type="search"] {
    width: min(360px, 100%);
    padding: 9px 11px;
    border: 1px solid #c9d8c8;
    border-radius: 8px;
    font: inherit;
}

.table-status {
    color: #687067;
    font-size: 0.9rem;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: -16px 0 28px;
}

.table-pagination button {
    padding: 7px 11px;
    border: 1px solid #bfd1bd;
    border-radius: 7px;
    background: #f3fbf1;
    color: #245b2c;
    cursor: pointer;
}

.table-pagination button:disabled {
    cursor: default;
    opacity: 0.45;
}

@media (max-width: 600px) {
    .table-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .table-controls input[type="search"] {
        width: 100%;
    }

    .table-pagination {
        justify-content: center;
    }
}

/* V3 revised content/editor helpers */
.post-excerpt {
    line-height: 1.65;
    margin: 0 0 1rem;
}

.form-help {
    margin: 0.35rem 0 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
}

.statistics-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin: 1rem 0; }
.statistics-filters label { display: flex; flex-direction: column; gap: .35rem; }
.statistics-filters input, .statistics-filters select { max-width: 100%; padding: .55rem; }
.statistics-method { padding: 1rem; border: 1px solid #b7c9b8; border-radius: .5rem; margin: 1rem 0; }
.statistics-method summary { cursor: pointer; font-weight: bold; }
.statistics-method li { margin: .65rem 0; }
.statistics-section { margin: 2rem 0; }
