/* ========================================
   WuKun Files - Retro Typewriter Theme
   ======================================== */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Playfair+Display:wght@700&display=swap");

:root {
  --bg-deep:    #1f1b17;
  --bg-main:    #272220;
  --bg-surface: #2e2924;
  --bg-hover:   #383230;
  --bg-input:   #1a1714;
  --border:      #3d3530;
  --border-dot:  #4a4038;
  --border-gold: #7a6a50;
  --text-primary:   #cdc0ad;
  --text-secondary: #9a8e7e;
  --text-muted:     #6b6055;
  --accent:       #b89a60;
  --accent-hover: #d4b478;
  --accent-dim:   #8a7548;
  --danger:  #a85454;
  --info:    #6a8fa8;
  --success: #6a9a6a;
}

* { box-sizing: border-box; }

body, #app {
  background-color: var(--bg-main) !important;
  color: var(--text-primary) !important;
  font-family: "IBM Plex Mono", "Courier New", monospace !important;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image: radial-gradient(circle, rgba(184,154,96,0.04) 1px, transparent 1px) !important;
  background-size: 20px 20px !important;
}

/* Nav */
#nav {
  background-color: var(--bg-deep) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3) !important;
}

#nav .action {
  color: var(--text-secondary) !important;
  transition: color 0.2s, background 0.2s !important;
  border-radius: 4px !important;
}

#nav .action:hover {
  color: var(--accent-hover) !important;
  background-color: var(--bg-hover) !important;
}

/* Breadcrumbs */
.breadcrumbs {
  background-color: var(--bg-deep) !important;
  border-bottom: 1px dotted var(--border-dot) !important;
  font-size: 0.85rem !important;
}

.breadcrumbs a { color: var(--accent) !important; text-decoration: none !important; }
.breadcrumbs a:hover { color: var(--accent-hover) !important; }
.breadcrumbs span, .breadcrumbs .chevron { color: var(--text-muted) !important; }

/* Listing */
#listing { background-color: transparent !important; }

#listing.list .header {
  background-color: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--text-muted) !important;
}

#listing.list .header span { color: var(--text-muted) !important; }

#listing .item {
  background-color: transparent !important;
  border-bottom: 1px dotted var(--border-dot) !important;
  transition: background-color 0.15s, border-left 0.15s !important;
  border-left: 3px solid transparent !important;
}

#listing .item:hover {
  background-color: var(--bg-hover) !important;
  border-left-color: var(--accent-dim) !important;
}

#listing .item.selected {
  background-color: rgba(184,154,96,0.08) !important;
  border-left-color: var(--accent) !important;
}

#listing .item .name { color: var(--text-primary) !important; }
#listing .item:hover .name { color: var(--accent-hover) !important; }
#listing .item .size { color: var(--text-secondary) !important; font-size: 0.82rem !important; }
#listing .item .modified { color: var(--text-muted) !important; font-size: 0.82rem !important; }

#listing .item i { color: var(--accent-dim) !important; opacity: 0.85 !important; }
#listing .item:hover i { color: var(--accent) !important; opacity: 1 !important; }

/* Gallery view */
.gallery .item {
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  background-color: var(--bg-surface) !important;
  transition: all 0.2s !important;
}

.gallery .item:hover {
  border-color: var(--accent-dim) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

/* Search */
#search { background-color: var(--bg-deep) !important; border-bottom: 1px solid var(--border) !important; }

#search input, #input {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  font-family: "IBM Plex Mono", monospace !important;
}

#search input:focus, #input:focus {
  border-color: var(--accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(184,154,96,0.15) !important;
}

input::placeholder { color: var(--text-muted) !important; font-style: italic !important; }

/* Buttons */
.button, button, .action {
  font-family: "IBM Plex Mono", monospace !important;
  transition: all 0.2s !important;
  border-radius: 4px !important;
}

.button--flat { color: var(--text-secondary) !important; }
.button--flat:hover { color: var(--accent-hover) !important; background-color: var(--bg-hover) !important; }

.button--blue {
  background-color: var(--accent) !important;
  color: var(--bg-deep) !important;
  border: none !important;
  font-weight: 500 !important;
}

.button--blue:hover {
  background-color: var(--accent-hover) !important;
  box-shadow: 0 2px 8px rgba(184,154,96,0.25) !important;
}

.button--red { background-color: var(--danger) !important; color: #f0e0e0 !important; }

.button--grey {
  background-color: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.button--grey:hover { background-color: var(--bg-hover) !important; border-color: var(--border-gold) !important; }

/* Cards / Modals */
.card {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}

.card-title {
  color: var(--accent) !important;
  font-family: "Playfair Display", serif !important;
  font-size: 1.2rem !important;
  border-bottom: 1px dotted var(--border-dot) !important;
  padding-bottom: 12px !important;
}

.card-content { color: var(--text-primary) !important; }
.card-action { border-top: 1px solid var(--border) !important; background-color: var(--bg-deep) !important; }

#modal-background, .overlay {
  background-color: rgba(15,13,11,0.8) !important;
  backdrop-filter: blur(2px) !important;
}

/* Shell */
.shell { background-color: var(--bg-deep) !important; }
.shell__content, .shell-content {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  font-family: "IBM Plex Mono", monospace !important;
}
.shell__prompt { color: var(--accent) !important; }
.shell__result { color: var(--text-secondary) !important; }

/* Dropdown */
#dropdown {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

#dropdown .action { color: var(--text-primary) !important; }
#dropdown .action:hover { background-color: var(--bg-hover) !important; color: var(--accent-hover) !important; }

/* Context menu */
.context-menu {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}

/* Editor */
#editor-container, #editor {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  font-family: "IBM Plex Mono", monospace !important;
}

/* Previewer */
#previewer { background-color: var(--bg-main) !important; }
#preview-container { background-color: var(--bg-deep) !important; }

/* Login */
#login {
  background-color: var(--bg-main) !important;
  background-image: radial-gradient(circle, rgba(184,154,96,0.04) 1px, transparent 1px) !important;
  background-size: 20px 20px !important;
}

#login .card {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-gold) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6) !important;
}

#login .card-title {
  font-family: "Playfair Display", serif !important;
  color: var(--accent) !important;
  font-size: 1.5rem !important;
  text-align: center !important;
  letter-spacing: 2px !important;
}

#login input {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  padding: 10px 14px !important;
}

#login input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(184,154,96,0.15) !important;
}

#login .button--blue {
  width: 100% !important;
  padding: 10px !important;
  font-size: 0.9rem !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
}

/* Share */
#share .card, .share__box {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
}

/* Upload */
.upload-files {
  background-color: var(--bg-surface) !important;
  border: 2px dashed var(--border-gold) !important;
  border-radius: 8px !important;
}

.upload-files:hover { border-color: var(--accent) !important; background-color: var(--bg-hover) !important; }

.file-progress { background-color: var(--bg-input) !important; }
.file-progress .bar { background-color: var(--accent) !important; border-radius: 2px !important; }

/* Dashboard */
.dashboard { background-color: var(--bg-main) !important; }
.dashboard .card { background-color: var(--bg-surface) !important; border: 1px solid var(--border) !important; }

/* Toasts */
.Vue-Toastification__toast { font-family: "IBM Plex Mono", monospace !important; border-radius: 6px !important; }
.Vue-Toastification__toast--success { background-color: #2d3a2d !important; border-left: 3px solid var(--success) !important; }
.Vue-Toastification__toast--error { background-color: #3a2d2d !important; border-left: 3px solid var(--danger) !important; }
.Vue-Toastification__toast--info { background-color: #2d333a !important; border-left: 3px solid var(--info) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* Selection */
::selection { background-color: rgba(184,154,96,0.3) !important; color: #f0e6d2 !important; }

/* Links */
a { color: var(--accent) !important; text-decoration: none !important; transition: color 0.15s !important; }
a:hover { color: var(--accent-hover) !important; }

/* Icons */
i.material-icons, .material-icons { color: var(--text-secondary) !important; transition: color 0.15s !important; }

/* Loading spinner */
#loading .spinner > div { background-color: var(--accent) !important; }

/* Multi-selection bar */
#multiple-selection {
  background-color: var(--bg-deep) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

input[type="checkbox"] { accent-color: var(--accent) !important; }

/* Credits */
.credits { color: var(--text-muted) !important; }
.credits a { color: var(--text-secondary) !important; }

/* Paper texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.012;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}
