:root {
    font-size: 16px;
    /* 1rem = 16px base */
}

/* ========================================
           CSS RESET & BOX SIZING
           ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

/* ========================================
           FONT FACE & TYPOGRAPHY
           ======================================== */
@font-face {
    font-family: "Retrogression";
    src: url("/font/RetrogressionRegular.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "KiwiSoda";
    src: url("/font/KiwiSoda.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "CutoutPaper";
    src: url("/font/CutoutPaper.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "Rascal";
    src: url("/font/Rascal.ttf") format("truetype");
    font-display: swap;
}

/* ========================================
           BODY & BACKGROUND
           ======================================== */
body {
    margin: 0;
    padding: 10px;
    font-family: ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
    background-color: #adca6d;
    background-image: url("/image-main/background-hijau-bunga.jpg");
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: center;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    contain: layout style paint;
}

body.candy-mode {
    background-image: radial-gradient(circle at 25% 25%, #ffc0cb 2px, transparent 2px), radial-gradient(circle at 75% 75%, #f8e092 2px, transparent 2px);
    background-size: 24px 24px;
    background-repeat: repeat;
    opacity: 1;
    background-color: #ffffff;
}

/* ========================================
           DARK MODE TOGGLE BUTTON
           ======================================== */
.theme-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: rgba(249, 199, 196, 0.6);
    border: 2px solid #a47148;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    line-height: 1;
    transition: transform 0.15s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.candy-mode .theme-toggle {
    background: white;
    border: 1px solid black;
    box-shadow: 0 0 10px pink;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ========================================
           MAIN LAYOUT
           ======================================== */
.seluruh {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: auto 1fr;
    gap: 10px;
    height: calc(100vh - 20px);
    max-width: 100%;
    position: relative;
    z-index: 1;
    contain: layout style paint;
    overflow: hidden;
}

/* ========================================
           SCROLLBAR STYLES
           ======================================== */
.leftbars,
.containers {
    scrollbar-width: thin;
    scrollbar-color: #f9c7c4 white;
}

body.candy-mode .leftbars,
body.candy-mode .containers {
    scrollbar-color: pink rgba(255, 192, 203, 0.3);
}

/* ========================================
           HEADER
           ======================================== */
header {
    grid-column: 3 / span 11;
    grid-row: 1;
    border-left: 3px dotted #a47148;
    border-right: 3px dotted #a47148;
    border-radius: 100px 100px 0 0;
    background: url("/image-main/gif-bunga.gif");
    background-size: cover;
    padding-bottom: 4px;
    margin-bottom: 0px;
    transform: translateZ(0);
}

body.candy-mode header {
    border: 1px solid black;
    background: url("https://i.pinimg.com/originals/47/4a/03/474a03ab8c0e3ecac643202d12f08655.gif");
    background-size: cover;
    background-position: center;
    border-radius: 0;
}

header h1 {
    margin: 0;
    font-family: 'Retrogression', cursive;
    color: rgb(249, 199, 196);
    font-weight: bold;
    text-align: center;
    font-size: 2.125rem;
    text-shadow: -1px -1px 0 #a47148, 1px -1px 0 #a47148, -1px 1px 0 #a47148, 1px 1px 0 #a47148;
    transform: translateZ(0);
}

body.candy-mode header h1 {
    color: #c0ddff;
    text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
    font-family: 'KiwiSoda';
    padding-top: 4px;
}

/* ========================================
           SIDEBAR
           ======================================== */
.leftbars {
    grid-column: 3 / span 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0px;
    contain: content;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.leftbar {
    border: 3px dotted #a47148;
    background: rgba(249, 199, 196, 0.6);
    padding: 15px;
}

body.candy-mode .leftbar {
    border: 1px solid black;
    background: linear-gradient(0deg, #f8e092, white, #f8e092);
}

.leftbar h2 {
    margin-top: -8px;
    margin-bottom: 10px;
    color: #4b3420;
    font-size: 1.375rem;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
    font-family: 'Retrogression', cursive;
    display: flex;
    justify-content: center;
    transform: translateZ(0);
}

body.candy-mode .leftbar h2 {
    color: #c0ddff;
    margin-bottom: 6px;
    text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
    font-family: 'CutoutPaper';
}

/* ========================================
           SIDEBAR-1: NAVIGATION
           ======================================== */


.yard {
    align-items: end;
    justify-content: space-between;
    display: flex;
}

.wobble img {
    width: 40px;
    transform: translateY(3px);
    filter: drop-shadow(2px 2px 0 white) drop-shadow(-2px 2px 0 white) drop-shadow(2px -2px 0 white) drop-shadow(-2px -2px 0 white);
}

.wobble img:hover {
    scale: 1.1;
    transform: translateY(-7px);
}

.index img:hover {
    scale: 1.05;
    transform: translateY(-3px);
}

.index {
    width: 230px;
}

.index img {
    width: 100% !important;
    margin-bottom: -3px;
}

/* ========================================
           SIDEBAR-1: NAVIGATION
           ======================================== */
.main-navigation {
    display: flex;
    flex-direction: column;
}

.nav-item {
    background-color: #f9c7c4;
    border-right: 1px solid #a47148;
    border-left: 1px solid #a47148;
    margin-bottom: 0;
    overflow: hidden;
}

body.candy-mode .nav-item {
    background-color: white;
    border-right-color: black;
    border-left-color: black;
}

body.candy-mode .nav-item:first-child {
    border-radius: 20px 20px 0 0;
}

body.candy-mode .nav-item:last-child {
    border-radius: 0 0 20px 20px;
}

.nav-item:first-of-type {
    border-top: 1px solid #a47148;
    transition: border-color 0.3s ease;
}

body.candy-mode .nav-item:first-of-type {
    border-top-color: black;
}

.nav-item>a,
.nav-item>.accordion-label {
    display: block;
    padding: 3px;
    padding-left: 10px;
    text-decoration: none;
    color: #4b3420;
    font-weight: bold;
    font-size: 0.75rem;
    border-bottom: 1px solid #a47148;
    cursor: pointer;
    width: 100%;
    height: 30px;
    position: relative;
    text-align: left;
}

body.candy-mode .nav-item>a,
body.candy-mode .nav-item>.accordion-label {
    color: black;
    border-bottom-color: black;
}

.nav-item>a:hover,
.nav-item>.accordion-label:hover,
.nav-item>a:focus,
.nav-item>.accordion-label:focus {
    background: linear-gradient(90deg, #adca6d, #f9c7c4);
}

body.candy-mode .nav-item>a:hover,
body.candy-mode .nav-item>.accordion-label:hover,
body.candy-mode .nav-item>a:focus,
body.candy-mode .nav-item>.accordion-label:focus {
    background: linear-gradient(90deg, #f8e092, white);
}

input[type="checkbox"] {
    display: none;
}

.accordion-label {
    display: flex;
}

.accordion-label::after {
    content: '+';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: #a47148;
    transition: transform 0.3s ease, color 0.3s ease;
}

body.candy-mode .accordion-label::after {
    color: black;
}

input[type="checkbox"]:checked+.accordion-label::after {
    transform: translateY(-50%) rotate(135deg);
    transition: transform 0.3s ease;
}

.nav-item ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

input[type="checkbox"]:checked+.accordion-label+ul {
    max-height: 500px;
}

.nav-item ul li {
    position: relative;
    width: 100%;
}

.nav-item ul li a {
    display: flex;
    align-items: center;
    padding: 4px 40px 4px 40px;
    text-decoration: none;
    color: #4b3420;
    font-weight: bold;
    font-size: 0.75rem;
    font-style: italic;
    border-bottom: 1px solid #a47148;
    background: linear-gradient(90deg, #f9c7c4, rgb(255, 255, 255, 0.7), rgb(255, 255, 255, 0.7), #f9c7c4, #f9c7c4);
    height: 28px;
}

body.candy-mode .nav-item ul li a {
    color: black;
    border-bottom-color: black;
    background: linear-gradient(180deg, #ffc0cb, white, pink);
}

.nav-item ul li a:hover,
.nav-item ul li a:focus {
    background: linear-gradient(90deg, #adca6d, rgb(255, 255, 255, 0.7), rgb(255, 255, 255, 0.7), #adca6d, #adca6d);
    text-transform: uppercase;
}

body.candy-mode .nav-item ul li a:hover,
body.candy-mode .nav-item ul li a:focus {
    background: linear-gradient(0deg, #f8e092, white, #f8e092);
}

.icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

@keyframes scale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.menu-link.active {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-underline-offset: 1px;
    background: linear-gradient(90deg, #ec4899, #f9c7c4);
    font-weight: bolder;
}

body.candy-mode .menu-link.active {
    text-decoration-color: black;
    background: linear-gradient(90deg, #c0ddff, white);
}

.menu-link.active img {
    animation: scale 2s ease-in-out infinite;
    will-change: transform;
}

.active-underline {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    font-weight: bolder;
    background: linear-gradient(90deg, #ff8ab1, #adca6d);
}

body.candy-mode .active-underline {
    background: linear-gradient(90deg, #f8e092, #bb86fc);
}

/* ========================================
   ACTIVE MENU & SUBMENU
   ======================================== */

.nav-item.active>.accordion-label {
    background: linear-gradient(90deg, #ec4899, #f9c7c4);
    font-weight: bolder;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
}

body.candy-mode .nav-item.active>.accordion-label {
    background: linear-gradient(90deg, #c0ddff, white);
    text-decoration-color: black;
}

/* Icon animation untuk active menu */
.nav-item.active>.accordion-label img {
    animation: scale 2s ease-in-out infinite;
    will-change: transform;
}

/* Hover state untuk active menu utama */
.nav-item.active>.accordion-label:hover {
    background: linear-gradient(90deg, #adca6d, #f9c7c4);
}

body.candy-mode .nav-item.active>.accordion-label:hover {
    background: linear-gradient(90deg, #f8e092, white);
}

/* Active untuk submenu */
.nav-item ul li a.active-underline {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
    font-weight: bolder;
}

/* Hover state untuk active submenu */
.nav-item ul li a.active-underline:hover {
    background: linear-gradient(90deg, #adca6d, rgb(255, 255, 255, 0.7), rgb(255, 255, 255, 0.7), #adca6d, #adca6d) !important;
}

body.candy-mode .nav-item ul li a.active-underline:hover {
    background: linear-gradient(0deg, #f8e092, white, #f8e092) !important;
}

.nav-item a:hover {
    color: #4b3420 !important;
}

body.candy-mode .nav-item a:hover {
    color: black !important;
}

/* ========================================
           SIDEBAR-2: MY TIME
           ======================================== */
.time-item-day {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 4px 3px 4px;
    background: linear-gradient(180deg, #ff8ab1, #f9c7c4, #f9c7c4, #f9c7c4, #ff8ab1);
    border-radius: 30px 0 30px 0;
    border: 1px solid #a47148;
}

body.candy-mode .time-item-day {
    display: none;
}

.time-item-candy {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 8px 0 6px 0;
    background: linear-gradient(90deg, #c0ddff, white, white, #c0ddff);
    border-radius: 50%;
    border: 1px solid black;
}

body.candy-mode .time-item-candy {
    display: flex;
}

/* ========================================
           SIDEBAR-3: VISITORS COUNTER
           ======================================== */
.leftbar {
    display: flex;
    flex-direction: column;
    padding: -2px;
}

.button-link-1 {
    width: 100%;
    display: flex;
    margin-left: 7px;
    margin-top: -2px;
}

.button-link-1 img {
    width: 84px;
}

.button-link-1:hover {
    animation: rotateGuestbook 1s steps(2, end) infinite;
}

.button-link-2 {
    width: 100%;
    display: flex;
    margin-bottom: -90px;
}

.button-link-2 img {
    width: 112px;
    transform: translateX(85%) translateY(-154px);
}

.button-link-2:hover {
    animation: rotateGuestbook 1s steps(2, end) infinite;
}

.button-link-3 {
    display: flex;
    width: 100%;
    margin-bottom: -60px;
}

.button-link-3 img {
    width: 114px;
    transform: translateX(75%) translateY(-55px);
}

.button-link-3:hover {
    animation: rotateGuestbook 1s steps(2, end) infinite;
}

@keyframes rotateGuestbook {

    0%,
    100% {
        transform: rotate(-1deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

/* ========================================
           SIDEBAR-4: BUTTON LINK
           ======================================== */
.leftbar p {
    width: 120px;
    font-size: 0.6875rem;
    padding: 2px 4px 1px 4px;
    flex-wrap: wrap;
    color: #4b3420;
    border: 1px solid #a47148;
    border-radius: 25px 0 25px 0;
    text-align: center;
    background: linear-gradient(180deg, #ff8ab1, #f9c7c4, #f9c7c4, #f9c7c4, #ff8ab1);
}

body.candy-mode .leftbar p {
    background: linear-gradient(90deg, #c0ddff, white, white, #c0ddff);
    color: black;
    border-color: black;
    border-radius: 50%;
}


.web-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 0px;
    margin-top: 0px;
}

.web-button-link {
    display: inline-block;
    margin-bottom: 0;
    transition: transform 0.15s ease;
    will-change: transform;
}

.web-button-link img:hover {
    transform: scale(1.05);
}

.web-button-link img {
    display: block;
    object-fit: contain;
    transition: filter 0.3s ease;
}

/* ========================================
           SIDEBAR-5: COPYRIGHT
           ======================================== */
.leftbar {
    font-size: 0.75rem;
    text-align: center;
}

/* ========================================
           CONTAINER - MAIN CONTENT
           ======================================== */
.containers {
    grid-column: 6 / span 8;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0px;
    contain: content;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.kontenrow {
    display: flex;
    flex-direction: row;
    gap: 14px;
    width: 100%;
    align-items: center;
}

.kontencolumn {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.container {
    border: 3px dotted rgb(164, 113, 72);
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    font-size: 0.75rem;
    color: #4b3420;
    transition: color 0.3s ease;
    display: flex;
    flex-direction: column;
}

body.candy-mode .container {
    border: 1px solid black;
    background: linear-gradient(0deg, #c0ddff, white, #c0ddff);
    color: black;
}

.container h2 {
    margin-top: 0px;
    margin-bottom: 12px;
    padding-bottom: 5px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), #f9c7c4, rgba(255, 255, 255, 0));
    font-family: 'Retrogression', cursive;
    text-align: center;
    font-size: 1.375rem;
    color: #4b3420;
}

body.candy-mode .container h2 {
    background-image: radial-gradient(circle at 25% 25%, #c0ddff 2px, transparent 2px), radial-gradient(circle at 75% 75%, #f8e092 2px, transparent 2px);
    background-size: 12px 12px;
    background-repeat: repeat;
    opacity: 1;
    background-color: #ffffff;
    border-radius: 100px;
    border: 1px solid black;
    padding-bottom: 2px;
    color: pink;
    text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;
    font-family: 'CutoutPaper';
}

p {
    line-height: 1.4;
}

a {
    text-decoration-style: dotted;
    color: #4b3420;
}

body.candy-mode a {
    color: black;
}

a:hover {
    color: rgb(236, 72, 153);
    text-decoration-style: wavy;
}

body.candy-mode a:hover {
    color: #3392ff;
}

.breadcrumb {
    display: none;
}

@media screen and (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .seluruh {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow-x: hidden;
    }

    body {
        background-image: url("/image-main/background-hijau-bunga.jpg");
        background-repeat: repeat;
        background-size: 100%;
        background-position: top;
    }

    .header {
        order: 1;
    }

    .leftbars {
        display: none;
    }

    .breadcrumb {
        order: 2;
        border: 3px dotted #a47148;
        background: rgb(249, 199, 196, 0.8);
        padding: 12px 15px;
        font-size: 0.75rem;
    }

    body.candy-mode .breadcrumb {
        background: linear-gradient(0deg, #f8e092, white, #f8e092);
        border: 1px solid black;
        color: black;
    }

    .breadcrumb a {
        color: #4b3420;
        text-decoration: underline;
        text-decoration-style: dotted;
    }

    body.candy-mode .breadcrumb a {
        color: black;
    }

    .breadcrumb a:hover {
        text-decoration-style: wavy;
        color: #ec4899;
    }

    body.candy-mode .breadcrumb a:hover {
        color: #ff8ab1;
    }

    .active {
        background: #ec4899;
        font-weight: bold;
    }

    body.candy-mode .active {
        background-color: #c0ddff;
        color: #1a1a2e;
    }

    .containers {
        order: 3
    }

    h2 {
        font-size: 1.375rem;
    }

    p {
        font-size: 0.75rem;
    }

    .button-link-1 img {
        width: 74px;
        transform: translateX(-10%);
    }

    .button-link-2 img {
        width: 90px;
        transform: translateX(76%) translateY(-127px);
    }


    .button-link-3 img {
        width: 92px;
        transform: translateX(70%) translateY(-32px);
    }

    .kontenrow {
    display: flex;
    flex-direction: column;
    }

}