/* Journal View */
.journal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0a0a0a;
    color: #f3f4f6;
}

.journal-splitview {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 0;
    overflow: hidden;
}

/* Left pane: entry list */
.journal-list-pane {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border-right: 1px solid #262626;
    min-width: 0;
    overflow: hidden;
}

.journal-list-header {
    padding: 16px;
    background: #141414;
    border-bottom: 1px solid #262626;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.journal-list-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.journal-list-title {
    font-size: 18px;
    color: #f97316;
    margin: 0;
}

.journal-new-btn {
    background: #f97316;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.journal-new-btn:hover {
    background: #ea580c;
    transform: scale(1.05);
}

.journal-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.journal-search-input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e5e5e5;
    font-size: 13px;
    font-family: inherit;
}

.journal-search-input:focus {
    outline: none;
    border-color: #f97316;
}

.journal-tag-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.journal-tag-chip {
    background: #1a1a1a;
    border: 1px solid #262626;
    color: #a3a3a3;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.journal-tag-chip:hover {
    border-color: #f97316;
    color: #f97316;
}

.journal-tag-chip.active {
    background: #f97316;
    border-color: #f97316;
    color: white;
}

.journal-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}

.journal-entry-item {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.journal-entry-item:hover {
    border-color: #404040;
}

.journal-entry-item.selected {
    border-color: #f97316;
    background: #1a1410;
}

.journal-entry-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.journal-entry-item-date {
    font-size: 11px;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-entry-item-template {
    font-size: 10px;
    background: #262626;
    color: #a3a3a3;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-entry-item-title {
    font-size: 14px;
    color: #e5e5e5;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journal-entry-item-preview {
    font-size: 12px;
    color: #a3a3a3;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journal-entry-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

.journal-entry-item-photos-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}

.journal-entry-item-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.journal-entry-item-tag {
    background: #1a1a1a;
    color: #a3a3a3;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* Right pane: editor / viewer */
.journal-editor-pane {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    min-width: 0;
    overflow: hidden;
}

.journal-editor-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    padding: 40px;
    text-align: center;
}

.journal-editor-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.journal-editor-empty h3 {
    color: #a3a3a3;
    font-size: 18px;
    margin-bottom: 8px;
}

.journal-editor-empty p {
    max-width: 320px;
    line-height: 1.5;
}

.journal-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.journal-editor-header {
    padding: 16px 20px;
    background: #141414;
    border-bottom: 1px solid #262626;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.journal-editor-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.journal-editor-date {
    font-size: 12px;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-editor-template-label {
    font-size: 11px;
    background: #262626;
    color: #f97316;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.journal-editor-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.journal-action-btn {
    background: #1a1a1a;
    border: 1px solid #262626;
    color: #e5e5e5;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.journal-action-btn:hover {
    background: #262626;
    border-color: #404040;
}

.journal-action-btn.danger {
    color: #ef4444;
}

.journal-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.journal-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

.journal-editor-title {
    width: 100%;
    background: transparent;
    border: none;
    color: #fafafa;
    font-size: 24px;
    font-weight: 600;
    font-family: inherit;
    margin-bottom: 16px;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.journal-editor-title:focus {
    outline: none;
    border-bottom-color: #f97316;
}

.journal-editor-title::placeholder {
    color: #4b5563;
}

.journal-editor-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #262626;
}

.journal-editor-tag {
    background: #1a1a1a;
    border: 1px solid #262626;
    color: #f97316;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.journal-editor-tag-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.journal-editor-tag-remove:hover {
    color: #ef4444;
}

.journal-editor-tag-input {
    background: transparent;
    border: 1px dashed #262626;
    color: #a3a3a3;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-family: inherit;
    min-width: 120px;
}

.journal-editor-tag-input:focus {
    outline: none;
    border-color: #f97316;
    border-style: solid;
    color: #e5e5e5;
}

.journal-editor-content {
    width: 100%;
    background: transparent;
    border: none;
    color: #e5e5e5;
    font-size: 15px;
    line-height: 1.7;
    font-family: inherit;
    resize: none;
    min-height: 300px;
    padding: 0;
}

.journal-editor-content:focus {
    outline: none;
}

.journal-editor-content::placeholder {
    color: #4b5563;
}

/* Photos section */
.journal-photos-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #262626;
}

.journal-photos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.journal-photos-title {
    font-size: 12px;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.journal-photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #141414;
    border: 1px solid #262626;
}

.journal-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.journal-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.journal-photo-item:hover .journal-photo-remove {
    opacity: 1;
}

.journal-photo-add {
    aspect-ratio: 1;
    border: 2px dashed #262626;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.journal-photo-add:hover {
    border-color: #f97316;
    color: #f97316;
}

.journal-photo-add-icon {
    font-size: 24px;
}

/* Photo lightbox */
.journal-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    cursor: pointer;
}

.journal-lightbox.open {
    display: flex;
}

.journal-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Template picker modal */
.template-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.template-picker-item:hover {
    border-color: #f97316;
    background: #1f1a15;
}

.template-picker-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.template-picker-content {
    flex: 1;
    min-width: 0;
}

.template-picker-name {
    font-size: 14px;
    color: #fafafa;
    font-weight: 600;
    margin-bottom: 4px;
}

.template-picker-description {
    font-size: 12px;
    color: #a3a3a3;
    line-height: 1.4;
}

/* Mobile: stack the split view */
@media (max-width: 768px) {
    .journal-splitview {
        grid-template-columns: 1fr;
    }

    .journal-editor-pane {
        display: none;
    }

    .journal-splitview.editor-active .journal-list-pane {
        display: none;
    }

    .journal-splitview.editor-active .journal-editor-pane {
        display: flex;
    }

    .journal-editor-body {
        padding: 16px;
    }

    .journal-editor-title {
        font-size: 20px;
    }
}
