.journal-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
}

.journal-tabs {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 15px;
    gap: 10px;
}

.tab-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
    scroll-behavior: smooth;
    width: auto;
    max-width: calc(100% - 40px);
    flex-shrink: 1;
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    max-width: 140px;
    width: 120px;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    box-sizing: border-box;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tab.active {
    background: rgba(255, 255, 255, 0.9);
    color: #764ba2;
    border-color: rgba(255, 255, 255, 0.9);
}

.tab-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-weight: 500;
}

.tab-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.7;
    flex-shrink: 0;
}

.tab-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.tab.active .tab-close {
    color: #764ba2;
}

.tab.active .tab-close:hover {
    background-color: rgba(118, 75, 162, 0.1);
}

.add-tab-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 8px;
    margin-right: 12px;
    min-width: 28px;
    max-width: 28px;
    box-sizing: border-box;
}

.add-tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.journal-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.save-btn {
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    flex-shrink: 0;
}

.save-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.filename-input {
    border: 1px solid #007AFF;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    min-width: 200px;
    outline: none;
    transition: all 0.3s;
}

.filename-input:focus {
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 122, 255, 0.3);
}

.current-filename {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

.save-status {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
    min-width: 100px;
}

.save-status.success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.save-status.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.save-status.warning {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

#editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.journal-entry {
    flex: 1;
    padding: 20px;
    border: none;
    outline: none;
    font-family: Georgia, serif;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    background: white;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
}

.welcome-message h2 {
    margin-bottom: 10px;
    color: #333;
}

/* Dark theme styles for journal */
.theme-dark .journal-container {
    background: #2d2d2d;
    color: #e0e0e0;
}

.theme-dark .journal-editor {
    background: #2d2d2d;
}

.theme-dark .editor-toolbar {
    background: #363636;
    border-bottom-color: #555;
}

.theme-dark .save-btn {
    background: #4a4a4a;
    color: #e0e0e0;
    border-color: #666;
}

.theme-dark .save-btn:hover {
    background: #555;
}

.theme-dark .filename-input {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #666;
}

.theme-dark .filename-input:focus {
    border-color: #764ba2;
    background: #333;
}

.theme-dark .current-filename {
    color: #ccc;
}

.theme-dark .save-status {
    color: #888;
}

.theme-dark .journal-entry {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

.theme-dark .journal-entry:focus {
    background: #333;
    border-color: #764ba2;
}

.theme-dark .journal-entry::placeholder {
    color: #888;
}

.theme-dark .tab {
    background: #4a4a4a;
    color: #ccc;
    border-color: #666;
}

.theme-dark .tab.active {
    background: #2d2d2d;
    color: #e0e0e0;
    border-bottom-color: #2d2d2d;
}

.theme-dark .tab:hover:not(.active) {
    background: #555;
}

.theme-dark .tab-close {
    color: #aaa;
}

.theme-dark .tab-close:hover {
    color: #fff;
    background: #666;
}

.theme-dark .add-tab-btn {
    background: #4a4a4a;
    color: #ccc;
    border-color: #666;
}

.theme-dark .add-tab-btn:hover {
    background: #555;
    color: #fff;
}

.theme-dark .welcome-message {
    color: #ccc;
}

.theme-dark .welcome-message h2 {
    color: #e0e0e0;
}

/* Light theme styles for journal */
.theme-light .journal-container {
    background: #ffffff;
    color: #333;
}

.theme-light .journal-editor {
    background: #ffffff;
}

.theme-light .editor-toolbar {
    background: #f8f9fa;
    border-bottom-color: #dee2e6;
}

.theme-light .save-btn {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.theme-light .save-btn:hover {
    background: #0056b3;
}

.theme-light .filename-input {
    background: #ffffff;
    color: #333;
    border-color: #ced4da;
}

.theme-light .filename-input:focus {
    border-color: #007bff;
    background: #fff;
}

.theme-light .current-filename {
    color: #666;
}

.theme-light .save-status {
    color: #28a745;
}

.theme-light .journal-entry {
    background: #ffffff;
    color: #333;
    border-color: #ced4da;
}

.theme-light .journal-entry:focus {
    background: #fff;
    border-color: #007bff;
}

.theme-light .journal-entry::placeholder {
    color: #6c757d;
}

.theme-light .tab {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.theme-light .tab.active {
    background: #ffffff;
    color: #333;
    border-bottom-color: #ffffff;
}

.theme-light .tab:hover:not(.active) {
    background: #f8f9fa;
}

.theme-light .tab-close {
    color: #6c757d;
}

.theme-light .tab-close:hover {
    color: #333;
    background: #dee2e6;
}

.theme-light .add-tab-btn {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.theme-light .add-tab-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.theme-light .welcome-message {
    color: #666;
}

.theme-light .welcome-message h2 {
    color: #333;
}