*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Prevent scrolling on main display */
}

/* Remove list styles */
ul,
ol {
  list-style: none;
}

/* Remove default styling from links */
a {
  text-decoration: none;
  color: inherit;
}

/* Make images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Reset form elements */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

:root {
  /* Font families */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-terminal: "JetBrains Mono", "Courier New", monospace;

  /* Font sizes */
  --fs-xs: 0.75rem; /* 12px */
  --fs-sm: 0.875rem; /* 14px */
  --fs-md: 1rem; /* 16px */
  --fs-lg: 1.125rem; /* 18px */
  --fs-xl: 1.25rem; /* 20px */
  --fs-2xl: 1.5rem; /* 24px */
  --fs-3xl: 1.875rem; /* 30px */
  --fs-4xl: 2.25rem; /* 36px */

  /* Font weights */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  /* Line heights */
  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-loose: 1.8;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  font-weight: var(--fw-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Terminal text styling */
.terminal-text {
  font-family: var(--font-terminal);
  line-height: var(--lh-tight);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

h1 {
  font-size: var(--fs-4xl);
}
h2 {
  font-size: var(--fs-3xl);
}
h3 {
  font-size: var(--fs-2xl);
}
h4 {
  font-size: var(--fs-xl);
}
h5 {
  font-size: var(--fs-lg);
}
h6 {
  font-size: var(--fs-md);
}

/* ---------- Global Layout ---------- */
#boot-screen,
#login-screen,
#desktop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.5s ease-in-out;
}

#boot-screen,
#login-screen {
  display: none;
  z-index: 100;
}

#boot-screen.active,
#login-screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Waybar styling */
#waybar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  z-index: 50;
}

#waybar .left,
#waybar .center,
#waybar .right {
  display: flex;
  align-items: center;
}

#waybar .left {
  justify-content: flex-start;
}

#waybar .center {
  justify-content: center;
  flex: 1;
  position: relative; /* For positioning the tooltip */
  display: flex;
  align-items: center;
}

#waybar .right {
  justify-content: flex-end;
}

#waybar-brand-name {
  font-weight: var(--fw-bold);
  cursor: pointer;
  margin-right: 12px; /* Space between brand and Help text - increased */
  color: var(--color-fg-primary);
  transition: color 0.2s ease;
}

#waybar-brand-name:hover {
  color: var(--color-accent-blue); /* Or your preferred hover color */
}

.window-title {
  margin-right: 5px;
}

/* Keyboard shortcuts hint in waybar */
.keyboard-shortcuts-hint {
  margin-left: 15px; /* This might need adjustment or removal if it causes offset */
  position: absolute;
  cursor: help;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  display: flex; /* Ensure brand name and help text are in a row */
  align-items: center; /* Align items vertically in the middle */
}

.keyboard-shortcuts-hint span {
  font-size: var(--fs-xs);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  border-bottom: 1px dotted var(--color-accent-blue);
  padding-bottom: 2px;
}

.keyboard-shortcuts-hint:hover span {
  opacity: 1;
}

.shortcuts-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 15px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  margin-top: 10px;
  display: none;
}

.keyboard-shortcuts-hint:hover .shortcuts-tooltip {
  display: block;
}

.shortcuts-tooltip p {
  margin-bottom: 8px;
  font-size: var(--fs-xs);
  color: var(--color-fg-primary);
}

.shortcuts-tooltip kbd {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  padding: 2px 4px;
  font-family: var(--font-terminal);
  font-size: 0.7rem;
  margin: 0 2px;
}

/* Desktop container for windows */
#desktop-container {
  position: absolute;
  top: 30px; /* Below waybar was causing issues */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.space-between {
  justify-content: space-between;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* ---------- Content Sections ---------- */

.about-container {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.about-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent-blue);
}

.about-text {
  flex: 1;
  min-width: 250px;
}

/* Projects section */
.projects-container {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  background-color: var(--color-bg-elevated);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card h3 {
  color: var(--color-accent-blue);
  margin-bottom: 0.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-tags span {
  background-color: var(--color-bg-secondary);
  color: var(--color-fg-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: var(--fs-xs);
}

/* Skills section */
.skills-container {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.skills-section {
  margin-bottom: 1.5rem;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skill-bar {
  background-color: var(--color-bg-elevated);
  border-radius: 0.5rem;
  overflow: hidden;
}

.skill-name {
  padding: 0.5rem 1rem;
  font-weight: var(--fw-medium);
}

.skill-level {
  height: 6px;
  background-color: var(--color-accent-blue);
  border-radius: 0.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.skill-tags span {
  background-color: var(--color-bg-secondary);
  color: var(--color-fg-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 0.25rem;
  font-size: var(--fs-sm);
}

/* Contact section */
.contact-container {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.contact-info {
  padding: 1rem;
}

.contact-info p {
  margin-bottom: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-weight: var(--fw-medium);
}

.form-group input,
.form-group textarea {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background-color: var(--color-bg-tertiary);
  color: var(--color-fg-primary);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.contact-form button {
  padding: 0.5rem 1rem;
  background-color: var(--color-accent-blue);
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-weight: var(--fw-medium);
  margin-top: 0.5rem;
}

/* Boot screen styles */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg-boot);
  color: var(--color-fg-boot);
  font-family: var(--font-terminal);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#boot-screen.active {
  opacity: 1;
  visibility: visible;
}

#boot-screen.fade-out {
  opacity: 0;
  transition: opacity 1s ease;
}

.boot-content {
  width: 80%;
  max-width: 800px;
  margin-top: auto;
  margin-bottom: 40px;
}

.boot-logo {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}

.arch-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  color: var(--color-accent-blue);
  animation: pulsate 2s infinite ease-in-out;
}

@keyframes pulsate {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.97);
  }
}

.boot-text {
  font-size: 1.5rem;
  letter-spacing: 0.3rem;
  font-weight: bold;
  color: var(--color-accent-blue);
  margin-bottom: 40px;
}

.boot-log {
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 50vh;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 4px;
  font-family: var(--font-terminal);
}

.log-entry {
  margin-bottom: 2px;
  opacity: 0.9;
}

.log-entry:nth-child(odd) {
  opacity: 0.75;
}

/* Help overlay */
.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.help-content {
  background-color: var(--color-bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  color: var(--color-fg-primary);
}

.help-content h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--color-accent-blue);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.shortcut-group {
  margin-bottom: 1.5rem;
}

.shortcut-group h3 {
  color: var(--color-accent-green);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.shortcut {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.key {
  display: inline-block;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  font-family: var(--font-terminal);
  font-size: var(--fs-sm);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  min-width: 1.5rem;
  text-align: center;
}

.description {
  margin-left: auto;
  color: var(--color-fg-muted);
}

.help-footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--color-fg-muted);
  font-size: var(--fs-sm);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Media query for smaller screens */
@media (max-width: 767px) {
  .help-overlay {
    padding: 1rem;
  }

  .help-content {
    padding: 1rem;
  }

  .shortcuts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
