/* Journal Module Styles */

.journal-container {
    height: 100%;
    margin-top: 1rem;
    position: relative;
}

.journal-wrapper {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 180px);
    min-height: 500px;
}

/* Sidebar / History */
.journal-sidebar {
    width: 320px;
    background: var(--color-widget);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.journal-sidebar h3 {
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-title);
    font-size: 1rem;
}

.journal-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem;
}

.journal-history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    position: relative;
}

.journal-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.journal-history-item.active {
    border-color: var(--color-accent);
}

.journal-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-date {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: bold;
}

.history-preview {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
}

.journal-delete-btn {
    background: transparent;
    border: none;
    color: #ff5555;
    opacity: 0.3;
    cursor: pointer;
    padding: 4px;
}

.journal-history-item:hover .journal-delete-btn {
    opacity: 1;
}

/* Main Editor Area */
.journal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.journal-date-picker {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    font-family: inherit;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    max-width: 150px;
}

#journal-save-btn {
    background: var(--color-accent) !important;
    color: #000 !important;
    font-weight: bold;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.journal-editor-container {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-widget);
}

.journal-textarea {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    background: transparent;
    color: var(--color-text);
    border: none;
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', 'Menlo', monospace;
    resize: none;
    line-height: 1.6;
    box-sizing: border-box;
    display: block;
}

.journal-textarea:focus {
    outline: none;
}

.journal-status {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--color-accent);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    pointer-events: none;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.journal-status.show {
    display: block;
}

.journal-status.unsaved {
    color: #ffaa00;
}

/* Responsive */
@media (max-width: 900px) {
    .journal-wrapper {
        flex-direction: column;
        height: auto;
    }

    .journal-sidebar {
        width: 100%;
        height: 200px;
    }

    .journal-textarea {
        min-height: 400px;
    }
}
/* Journal navigation additions */
.journal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.journal-wordcount {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text);
    opacity: 0.55;
    white-space: nowrap;
}

.journal-history-month {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    opacity: 0.85;
    margin: 14px 4px 6px;
}

.journal-history-month:first-child {
    margin-top: 2px;
}

.journal-history-empty {
    padding: 20px 8px;
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0.5;
    line-height: 1.6;
}
