/* ============================================
   XFCE Greybird Theme - Window Manager
   ============================================ */

/* Window container */
#windows-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 30px;
  pointer-events: none;
}

/* Individual window */
.window {
  position: absolute;
  background: #ececec;
  border: 1px solid #888;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  min-width: 200px;
  min-height: 100px;
}

/* Window: Inactive (unfocused) */
.window.inactive {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-color: #a0a0a0;
}

/* Window title bar */
.window-titlebar {
  background: linear-gradient(to bottom, #c0c0c0 0%, #a8a8a8 50%, #989898 51%, #b0b0b0 100%);
  color: #2c2c2c;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 2px 0 6px;
  border-radius: 6px 6px 0 0;
  cursor: grab;
  flex-shrink: 0;
  border-bottom: 1px solid #888;
  gap: 4px;
}

.window.inactive .window-titlebar {
  background: linear-gradient(to bottom, #d8d8d8 0%, #cccccc 50%, #c0c0c0 51%, #d0d0d0 100%);
  color: #666;
}

/* Window: Active title bar (blue accent like Greybird) */
.window:not(.inactive) .window-titlebar {
  background: linear-gradient(to bottom, #6a9fd4 0%, #4a7ab5 50%, #3a6aa5 51%, #5a8ac5 100%);
  color: #fff;
  border-bottom-color: #3a6aa5;
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-title-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.window:not(.inactive) .window-title-icon {
  filter: brightness(0) invert(1);
}

.window.inactive .window-title-icon {
  filter: brightness(0.5);
}

.window-title-text {
  flex: 1;
  font-size: 12px;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Window control buttons */
.window-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.window-btn {
  width: 20px;
  height: 20px;
  border: 1px solid #888;
  border-radius: 3px;
  background: linear-gradient(to bottom, #e0e0e0, #c8c8c8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 10px;
  line-height: 1;
}

.window:not(.inactive) .window-btn {
  border-color: #3a6aa5;
  background: linear-gradient(to bottom, #7ab0e8, #5a8ac5);
}

.window-btn:hover {
  background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
}

.window:not(.inactive) .window-btn:hover {
  background: linear-gradient(to bottom, #8fc0f0, #6a9fd4);
}

.window-btn:active {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.window-btn svg {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.window-btn.close:hover {
  background: linear-gradient(to bottom, #f08080, #d05050);
  border-color: #a03030;
}

.window-btn.close:hover svg {
  color: #fff;
}

/* Window content area */
.window-content {
  flex: 1;
  overflow: auto;
  background: #fafafa;
  position: relative;
  border-radius: 0 0 6px 6px;
}

.window-content::-webkit-scrollbar {
  width: 10px;
}

/* Window: Minimized */
.window.minimized {
  display: none;
}

/* Window: Maximized */
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 0px) !important;
  border-radius: 0;
}

.window.maximized .window-titlebar {
  border-radius: 0;
}

/* Resize handle */
.window-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 10;
}

/* Loading spinner */
.window-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: #666;
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #4a7ab5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   App-specific content styles
   ============================================ */

/* Profile app */
.profile-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  border: 2px solid #ddd;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-size: 18px;
  font-weight: bold;
  color: #1a3a5c;
}

.profile-login {
  font-size: 14px;
  color: #666;
}

.profile-bio {
  font-size: 13px;
  color: #444;
  font-style: italic;
}

.profile-stats {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  width: 100%;
  justify-content: space-around;
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #2d5a8c;
}

.profile-stat .stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
}

.profile-link {
  font-size: 13px;
  color: #4a7ab5;
  text-decoration: none;
  word-break: break-all;
}

.profile-link:hover {
  text-decoration: underline;
}

.profile-meta {
  width: 100%;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

/* Repos app (Thunar-style) */
.repos-content {
  padding: 8px;
}

.repos-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-bottom: 8px;
  font-size: 12px;
}

.repos-toolbar .toolbar-path {
  color: #666;
  flex: 1;
}

.repos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
}

.repo-item {
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.repo-item:hover {
  background: rgba(74, 122, 181, 0.1);
}

.repo-item.selected {
  background: rgba(100, 160, 220, 0.25);
}

.repo-item .repo-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.repo-item .repo-name {
  font-size: 12px;
  color: #2c2c2c;
  word-wrap: break-word;
  line-height: 1.2;
  max-width: 96px;
}

.repo-detail {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repo-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.repo-detail-header .repo-detail-icon {
  width: 40px;
  height: 40px;
}

.repo-detail-name {
  font-size: 16px;
  font-weight: bold;
  color: #1a3a5c;
}

.repo-detail-desc {
  font-size: 13px;
  color: #444;
}

.repo-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #666;
  flex-wrap: wrap;
}

.repo-lang-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
  background: #eee;
}

.repo-lang-segment {
  height: 100%;
}

.repo-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
}

.lang-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.repo-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #4a7ab5;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
}

.repo-back-btn:hover {
  background: rgba(74, 122, 181, 0.1);
}

/* Terminal app */
.terminal-content {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: "Ubuntu Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  padding: 12px;
  height: 100%;
  overflow: auto;
  line-height: 1.5;
}

.terminal-line {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-prompt {
  color: #89b4fa;
}

.terminal-accent {
  color: #f9e2af;
}

.terminal-green {
  color: #a6e3a1;
}

.terminal-dim {
  color: #6c7086;
}

.terminal-input-line {
  display: flex;
  align-items: baseline;
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  color: #cdd6f4;
  font-family: inherit;
  font-size: inherit;
  flex: 1;
  padding: 0;
  margin-left: 0.35em;
  caret-color: #cdd6f4;
  caret-shape: block;
}

.terminal-input:focus-visible {
  outline: none;
}

/* Activity app */
.activity-content {
  padding: 12px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 12px;
}

.activity-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-text {
  flex: 1;
  color: #444;
}

.activity-text .activity-repo {
  color: #4a7ab5;
  font-weight: bold;
}

.activity-text .activity-type {
  color: #888;
}

.activity-time {
  color: #aaa;
  font-size: 11px;
}

/* SVG icons in content */
svg.icon-svg {
  display: inline-block;
  vertical-align: middle;
}
