/* Base */
body {
  margin: 0;
  padding: 0;
  background-color: #282828;
  color: #ebdbb2;
  height: 100vh;
  overflow: hidden;
  font-family: 'Fira Mono', monospace;
  font-size: 1rem;
}

main {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: calc(100vh - 30px);
  gap: 0;
  box-sizing: border-box;
}

.directory-tree {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  font-size: .95rem;
  background-color: #1d2021;
  border: 1px solid #928374;
  padding: 0.5rem;
  overflow: hidden;
}
.tree-header { background-color: #1d2021; color: #b6a98a; margin-bottom: 0.5rem; }
.directory-tree ul { list-style: none; padding: 0; margin: 0; }
.directory-tree li { margin: 0.2rem 0; }

.tree-toggle-header { display: flex; align-items: center; cursor: pointer; user-select: none; }
.folder-icon { width: 16px; height: 16px; margin-right: 0.3rem; }
.toggle-indicator { margin-right: 0.3rem; width: 1ch; color: #928374; }
.toggle-text { flex-grow: 1; }

.subtree { padding-left: 2rem; display: none; }
.tree-toggle:not(.collapsed) .subtree { display: block; }
.tree-toggle:not(.collapsed) .toggle-indicator { content: '▼'; }

.directory-tree a { color: #8ec07c; text-decoration: none; display: inline-block; }
.directory-tree a:hover { color: #d65d0e; }

.directory-tree a::before {
  content: '';
  background-image: url('https://raw.githubusercontent.com/allanpaiz/portfolio_content/refs/heads/main/portfolio/icons/home.png');
  background-size: contain;
  width: 16px; height: 16px; display: inline-block; vertical-align: middle; margin-right: 0.3rem;
}
.directory-tree .subtree li { padding-left: 1.1rem; }

.directory-tree a.active-page-link {
  background-color: #343a3b; color: #ebdbb2;
  border-radius: 1px; padding: 2px 0.5rem; display: block;
  width: calc(100% - 1rem); margin-left: -0.5rem; margin-right: -0.5rem;
}
.directory-tree a.custom-icon::before { display: none !important; }
.tree-note { color: #928374; font-size: 0.9rem; font-style: italic; }

.window {
  background-color: #282828;
  border: 1px solid #928374;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.window-header {
  background-color: #3c3836; padding: 0.5rem;
  border-bottom: 1px solid #928374; color: #ebdbb2;
  flex-shrink: 0; text-align: right;
  display: flex; align-items: center; justify-content: flex-end;
}
.close-separator {
  display: inline-block; width: 2px; height: 250%; background: #928374;
  margin: -1rem 0.2rem -1rem 0.7rem; align-self: stretch;
}
.close-btn {
  background: none; border: none; color: #fabd2f; font-size: 1.5rem; cursor: pointer;
  margin: -0.2rem -0.2rem 0 0; padding: 0 0.3rem; line-height: 1; transition: color 0.1s;
}
.close-btn:hover { color: #ad831f; }

.window-content {
  padding: 0.5rem; flex-grow: 1; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start;
  background-color: #1d2021;
}

.about-pane    { grid-column: 2 / 3; grid-row: 1 / 2; }
.selected-work { grid-column: 2 / 3; grid-row: 2 / 3; }
.picture-links { grid-column: 3 / 4; grid-row: 1 / 3; }
.full-pane     { grid-column: 2 / 4; grid-row: 1 / 3; }

.pane-hidden      { display: none !important; }
.pane-left-half   { grid-column: 2 / 3 !important; grid-row: 1 / 3 !important; }
.pane-top-half    { grid-column: 2 / 3 !important; grid-row: 1 / 2 !important; }
.pane-bottom-half { grid-column: 2 / 3 !important; grid-row: 2 / 3 !important; }
.pane-full        { grid-column: 2 / 4 !important; grid-row: 1 / 3 !important; width: 100% !important; }

.editor { display: flex; width: 100%; flex-grow: 1; overflow: hidden; }
.line-numbers { 
  text-align: right; 
  padding-right: 1rem; 
  color: #928374; 
  user-select: none; 
  white-space: pre; 
  line-height: 1.2; 
  font-size: 1rem; 
  flex-shrink: 0; 
}
pre { 
  margin: 0; 
  white-space: pre-wrap; 
  word-break: break-all; 
  line-height: 1.2; 
  font-size: 1rem; 
  flex-grow: 1; 
}
pre a { color: #8ec07c; text-decoration: underline; }
pre a:hover { color: #d65d0e; }

.profile-image {
  max-width: 80%; max-height: 50%;
  margin: 1rem auto 0.5rem; border-radius: 4px; object-fit: contain; display: block;
}
.profile-caption { display: block; width: 100%; text-align: center; margin: 0.1rem 0 1rem 0; font-size: .75rem; color: #bdae93; font-style: italic; }

.project-header { text-align: center; margin: 0 0 0.5rem 0; font-size: 1.7rem; font-weight: bold; color: #fabd2f; margin-top: 1rem; margin-left: 1.3rem; }
.about-header   { text-align: center; margin: 0 0 0.5rem 0; font-size: 1.7rem; font-weight: bold; color: #fabd2f; }

.status-bar {
  background-color: #3c3836; padding: 0; display: flex; justify-content: flex-start; align-items: center;
  border-top: 1px solid #928374; position: fixed; bottom: 0; left: 0; width: 100%;
  height: 30px; box-sizing: border-box; font-size: 0.9rem;
}
.mode {
  background-color: #fabd2f; color: #282828; padding: 0; position: relative;
  left: 0; top: 0; bottom: 0; height: 100%; display: flex; align-items: center;
  z-index: 1; min-width: 70px; justify-content: center; font-weight: bold;
}
.mode::after {
  content: ''; display: inline-block; position: absolute; right: -0.65rem; top: 50%;
  transform: translateY(-50%); width: 0; height: 0;
  border-top: 15px solid transparent; border-bottom: 15px solid transparent; border-left: 0.7rem solid #fabd2f;
}
.git-branch {
  background-color: #282d2e; color: #8ec07c; position: relative; display: flex; align-items: center;
  height: 100%; min-width: 10px; font-family: 'Fira Mono', monospace; font-size: 0.95rem;
  padding: 0 1.2rem 0 0.7rem; margin-left: -0.1rem; z-index: 0;
}
.git-branch .git-icon { width: 1.1rem; height: 1.1rem; margin-left: 0.4rem; margin-right: 0.8rem; vertical-align: middle; border-radius: 2px; }
.branch-name { color: #fabd2f; font-weight: bold; }
.git-branch::after {
  content: ''; display: inline-block; position: absolute; right: -0.65rem; top: 50%;
  transform: translateY(-50%); width: 0; height: 0;
  border-top: 15px solid transparent; border-bottom: 15px solid transparent; border-left: 0.7rem solid #282d2e;
}
.file-path { flex-grow: 1; margin-left: 1.5rem; align-self: center; display: flex; align-items: center; height: 100%; }
.file-icon { width: 1rem; height: 1rem; vertical-align: middle; margin-right: 0.4rem; }

.carousel-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0; margin: 0; min-height: 400px; }
.carousel-flex {
  display: flex; flex-direction: row; align-items: stretch; width: 100%; height: 100%;
  min-height: 400px; box-sizing: border-box; background: #181818; border-radius: 8px; box-shadow: 0 4px 24px #111a; overflow: visible;
}
.carousel-description {
  flex: 1 1 0; min-width: 0; max-width: 33.33%; width: 33.33%; text-align: left; padding: 1rem 1.5rem; color: #bdae93; font-size: 1rem;
  display: flex; flex-direction: column; justify-content: center; height: 100%;
  box-sizing: border-box; overflow-y: visible; background: none; border-right: 1.5px solid #92837444; position: relative;
}
.carousel-desc-text { color: #ebdbb2; display: none; min-height: 1rem; overflow: auto; text-overflow: ellipsis; white-space: pre-line; font-size: .95rem; line-height: 1.25; }
.carousel-slides {
  position: relative; flex: 2 1 0; min-width: 0; max-width: 66.67%; width: 66.67%; height: 100%;
  min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  background: #222; border-radius: 0 8px 8px 0; box-sizing: border-box; padding: 0;
}
.carousel-container img.mySlides {
  width: 100%; height: 100%; border-radius: 4px; margin: 0; display: none; background: #222;
  box-shadow: 0 2px 8px #111a; object-fit: contain; padding: 1.2rem; box-sizing: border-box;
  position: absolute; top: 0; left: 0;
}
.carousel-container img.mySlides[style*="display:block"] { display: block; }

.carousel-arrows {
  position: absolute; top: 95%; left: 16.67%; transform: translate(-50%, -50%);
  display: flex; flex-direction: row; gap: 0.7rem; z-index: 2; align-items: center; justify-content: center; min-width: 80px;
}
.carousel-prev, .carousel-next {
  cursor: pointer; width: auto; padding: 0.05rem 0.05rem 0.05rem 0.05rem; color: #fabd2f86; font-weight: bold; font-size: 2rem;
  border-radius: 2px; user-select: none; background: rgba(73, 73, 73, 0.5);
  transition: background 0.2s, color 0.2s; z-index: 2; position: static; min-width: 2.5rem; min-height: 1.5rem; text-align: center;
  display: flex; align-items: center; justify-content: center;
}
.carousel-prev:hover, .carousel-next:hover { background: #fabd2f; color: #928374a2; }

.carousel-dots {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 0.7rem; min-height: 10px; width: auto;
  position: absolute; left: 31.5%; top: 50%; transform: translateY(-50%); background: none; padding-left: 0.5rem; z-index: 3;
}
.carousel-slides .carousel-dots { position: static; margin-top: 1.2rem; margin-bottom: 0.5rem; }
.carousel-dot {
  height: 14px; width: 14px; background-color: #928374a2; border-radius: 15%; display: inline-block; transition: background 0.2s; cursor: pointer; border: 1px solid #282828;
}
.carousel-dot.active { background-color: #fabd2f; border: 1px solid #fabd2f; }

.inverse-link { color: #8ec07c; text-decoration: none; }
.inverse-link:hover, .inverse-link:focus { color: #e96813; background: #ffffff; padding: 3px; outline: none; }
.hl-code { color: #c7a464; background: #282828; padding: 2px 6px; border-radius: 4px; }
.hl-update { color: #c7a464; background: #282828; margin: 0 auto; padding: 2px 6px; border-radius: 4px; text-align: center; display: block; }
.hl-note, .hl-note-em, .hl-note-b { color: #c7a464; }
.hl-note-em { font-style: italic; }
.hl-note-b { font-weight: bold; }
.carousel-header { color: #7eaf6d; font-size: 1.5rem; font-weight: bold; margin-bottom: -0.1rem; }

.full-pane.has-carousel { grid-column: 2 / 4 !important; grid-row: 1 / 3 !important; width: 100% !important; display: flex !important; flex-direction: column !important; height: 100% !important; overflow: hidden !important; }
.full-pane.has-carousel .window-content { display: flex !important; flex-direction: column !important; height: 100% !important; overflow: hidden !important; padding: 0.5rem !important; }
.full-pane.has-carousel .carousel-container { height: 75% !important; min-height: 350px !important; max-height: 75% !important; flex-shrink: 0 !important; margin-bottom: 0.5rem !important; }
.full-pane.has-carousel .editor { height: 25% !important; min-height: 150px !important; max-height: 25% !important; flex-shrink: 0 !important; overflow: auto !important; }
.full-pane.has-carousel .project-header { margin: 0.5rem 0 0.5rem 1.3rem !important; font-size: 1.5rem !important; flex-shrink: 0 !important; }
