* {
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    box-sizing: border-box;
}

body {
    padding: 0px;
    font-family: "Mansalva";
    background: url('https://ik.imagekit.io/elaravoid/sunera-sae/dithered/1000185967-dithered.png?updatedAt=1786643506342');
    background-size: 45%;
    scrollbar-width: thin;
}

.guestbook-wrapper {
    max-width: 100vw;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 25% 1fr;
    gap: 20px;
    align-items: start;
    scrollbar-width: thin;
}

h1 {
    line-height: 1;
    font-size: 2rem;
    color: #FDF6E2;
    text-shadow:
        -1px -1px 0 #4455B1,
        0 -1px 0 #4455B1,
        1px -1px 0 #4455B1,
        1px 0 0 #4455B1,
        1px 1px 0 #4455B1,
        0 1px 0 #4455B1,
        -1px 1px 0 #4455B1,
        -1px 0 0 #4455B1;
}

.left-column {
    position: sticky;
    overflow-y: auto;
    scrollbar-width: none;
    height: 100vh;
    top: 0px;
    background: url('https://ik.imagekit.io/elaravoid/sunera-sae/dithered/1000186010-dithered.png?updatedAt=1786647375289');
    background-size: auto 100%;
    background-position: center;
    padding: 50px 20px 50px 50px;
    border-right: 1px solid #4455B1;
}

.form-container {
    background: linear-gradient(0deg, #CBECEE, #FDF6E2, #FDF6E2, #FDF6E2, #FDF6E2, #FDF6E2, #CBECEE);
    border: 4px double #4455B1;
    padding: 20px;
}

.form-container h2 {
    font-size: 1.5rem;
    color: #3F7B5C;
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
}

.avatar-selection label {
    display: block;
    margin-bottom: 0px;
    font-weight: 300;
    font-size: 1rem;
    color: #4455B1;
}

.avatar-options {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
}

.avatar-option {
    width: 20%;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.avatar-option:hover {
    scale: 1.1;
}

.avatar-option.selected {
    border: 4px double #4455B1;
    background: #F0D3ED;
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-option.avatar-fallback {
    background-color: #F0D3ED !important;
    border-radius: 50% !important;
    border: 1px solid #4455B1 !important;
}

.avatar-option img.error {
    display: none !important;
}

.form-field {
    margin-bottom: 10px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 5px 5px;
    box-shadow: inset 0 0 20px #F0D3ED;
    background: #FDF6E2;
    border: 1px solid #4455B1;
    font-weight: 300;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    font-family: "Kanit";
    color: #4455B1;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: #4455B1;
    font-weight: 400;
    background: #F0D3ED;
    outline: none;
}

.form-field textarea {
    resize: vertical;
    height: 100px;
    min-height: 100px;
    max-height: 3000px;
}

.submit-btn {
    width: 80px;
    padding: 5px;
    border: 4px double #4455B1;
    border-radius: 50%;
    background: #F0D3ED;
    color: #4455B1;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.submit-btn:hover {
    background: #CBECEE;
    scale: 1.05;
    font-weight: 600;
}

.submit-btn:focus {
    scale: 0.95;
}

.submit-btn:active {
    scale: 1;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.owner-btn {
    padding: 5px 10px;
    border: 4px double #3F7B5C;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    color: #3F7B5C;
    font-weight: 400;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: "Mansalva";
}

.owner-btn:hover {
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    color: #3F7B5C;
    scale: 1.05;
}

.owner-btn:active {
    scale: 0.95;
}

.owner-btn:active {
    scale: 1;
}

.owner-btn.hidden {
    display: none;
}

.owner-notice {
    padding: 5px 10px;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    font-size: 1rem;
    font-weight: 500;
    color: #3F7B5C;
    border: 4px double #3F7B5C;
}

.owner-notice.hidden {
    display: none;
}

.password-box.hidden {
    display: none;
}

.password-box {
    display: flex;
    gap: 10px;
    flex: 1;
}

input {
    flex: 1;
    width: 150px;
    padding: 5px 10px;
    border: 4px double #3F7B5C;
    background: #FDF6E2;
    font-size: 0.9rem;
    color: #3F7B5C;
    font-family: "Kanit";
    outline: none;
}

.password-box button {
    padding: 5px 10px;
    border: 4px double #3F7B5C;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    font-family: "Mansalva";
    color: #3F7B5C;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50%;
}

.password-inputs button:hover {
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    scale: 1.05;
}

.password-inputs button:focus {
    scale: 0.95;
}

.password-inputs button:active {
    scale: 1;
}

.right-column {
    min-width: 0;
    padding: 50px 50px 50px 0px;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.homey {
    font-size: 1rem;
    font-weight: 400;
    padding: 5px 10px;
    border: 4px double #3F7B5C;
    font-family: "Mansalva";
    color: #3F7B5C;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    cursor: pointer;
    transition: all 0.2s;
}

.homey a {
    color: #3F7B5C;
    text-decoration: none;
}

.homey:hover {
    scale: 1.05;
}

.homey:focus {
    scale: 0.95
}

.homey:active {
    scale: 1;
}

.total-messages {
    font-size: 1rem;
    font-weight: 400;
    color: #3F7B5C;
    padding: 5px 10px;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    border: 4px double #3F7B5C;
}

.year-select {
    padding: 4.5px 10px;
    border: 4px double #3F7B5C;
    background: linear-gradient(180deg, #ABD69E, #FDF6E2);
    font-family: "Mansalva";
    color: #3F7B5C;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.year-select option {
    background: #FDF6E2;
    color: #3F7B5C;
}

.messages-grid {
    column-count: 4;
    column-gap: 20px;
}

.decorative-image {
    display: inline-block;
    width: 100%;
    margin-bottom: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
    text-align: center;
    padding: 0px 0;
}

.decorative-image img {
    width: 100%;
    height: auto;
    padding: 0px;
    transition: transform 0.3s ease;
}

.decorative-image img:hover {
    animation: goyang 1.5s ease-in-out infinite;
}

@keyframes goyang {
    0% {
        transform: rotate(-5deg);
    }

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

    100% {
        transform: rotate(-5deg);
    }
}

.empty-state,
.loading-state {
    column-span: all;
    padding: 50px 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #3F7B5C;
    font-size: 1rem;
    border: 4px double #3F7B5C;
    background: linear-gradient(0deg, #ABD69E, #FDF6E2);
}

.message-card {
    background: linear-gradient(0deg, #FDF6E2, #FDF6E2);
    border: 4px double #3F7B5C;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.message-card .card-header {
    padding: 5px 7px;
    background: linear-gradient(0deg, #FDF6E2, #ABD69E);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0px;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.card-author .card-name {
    font-weight: 600;
    color: #3F7B5C;
    font-size: 1rem;
    word-break: break-word;
}

.card-author .card-date {
    font-size: 0.75rem;
    color: #3F7B5C;
    white-space: nowrap;
}

.card-avatar {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-avatar.avatar-fallback {
    background: radial-gradient(#3F7B5C, #F9B472, transparent) !important;
    border-radius: 50% !important;
}

.card-avatar img.error {
    display: none !important;
}

.card-name {
    font-weight: 600;
    color: #3F7B5C;
    font-size: 1rem;
    word-break: break-word;
    line-height: 1;
}

.card-name a {
    color: #3F7B5C;
    text-decoration: underline;
    text-decoration-style: dotted;
    font-size: 1rem;
}

.card-name a:hover {
    text-decoration: underline;
}

.owner-badge {
    display: inline-block;
    background: #F9B472;
    border-radius: 50px;
    line-height: 1;
    color: #3F7B5C;
    font-size: 1rem;
    padding: 0px 5px;
    font-weight: 400;
    margin-left: 4px;
    vertical-align: middle;
    transform: translateY(-2px);
}

.card-time {
    font-size: 1rem;
    color: #3F7B5C;
    margin-left: 4px;
}

.card-delete {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #3F7B5C;
    padding: 0px 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.card-delete:hover {
    color: #3F7B5C;
    background: rgba(68, 84, 177, 0.1);
}

.card-body {
    padding: 0 10px 5px 10px;
}

.card-message {
    font-size: 0.9rem;
    color: #3F7B5C;
    line-height: 1.2;
    font-weight: 300;
    white-space: wrap;
    word-wrap: break-word;
    font-family: "Kanit";
}

.card-footer {
    padding: 3px 5px;
    border-top: 1px solid #3F7B5C;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(0deg, #ABD69E, #FDF6E2);
}

.action-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0px 5px;
    color: #3F7B5C;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 2px;
}

.action-btn:hover {
    background: #3F7B5C;
    border-radius: 50%;
    color: #F9B472;
}

.action-btn.liked {
    color: #b82f2f;
}

.action-btn.reply-btn:hover {
    background: #3F7B5C;
    border-radius: 50%;
    color: #F9B472;
}

.action-btn.reply-btn.active {
    background: linear-gradient(180deg, #FDF6E2, #ABD69E);
    border-radius: 50%;
}

.action-btn.reply-btn.active:hover {
    background: #3F7B5C;
    color: #F9B472;
}

.replies-section {
    border-top: 1px solid #3F7B5C;
    background: #FDF6E2;
}

.replies-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.replies-container.open {
    max-height: 1000px;
}

.replies-inner {
    padding: 0px;
}

.reply-item {
    padding: 10px;
    border-bottom: 1px solid #3F7B5C;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    line-height: 1;
}

.reply-avatar {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reply-avatar.avatar-fallback {
    background: radial-gradient(#ABD69E, transparent) !important;
    border-radius: 50% !important;
}

.reply-avatar img.error {
    display: none !important;
}

.reply-name {
    font-weight: 600;
    color: #3F7B5C;
    font-size: 1rem;
}

.reply-date {
    font-size: 0.75rem;
    color: #3F7B5C;
    margin-left: auto;
}

.reply-delete {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #3F7B5C;
    padding: 0 5px;
}

.reply-delete:hover {
    color: #3F7B5C;
}

.reply-message {
    font-size: 0.9rem;
    color: #3F7B5C;
    font-family: "Kanit";
    font-weight: 300;
    line-height: 1.2;
}

.reply-form {
    padding: 10px;
    background: linear-gradient(0deg, #F9B472, #FDF6E2, #F9B472);
}

.reply-form .avatar-options {
    width: 100%;
    margin-bottom: 10px;
}

.reply-form .avatar-option {
    width: 20%;
}

.reply-form .avatar-option.selected {
    border-color: #3F7B5C;
    background: #ABD69E;
}

.reply-form textarea {
    width: 100%;
    height: 100px;
    padding: 5px 10px;
    border: 1px solid #3F7B5C;
    font-weight: 300;
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    font-family: "Kanit";
    margin: 5px 0;
    background: #FDF6E2;
    box-shadow: inset 0 0 20px #ABD69E;
    color: #3F7B5C;
    margin-bottom: 10px;
}

.reply-form input[type="text"]:focus,
.reply-form textarea:focus {
    background: #ABD69E;
    font-weight: 400;
}

.reply-form input[type="text"] {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #3F7B5C;
    font-size: 0.9rem;
    font-weight: 300;
    outline: none;
    font-family: "Kanit";
    background: #FDF6E2;
    box-shadow: inset 0 0 20px #ABD69E;
    color: #3F7B5C;
    margin-bottom: 5px;
}

.reply-form button {
    padding: 5px 15px;
    border-radius: 50%;
    border: 4px double #3F7B5C;
    background: #ABD69E;
    color: #3F7B5C;
    font-weight: 400;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: "Mansalva";
}

.reply-form button:hover {
    background: #F9B472;
    scale: 1.05;
    font-weight: 600;
}

.reply-form button:focus {
    scale: 0.95;
}

.reply-form button:active {
    scale: 1;
}

.notification {
    position: fixed;
    top: 0px;
    left: 0px;
    padding: 5px 10px;
    font-weight: 400;
    z-index: 1000;
    animation: slideIn 1s ease-in-out;
    border: 4px double #3F7B5C;
}

.notification.success {
    background: #FDF6E2;
    color: #3F7B5C;
}

.notification.error {
    background: #FDF6E2;
    color: #b82f2f;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

    body {
        padding: 0px;
        background-size: 100%;
    }

    .guestbook-wrapper {
        grid-template-columns: 1fr;
    }

    .left-column {
        position: static;
        height: auto;
        border-right: none;
        padding: 15px;
        border-bottom: 1px solid #3F7B5C;
    }

    .right-column {
        padding: 0px 15px;
    }

    .avatar-option {
        width: 17%
    }

    .reply-form .avatar-option {
        width: 17%
    }

    .messages-grid {
        column-count: 1;
        column-gap: 0;
    }

    .message-card {
        margin-bottom: 3px;
    }

    .form-container {
        padding: 15px;
    }

    .header-left {
        gap: 0;
        width: 100%;
    }

    .password-box {
        gap: 0
    }

    .admin-controls {
        flex-direction: row;
        gap: 0px;
    }

    .password-inputs {
        flex-wrap: wrap;
        gap: 0px;
    }

    .messages-header {
        display: flex;
        flex-direction: row;
        gap: 10px;
        padding: 0px;
    }

    .header-right {
        gap: 0;
    }

    .decorative-image img {
        width: 50%
    }
}