/* Diary Window */
#diary {
    top: 20px;
    left: 108px;
    width: 1100px;
    height: 700px;
}

#diary .window-content {
    padding: 0;
    overflow: hidden;
    display: flex;
    height: calc(100% - 30px);
}

/* Sidebar */
.diary-sidebar {
    width: 220px;
    background: #ffccf1;
    border-right: 2px solid #fe81cf;
    padding: 16px;
    overflow-y: auto;
}

.diary-sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #fb2d9b;
    border-bottom: 2px solid #fe81cf;
    padding-bottom: 8px;
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diary-entry-item {
    background: white;
    border: 2px solid #fe81cf;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diary-entry-item:hover {
    background: #fb2d9b;
    border-color: #fb2d9b;
    transform: translateX(4px);
}

.diary-entry-item:hover .entry-title,
.diary-entry-item:hover .entry-date {
    color: white;
}

.entry-title {
    font-size: 14px;
    font-weight: bold;
    color: #fb2d9b;
    margin-bottom: 4px;
}

.entry-date {
    font-size: 11px;
    color: #666;
}

/* Book Container */
.book-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2a1a2a;
    padding: 20px;
    position: relative;
}

/* Cover State */
.book-cover-state {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 20px;
    max-width: 900px;
}

.left-page-placeholder {
    flex: 1;
    background: #fff8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.instruction-text {
    text-align: center;
    font-size: 18px;
    color: #fb2d9b;
    font-family: 'Georgia', serif;
    line-height: 1.6;
}

.right-page-cover {
    flex: 1;
    background: #fff8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.diary-cover-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

/* Book Spread State */
.book-spread-state {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.book-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.book-spread {
    flex: 1;
    display: flex;
    position: relative;
    perspective: 2000px;
    margin-bottom: 20px;
}

.page {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 40px 35px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.left-page {
    border-radius: 4px 0 0 4px;
    transform-origin: right center;
    background-image: url('images/diaryPage_left.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.right-page {
    border-radius: 0 4px 4px 0;
    transform-origin: left center;
    background-image: url('images/diaryPage_right.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* Page flip animations */
.book-spread.flipping-next .right-page {
    transform: rotateY(-180deg);
}

.book-spread.flipping-prev .left-page {
    transform: rotateY(180deg);
}

.page-content {
    font-size: 14px;
    line-height: 1.8;
    color: #2a1a2a;
}

.page-content h2 {
    font-size: 24px;
    color: #fb2d9b;
    margin-bottom: 8px;
    font-family: 'Georgia', serif;
}

.page-content .entry-date-header {
    font-size: 12px;
    color: #999;
    margin-bottom: 24px;
    border-bottom: 1px solid #fe81cf;
    padding-bottom: 8px;
}

.page-content p {
    margin-bottom: 16px;
}

/* Page Navigation */
.page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    margin-top: 10px;
}

.page-nav-btn {
    background: #fe81cf;
    border: 2px solid #fb2d9b;
    color: white;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.page-nav-btn:hover {
    background: #fb2d9b;
    transform: scale(1.05);
}

.page-indicator {
    font-size: 14px;
    color: #fb2d9b;
    font-weight: bold;
}