;;; mauve-dream-theme.el --- A dreamy purple and mauve theme for Emacs

;; Author: x51
;; Version: 1.0.0
;; Package-Requires: ((emacs "24.1"))
;; Keywords: faces themes

;;; Commentary:
;; A dreamy purple and mauve theme based on the Mauvve Dream color palette

;;; Code:

(deftheme mauve-dream
  "A dreamy purple and mauve theme.")

(let ((class '((class color) (min-colors 89)))
      ;; Purple Waves - Dark background shades
      (pw-bg-0 "#1e1a2d")     ; Darkest purple background
      (pw-bg-1 "#252136")     ; Dark purple background 
      (pw-bg-2 "#2d2840")     ; Medium dark purple
      (pw-bg-3 "#362e4a")     ; Medium purple background
      
      ;; Mauve Sky - Light foreground shades
      (ms-fg-0 "#d8cee3")     ; Light mauve (main text)
      (ms-fg-1 "#ded5ed")     ; Lighter mauve
      (ms-fg-2 "#e5ddf2")     ; Even lighter mauve
      (ms-fg-3 "#ecebf5")     ; Almost white mauve
      
      ;; Dream - Accent colors
      (dr-accent-0 "#9d81c7") ; Primary accent color
      (dr-accent-1 "#b68ed6") ; Secondary accent color
      (dr-accent-2 "#7c78a8") ; Tertiary accent color
      (dr-accent-3 "#a694c9") ; Quaternary accent color
      
      ;; Lucid - Vibrant colors
      (lc-red "#bf5f82")      ; Red highlight
      (lc-orange "#c7797b")   ; Orange highlight
      (lc-yellow "#cfa8b4")   ; Yellow/Pink highlight
      (lc-green "#9bc5b9")    ; Green highlight
      (lc-pink "#d88ad2"))    ; Pink highlight

  (custom-theme-set-faces
   'mauve-dream
   
   ;; Basic faces
   `(default ((,class (:foreground ,ms-fg-0 :background ,pw-bg-0))))
   `(cursor ((,class (:background ,ms-fg-2))))
   `(fringe ((,class (:background ,pw-bg-0))))
   `(hl-line ((,class (:background ,pw-bg-1))))
   `(region ((,class (:background ,pw-bg-3))))
   `(vertical-border ((,class (:foreground ,pw-bg-2))))
   `(secondary-selection ((,class (:background ,pw-bg-2))))
   `(minibuffer-prompt ((,class (:foreground ,dr-accent-0 :bold t))))
   `(highlight ((,class (:background ,pw-bg-2))))
   `(shadow ((,class (:foreground ,dr-accent-2))))
   
   ;; Font lock faces
   `(font-lock-builtin-face ((,class (:foreground ,dr-accent-0))))
   `(font-lock-comment-face ((,class (:foreground ,dr-accent-2 :slant italic))))
   `(font-lock-comment-delimiter-face ((,class (:foreground ,dr-accent-2))))
   `(font-lock-constant-face ((,class (:foreground ,lc-orange))))
   `(font-lock-doc-face ((,class (:foreground ,dr-accent-2))))
   `(font-lock-function-name-face ((,class (:foreground ,lc-yellow))))
   `(font-lock-keyword-face ((,class (:foreground ,lc-pink))))
   `(font-lock-negation-char-face ((,class (:foreground ,lc-red))))
   `(font-lock-preprocessor-face ((,class (:foreground ,dr-accent-1))))
   `(font-lock-regexp-grouping-backslash ((,class (:foreground ,dr-accent-3))))
   `(font-lock-regexp-grouping-construct ((,class (:foreground ,dr-accent-3))))
   `(font-lock-string-face ((,class (:foreground ,lc-green))))
   `(font-lock-type-face ((,class (:foreground ,dr-accent-0))))
   `(font-lock-variable-name-face ((,class (:foreground ,lc-yellow))))
   `(font-lock-warning-face ((,class (:foreground ,lc-red :bold t))))
   
   ;; Mode line
   `(mode-line ((,class (:foreground ,ms-fg-1 :background ,pw-bg-2 :box (:line-width 1 :color ,pw-bg-2)))))
   `(mode-line-buffer-id ((,class (:foreground ,ms-fg-2 :bold t))))
   `(mode-line-emphasis ((,class (:foreground ,ms-fg-3))))
   `(mode-line-highlight ((,class (:background ,dr-accent-0 :foreground ,pw-bg-0))))
   `(mode-line-inactive ((,class (:foreground ,dr-accent-2 :background ,pw-bg-1 :box (:line-width 1 :color ,pw-bg-1)))))
   
   ;; Search
   `(isearch ((,class (:foreground ,pw-bg-0 :background ,dr-accent-0))))
   `(isearch-fail ((,class (:foreground ,lc-red :background ,pw-bg-1))))
   `(lazy-highlight ((,class (:foreground ,pw-bg-0 :background ,dr-accent-1))))
   
   ;; Line numbers
   `(line-number ((,class (:foreground ,dr-accent-2 :background ,pw-bg-0))))
   `(line-number-current-line ((,class (:foreground ,ms-fg-2 :background ,pw-bg-1))))
   
   ;; Dired
   `(dired-directory ((,class (:foreground ,dr-accent-0 :weight bold))))
   `(dired-flagged ((,class (:foreground ,lc-red))))
   `(dired-header ((,class (:foreground ,lc-yellow :weight bold))))
   `(dired-ignored ((,class (:foreground ,dr-accent-2))))
   `(dired-mark ((,class (:foreground ,dr-accent-0 :weight bold))))
   `(dired-marked ((,class (:foreground ,lc-yellow :weight bold))))
   `(dired-perm-write ((,class (:foreground ,ms-fg-0 :underline t))))
   `(dired-symlink ((,class (:foreground ,lc-pink :weight bold))))
   `(dired-warning ((,class (:foreground ,lc-orange :weight bold))))
   
   ;; Company
   `(company-tooltip ((,class (:foreground ,ms-fg-0 :background ,pw-bg-1))))
   `(company-tooltip-common ((,class (:foreground ,dr-accent-0))))
   `(company-tooltip-common-selection ((,class (:foreground ,ms-fg-3))))
   `(company-tooltip-selection ((,class (:background ,pw-bg-2))))
   `(company-tooltip-annotation ((,class (:foreground ,dr-accent-1))))
   `(company-scrollbar-bg ((,class (:background ,pw-bg-1))))
   `(company-scrollbar-fg ((,class (:background ,dr-accent-2))))
   `(company-preview ((,class (:background nil :foreground ,dr-accent-0))))
   `(company-preview-common ((,class (:foreground ,dr-accent-1))))
   
   ;; Flycheck
   `(flycheck-error ((,class (:underline (:style wave :color ,lc-red)))))
   `(flycheck-info ((,class (:underline (:style wave :color ,lc-green)))))
   `(flycheck-warning ((,class (:underline (:style wave :color ,lc-yellow)))))
   
   ;; Org
   `(org-block ((,class (:foreground ,ms-fg-0 :background ,pw-bg-1 :extend t))))
   `(org-block-begin-line ((,class (:foreground ,dr-accent-2 :background ,pw-bg-1 :slant italic :extend t))))
   `(org-block-end-line ((,class (:foreground ,dr-accent-2 :background ,pw-bg-1 :slant italic :extend t))))
   `(org-document-info ((,class (:foreground ,dr-accent-0))))
   `(org-document-title ((,class (:foreground ,dr-accent-0 :weight bold :height 1.2))))
   `(org-done ((,class (:foreground ,lc-green :weight bold))))
   `(org-headline-done ((,class (:foreground ,dr-accent-2))))
   `(org-level-1 ((,class (:foreground ,dr-accent-0 :weight bold :height 1.1))))
   `(org-level-2 ((,class (:foreground ,dr-accent-1 :weight bold))))
   `(org-level-3 ((,class (:foreground ,lc-yellow :weight bold))))
   `(org-level-4 ((,class (:foreground ,lc-green))))
   `(org-level-5 ((,class (:foreground ,lc-pink))))
   `(org-level-6 ((,class (:foreground ,dr-accent-3))))
   `(org-level-7 ((,class (:foreground ,lc-orange))))
   `(org-level-8 ((,class (:foreground ,ms-fg-1))))
   `(org-todo ((,class (:foreground ,lc-red :weight bold))))
   `(org-special-keyword ((,class (:foreground ,dr-accent-2))))
   `(org-date ((,class (:foreground ,dr-accent-1))))
   `(org-link ((,class (:foreground ,dr-accent-0 :underline t))))
   `(org-code ((,class (:foreground ,lc-green))))
   `(org-verbatim ((,class (:foreground ,lc-orange))))
   
   ;; Magit
   `(magit-branch-local ((,class (:foreground ,dr-accent-0))))
   `(magit-branch-remote ((,class (:foreground ,lc-green))))
   `(magit-hash ((,class (:foreground ,dr-accent-2))))
   `(magit-section-heading ((,class (:foreground ,lc-yellow :weight bold))))
   `(magit-section-highlight ((,class (:background ,pw-bg-1))))
   `(magit-diff-added ((,class (:background ,pw-bg-0 :foreground ,lc-green))))
   `(magit-diff-added-highlight ((,class (:background ,pw-bg-1 :foreground ,lc-green))))
   `(magit-diff-removed ((,class (:background ,pw-bg-0 :foreground ,lc-red))))
   `(magit-diff-removed-highlight ((,class (:background ,pw-bg-1 :foreground ,lc-red))))
   
   ;; Markdown
   `(markdown-header-face-1 ((,class (:foreground ,dr-accent-0 :weight bold :height 1.2))))
   `(markdown-header-face-2 ((,class (:foreground ,dr-accent-1 :weight bold :height 1.1))))
   `(markdown-header-face-3 ((,class (:foreground ,lc-yellow :weight bold))))
   `(markdown-header-face-4 ((,class (:foreground ,lc-pink))))
   `(markdown-header-face-5 ((,class (:foreground ,dr-accent-3))))
   `(markdown-header-face-6 ((,class (:foreground ,dr-accent-2))))
   `(markdown-code-face ((,class (:foreground ,lc-green :background ,pw-bg-1))))
   `(markdown-blockquote-face ((,class (:foreground ,dr-accent-2 :slant italic))))
   `(markdown-link-face ((,class (:foreground ,dr-accent-0))))
   `(markdown-url-face ((,class (:foreground ,dr-accent-1 :underline t))))
   
   ;; Rainbow delimiters
   `(rainbow-delimiters-depth-1-face ((,class (:foreground ,dr-accent-0))))
   `(rainbow-delimiters-depth-2-face ((,class (:foreground ,lc-yellow))))
   `(rainbow-delimiters-depth-3-face ((,class (:foreground ,dr-accent-1))))
   `(rainbow-delimiters-depth-4-face ((,class (:foreground ,lc-green))))
   `(rainbow-delimiters-depth-5-face ((,class (:foreground ,lc-pink))))
   `(rainbow-delimiters-depth-6-face ((,class (:foreground ,dr-accent-3))))
   `(rainbow-delimiters-depth-7-face ((,class (:foreground ,lc-orange))))
   `(rainbow-delimiters-depth-8-face ((,class (:foreground ,ms-fg-2))))
   `(rainbow-delimiters-unmatched-face ((,class (:foreground ,lc-red))))
   
   ;; Web mode
   `(web-mode-html-tag-face ((,class (:foreground ,dr-accent-0))))
   `(web-mode-html-attr-name-face ((,class (:foreground ,lc-yellow))))
   `(web-mode-html-attr-value-face ((,class (:foreground ,lc-green))))
   `(web-mode-css-selector-face ((,class (:foreground ,lc-pink))))
   `(web-mode-css-property-name-face ((,class (:foreground ,lc-yellow))))
   `(web-mode-css-string-face ((,class (:foreground ,lc-green))))
   
   ;; Eshell
   `(eshell-prompt ((,class (:foreground ,dr-accent-0 :weight bold))))
   `(eshell-ls-directory ((,class (:foreground ,dr-accent-0 :weight bold))))
   `(eshell-ls-symlink ((,class (:foreground ,lc-pink :weight bold))))
   `(eshell-ls-executable ((,class (:foreground ,lc-green :weight bold))))
   `(eshell-ls-archive ((,class (:foreground ,lc-yellow))))
   `(eshell-ls-backup ((,class (:foreground ,dr-accent-2))))
   `(eshell-ls-clutter ((,class (:foreground ,dr-accent-2))))
   `(eshell-ls-missing ((,class (:foreground ,lc-red))))
   `(eshell-ls-product ((,class (:foreground ,ms-fg-0))))
   `(eshell-ls-readonly ((,class (:foreground ,lc-orange))))
   `(eshell-ls-special ((,class (:foreground ,lc-pink))))
   `(eshell-ls-unreadable ((,class (:foreground ,dr-accent-2))))
   
   ;; Terminal
   `(term ((,class (:foreground ,ms-fg-0 :background ,pw-bg-0))))
   `(term-color-black ((,class (:foreground ,pw-bg-1 :background ,pw-bg-1))))
   `(term-color-red ((,class (:foreground ,lc-red :background ,lc-red))))
   `(term-color-green ((,class (:foreground ,lc-green :background ,lc-green))))
   `(term-color-yellow ((,class (:foreground ,lc-yellow :background ,lc-yellow))))
   `(term-color-blue ((,class (:foreground ,dr-accent-0 :background ,dr-accent-0))))
   `(term-color-magenta ((,class (:foreground ,lc-pink :background ,lc-pink))))
   `(term-color-cyan ((,class (:foreground ,lc-green :background ,lc-green))))
   `(term-color-white ((,class (:foreground ,ms-fg-0 :background ,ms-fg-0))))
   
   ;; Which function
   `(which-func ((,class (:foreground ,dr-accent-0))))
   
   ;; Diff
   `(diff-added ((,class (:foreground ,lc-green))))
   `(diff-removed ((,class (:foreground ,lc-red))))
   `(diff-changed ((,class (:foreground ,lc-yellow))))
   
   ;; Linum/Line numbers
   `(linum ((,class (:foreground ,dr-accent-2 :background ,pw-bg-0))))
   
   ;; Additional syntax highlighting
   `(escape-glyph ((,class (:foreground ,dr-accent-3))))
   `(homoglyph ((,class (:foreground ,dr-accent-3))))
   `(error ((,class (:foreground ,lc-red :bold t))))
   `(warning ((,class (:foreground ,lc-yellow))))
   `(success ((,class (:foreground ,lc-green))))
   
   ;; Show paren
   `(show-paren-match ((,class (:foreground ,ms-fg-3 :background ,dr-accent-0 :weight bold))))
   `(show-paren-mismatch ((,class (:foreground ,pw-bg-0 :background ,lc-red :weight bold))))
   
   ;; Helm
   `(helm-header ((,class (:foreground ,ms-fg-1 :background ,pw-bg-0 :underline nil :box nil))))
   `(helm-source-header ((,class (:foreground ,pw-bg-0 :background ,dr-accent-0 :weight bold))))
   `(helm-selection ((,class (:background ,pw-bg-2))))
   `(helm-match ((,class (:foreground ,dr-accent-0))))
   `(helm-visible-mark ((,class (:foreground ,pw-bg-0 :background ,lc-green))))
   
   ;; LSP
   `(lsp-face-highlight-textual ((,class (:background ,pw-bg-2))))
   `(lsp-face-highlight-read ((,class (:background ,pw-bg-2))))
   `(lsp-face-highlight-write ((,class (:background ,pw-bg-2))))
   
   ;; Ivy
   `(ivy-current-match ((,class (:foreground ,ms-fg-3 :background ,pw-bg-2))))
   `(ivy-minibuffer-match-face-1 ((,class (:foreground ,dr-accent-0))))
   `(ivy-minibuffer-match-face-2 ((,class (:foreground ,lc-yellow :weight bold))))
   `(ivy-minibuffer-match-face-3 ((,class (:foreground ,lc-pink :weight bold))))
   `(ivy-minibuffer-match-face-4 ((,class (:foreground ,lc-green :weight bold))))

   ;; IDO
   `(ido-first-match ((,class (:foreground ,lc-yellow :weight bold))))
   `(ido-only-match ((,class (:foreground ,lc-green :weight bold))))
   `(ido-subdir ((,class (:foreground ,dr-accent-0 :weight bold))))
   ))

;;;###autoload
(when load-file-name
  (add-to-list 'custom-theme-load-path
               (file-name-as-directory (file-name-directory load-file-name))))

(provide-theme 'mauve-dream)

;;; mauve-dream-theme.el ends here
