:root {
    --bg-main: #D0E0F0;
    --panel-blue: #a7d0f2;
    --panel-blue-text: #1c4587;
    --panel-pink: #C08090;
    --tab-inactive: rgba(255, 255, 255, 0.5);
    --text-white: #FFFFFF;
    --text-dark: #333333;
    --text-muted: #6b7280;
    --sunday-red: #ef4444;
    --border-gray: rgba(255, 255, 255, 0.6);
}

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

body {
    background: linear-gradient(-45deg, #fbc2eb, #a6c1ee, #f5f7fa, #c3cfe2);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Gowun Dodum', 'Jua', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Scene and Book Animation */
.scene {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 70px 2rem 2rem 2rem; /* 버튼을 위해 상단 여백(70px) 추가 */
    box-sizing: border-box;
    perspective: 2000px; /* For 3D flip */
}

.book-container {
    position: relative;
    width: 100%;
    max-width: 1650px;
    /* 가로폭 확장 */
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Book Cover (Closed) */
.book-cover {
    width: 550px;
    height: 750px;
    background: #3B5F95;
    /* 이미지에 맞는 살짝 톤 다운된 블루 */
    border-radius: 12px 24px 24px 12px;
    box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.3), 15px 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transform-origin: left center;
    transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.8s ease-in-out;
    transform-style: preserve-3d;
}

.book-cover.open-animation {
    transform: rotateY(-130deg) scale(1.1);
    opacity: 0;
    pointer-events: none;
}

.cover-top-stripe {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 25px;
    background-color: #6187BE;
}

.cover-design {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 135px;
    /* 기존 100px에서 135px로 늘려 위치를 낮춤 */
    position: relative;
    z-index: 2;
    color: white;
}

.cover-title-box {
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 15px 25px;
    margin-bottom: 25px;
    text-align: center;
    width: 88%;
}

.cover-title-top {
    font-size: 1.5rem;
    font-family: 'Times New Roman', Times, serif;
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-weight: normal;
    white-space: nowrap;
}

.cover-title-main {
    font-size: 2.8rem;
    /* 줄바꿈 방지를 위해 폰트 크기 축소 */
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    letter-spacing: 3px;
    font-weight: normal;
    text-shadow: none;
    white-space: nowrap;
}

.cover-illustration-wide {
    width: 88%;
    background: white;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cover-illustration-wide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.cover-subtitle {
    margin-top: auto;
    margin-bottom: 40px;
    font-size: 1.1rem;
    font-weight: bold;
}

.cover-tabs {
    position: absolute;
    left: 100%;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 20px 0;
    gap: 0;
}

.cover-tab {
    background: var(--panel-pink);
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    width: 50px;
    text-align: left;
    transition: width 0.3s;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    align-self: flex-start;
}

.cover-tab:hover {
    width: 60px;
    background: #d6496f;
}

/* Book Inside (Open state) */
.book-inside {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out 0.3s;
    display: flex;
    justify-content: center;
}

.book-inside.visible {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    /* Take up space once open */
}

.page-wrapper {
    position: relative;
    /* 자식인 inside-tabs의 절대 좌표 기준이 됨 */
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    min-height: 980px;
    /* 크기 확장 및 유동 높이 */
    height: auto;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.5);
    background-image: linear-gradient(to right, transparent 48%, rgba(0, 0, 0, 0.03) 49%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.03) 51%, transparent 52%);
}

.inside-tabs {
    position: absolute;
    left: 100%;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 20px 0;
    z-index: 10;
    gap: 0;
}

.month-tab {
    background: var(--tab-inactive);
    color: #555;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 8px 10px;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    width: 50px;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    align-self: flex-start;
}

.month-tab:hover {
    width: 55px;
    background: rgba(255, 255, 255, 0.8);
}

.month-tab.active {
    background: linear-gradient(135deg, var(--panel-blue), #d946ef);
    color: white;
    border-color: transparent;
    width: 65px;
    box-shadow: 4px 4px 15px rgba(217, 70, 239, 0.3);
}


/* Auth Container */
.admin-auth {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.admin-auth button {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 20px;
    padding: 5px 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#login-container-wrap {
    position: relative;
}

.google-invisible {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.001;
    z-index: 10;
}

/* Left Sidebar */
.left-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2;
}

.profile-card {
    background: var(--panel-blue);
    border-radius: 12px;
    position: relative;
    padding: 20px;
    color: var(--text-white);
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.profile-image-box {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.profile-image-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.profile-avatar {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.profile-details-box {
    background: linear-gradient(135deg, #b88a96, #aa7682);
    padding: 15px 20px;
    color: white;
    font-family: 'Gowun Dodum', sans-serif;
    margin: 0;
}

.profile-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-section-title .arrows {
    font-weight: 300;
    font-family: sans-serif;
    letter-spacing: -2px;
    opacity: 0.8;
}

.profile-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.profile-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profile-info-list li:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.profile-info-list li .info-label {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover img {
    transform: scale(1.2) rotate(8deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.live-bar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s;
}

.live-bar:hover {
    transform: translateY(-2px);
}

.live-label {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #555;
}

.live-info-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.live-bar.streaming .live-label {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Main Calendar */
.main-calendar {
    flex: 1;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.poster-monthbar {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.8rem;
    font-family: 'Jua', sans-serif;
    color: var(--panel-blue-text);
    text-shadow: 0 2px 5px rgba(28, 69, 135, 0.1);
}

.date-nav-btn {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--panel-blue-text);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.date-nav-btn:hover {
    background: var(--panel-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(167, 208, 242, 0.4);
}

.calendar-layout-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Calendar Grid Overrides for app.js */
.monthly-grid {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #a7d0f2;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-shadow: inset 0 0 20px rgba(167, 208, 242, 0.1);
}

.monthly-header-row {
    background: linear-gradient(135deg, #a7d0f2 0%, #9bc2e6 100%);
    color: #1c4587;
    font-weight: bold;
    padding: 12px 0;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.monthly-header-cell {
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

.monthly-header-cell:last-child {
    border-right: none;
}

.monthly-header-cell:first-child {
    color: var(--sunday-red);
}

.week-row {
    border-bottom: 1px solid rgba(167, 208, 242, 0.4);
    flex: 1 1 0%;
    min-height: auto !important;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    position: relative;
}

.week-row:last-child {
    border-bottom: none;
}

.day-row-inner {
    display: flex;
    flex: 1;
}

.day-cell {
    flex: 1;
    padding: 5px;
    border-right: 1px solid rgba(167, 208, 242, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    transition: background 0.3s ease;
}

.monthly-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
    padding: 5px;
    border-right: 1px solid rgba(167, 208, 242, 0.4);
    position: relative;
    height: 100%;
    transition: background 0.3s;
    overflow: hidden;
}

.monthly-cell:hover {
    background: rgba(167, 208, 242, 0.15) !important;
}

.monthly-cell.empty {
    background: rgba(249, 250, 251, 0.5);
}

.monthly-cell:last-child {
    border-right: none;
}

.monthly-cell.today {
    background: rgba(240, 253, 244, 0.6);
}



.monthly-date-num span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.monthly-cell:first-child .monthly-date-num span:first-child,
.monthly-cell.is-holiday .monthly-date-num span:first-child {
    color: var(--sunday-red);
}

.monthly-cell.today .monthly-date-num span:first-child {
    background: linear-gradient(135deg, #a7d0f2, #d946ef);
    color: white;
    box-shadow: 0 4px 10px rgba(167, 208, 242, 0.4);
}

.event-block {
    padding: 3px 6px;
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    transition: transform 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    position: relative;
}

.event-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    position: relative;
}

.event-block.has-memo {
    padding-right: 10px;
}

.event-block.has-memo::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #ef4444 transparent transparent;
    pointer-events: none;
}



.event-time {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 1px 4px;
    border-radius: 3px;
    color: #333;
    margin-right: 4px;
}

/* Right Sidebar */
.right-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2;
}

.legend-box {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s;
}

.legend-box:hover {
    transform: translateY(-3px);
}

.legend-box h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    border-bottom: 2px solid rgba(167, 208, 242, 0.5);
    padding-bottom: 8px;
    color: var(--panel-blue-text);
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #444;
}

.color-legend span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.memo-sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 16px;
    flex: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 300px;
    transition: transform 0.3s;
}

.memo-sidebar:hover {
    transform: translateY(-3px);
}

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(167, 208, 242, 0.5);
    padding-bottom: 8px;
}

.memo-title {
    font-weight: bold;
    color: var(--panel-blue-text);
    font-size: 1.1rem;
}

.memo-actions button {
    background: none;
    border: none;
    color: var(--panel-blue);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: all 0.2s;
}

body:not(.admin-mode) .memo-actions {
    display: none !important;
}

body:not(.admin-mode) .post-it-btn {
    display: none !important;
}

.memo-actions button:hover {
    color: var(--panel-blue-text);
}

.lined-note {
    background-image: repeating-linear-gradient(transparent, transparent 29px, rgba(167, 208, 242, 0.3) 30px);
    background-attachment: local;
    line-height: 30px;
    flex: 1;
    overflow-y: auto;
    padding: 0 5px;
}

.post-it {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important; /* 모든 마진 제거 */
    position: relative;
    width: 100% !important;
    transform: none !important;
}

.post-it-title {
    display: block !important;
    background: transparent !important;
    border: none !important;
    font-weight: bold;
    width: 100%;
    outline: none;
    height: 30px !important;
    line-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.post-it-content,
.post-it-item-text {
    display: block !important;
    background: transparent !important;
    border: none !important;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    line-height: 30px !important; /* 배경선 30px에 맞춤 */
    color: var(--panel-blue-text);
    outline: none;
    min-height: 30px !important;
    height: auto !important; /* 글씨를 많이 쓰면 30px 단위로 늘어나야 함 */
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text;
}

.poster-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #777;
    margin-top: auto;
    padding-top: 15px;
}

.btn-close-book {
    background: linear-gradient(135deg, var(--panel-blue), #8ebae6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(167, 208, 242, 0.3);
}

.btn-close-book:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(167, 208, 242, 0.5);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    align-items: center;
}

.modal-close {
    background: rgba(167, 208, 242, 0.2);
    border: none;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
}

.modal-field {
    margin-bottom: 15px;
}

.modal-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--panel-blue-text);
}

.modal-field input,
.modal-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(167, 208, 242, 0.5);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-field input[readonly] {
    background: #f1f5f9;
    cursor: not-allowed;
}

.modal-field input:focus,
.modal-field select:focus {
    border-color: var(--panel-blue-text);
}

.custom-color-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 5px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px solid rgba(167, 208, 242, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.color-option:hover {
    background: #f8fafc;
    border-color: rgba(167, 208, 242, 0.8);
}

.color-option.selected {
    border-color: var(--panel-blue);
    background: rgba(167, 208, 242, 0.15);
    box-shadow: inset 0 0 0 1px var(--panel-blue);
}

[data-theme="dark"] .color-option {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .color-option:hover {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .color-option.selected {
    border-color: var(--panel-blue-text);
    background: rgba(167, 208, 242, 0.1);
    box-shadow: inset 0 0 0 1px var(--panel-blue-text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--panel-blue), #8ebae6);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(167, 208, 242, 0.3);
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(167, 208, 242, 0.5);
}

.edit-day-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--panel-blue-text);
    border: 1px solid rgba(167, 208, 242, 0.5);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.edit-day-btn:hover {
    background: var(--panel-blue);
    color: white;
    transform: scale(1.1);
}

body.admin-mode .monthly-cell:hover .edit-day-btn {
    display: flex;
}

/* Checklist Styles */
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(167, 208, 242, 0.4);
    transition: background 0.2s, box-shadow 0.2s;
}

.check-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--panel-blue);
}

.check-item-text {
    flex: 1;
    font-size: 0.95rem;
    outline: none;
    cursor: text;
    line-height: 1.5;
}

.check-item-text:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

.check-item.done .check-item-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.check-item-del-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.check-item-del-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.add-check-btn {
    width: 100%;
    background: rgba(167, 208, 242, 0.2);
    border: 1px dashed rgba(167, 208, 242, 0.8);
    color: var(--panel-blue-text);
    font-weight: bold;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.add-check-btn:hover {
    background: rgba(167, 208, 242, 0.4);
    border-style: solid;
}

/* Post-It Note UI Extras */
.post-it-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.post-it-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #ef4444;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-it-btn:hover {
    background: #ef4444;
    color: white;
}

/* Event Modal UI Extras */
.existing-event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(167, 208, 242, 0.1);
    border: 1px solid rgba(167, 208, 242, 0.4);
    border-radius: 8px;
    margin-bottom: 8px;
}

.existing-event-item button {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.existing-event-item button:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .page-wrapper {
        flex-direction: column;
        background-image: none;
        padding: 15px;
    }

    .left-sidebar,
    .right-sidebar {
        width: 100%;
    }

    .book-cover {
        width: 90%;
        max-width: 400px;
    }
}

:root[data-theme="dark"] {
    --bg-main: #1a1a2e;
    --panel-blue: #2a3b5c;
    --panel-blue-text: #a7d0f2;
    --text-dark: #f0f0f0;
}

[data-theme="dark"] body {
    background: linear-gradient(-45deg, #1e1b4b, #0f172a, #000000, #171923);
    color: var(--text-dark);
}

[data-theme="dark"] .page-wrapper {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .main-calendar,
[data-theme="dark"] .legend-box,
[data-theme="dark"] .memo-sidebar,
[data-theme="dark"] .profile-image-box {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
}

[data-theme="dark"] .monthly-grid {
    background: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .monthly-header-row {
    background: linear-gradient(135deg, #1e3a5f 0%, #294772 100%);
    color: #93c5fd;
}

[data-theme="dark"] .modal-content {
    background: #1e293b;
    color: #f8fafc;
}

[data-theme="dark"] .modal-field input,
[data-theme="dark"] .modal-field select {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
}

[data-theme="dark"] .modal-field input[readonly] {
    background: #1e293b;
    color: #94a3b8;
}

[data-theme="dark"] .event-block {
    color: #000 !important;
}