/* styles.css — Enhanced Windows 10 nostalgic look */
:root {
  --bg1: #0b1220;
  --glass: rgba(255, 255, 255, 0.04);
  --accent: #0078d7;
  --text: #e6eef8;
  --muted: rgba(230, 238, 248, 0.6);
  --transition-speed: 0.2s;
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue",
    Arial;
}
/* Ensure full-height layout so absolutely positioned footer (taskbar) sits at viewport bottom */
html, body, #desktop { height: 100%; margin: 0; }
body {
  /* Wallpaper image layered over the original radial gradient background
     so we only add the image and keep existing visual styling. */
  background-image: url('/assets/wallpaper.png'), radial-gradient(circle at 10% 20%, #0f1b2a 0%, #071029 55%, #02050a 100%);
  background-size: cover, auto;
  background-position: center, 10% 20%;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, scroll;
  background-color: var(--bg1);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Desktop area */
#desktop {
  position: relative;
  padding: 18px 18px 80px 140px;
  height: 100%;
}

/* Left vertical icons bar */
#icons {
  position: absolute;
  left: 18px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 92px;
  align-items: center;
}
.icon {
  width: 92px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}
.icon:hover {
  transform: scale(1.05);
}
.icon:active {
  transform: scale(0.98);
}
.icon img {
  width: 72px;
  height: 72px;
  background: var(--glass);
  padding: 10px;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}
.icon:hover img {
  box-shadow: 0 12px 28px rgba(0, 120, 215, 0.3);
}
.icon span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.icon:focus {
  outline: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.icon.selected {
  background: rgba(0, 120, 215, 0.2);
  border-radius: 8px;
  padding: 4px;
}

/* Taskbar */
#taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45),
    rgba(5, 9, 12, 0.85)
  );
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
#start-btn {
  width: 48px;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(180deg, #0b5ea6, #0078d7);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
#start-btn:hover {
  background: linear-gradient(180deg, #0c66b3, #0086f0);
  transform: scale(1.05);
}
#start-btn:active {
  transform: scale(0.95);
}
#start-btn img {
  width: 20px;
  height: 20px;
  filter: brightness(1.2);
}

/* Search box in taskbar */
#search-box {
  flex: 0 0 320px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  cursor: text;
  transition: all 0.2s ease;
}
#search-box:hover {
  background: rgba(255, 255, 255, 0.08);
}
#search-box:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}
#search-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}
#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
#search-input::placeholder {
  color: var(--muted);
}

#task-center {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.task-item {
  height: 44px;
  min-width: 180px;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.task-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.task-item.active {
  background: rgba(0, 120, 215, 0.2);
  border-bottom: 2px solid var(--accent);
}
.task-item img {
  width: 20px;
  height: 20px;
}
.task-item span {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* System tray */
#tray {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.tray-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tray-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}
.tray-icon img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
#datetime {
  text-align: right;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
#datetime:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Start menu */
#start-menu {
  position: absolute;
  left: 12px;
  bottom: 68px;
  width: 800px;
  height: 600px;
  background: linear-gradient(
    180deg,
    rgba(10, 15, 25, 0.98),
    rgba(5, 10, 18, 0.99)
  );
  backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom left;
  overflow: hidden;
  z-index: 1000;
}

#start-menu.hidden {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  pointer-events: none;
}

.start-header {
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile {
  display: flex;
  gap: 16px;
  align-items: center;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.avatar:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.profile-text .name {
  font-weight: 600;
  font-size: 16px;
}

.profile-text .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.start-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.menu-left {
  flex: 0 0 65%;
  padding: 24px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-right {
  flex: 0 0 35%;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
}

.menu-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.menu-apps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-app {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.menu-app:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.menu-app img {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

.menu-app:hover img {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.1);
}

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

.app-name {
  font-weight: 500;
  font-size: 14px;
}

.app-desc {
  font-size: 12px;
  color: var(--muted);
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 13px;
}

.quick-link:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.quick-link-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.start-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.power-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.power-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.power-icon {
  font-size: 18px;
  opacity: 0.7;
}

.power-text {
  font-size: 13px;
}
.footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
.footer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.footer-btn img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Windows (app windows) - PERFORMANCE OPTIMIZED */
#windows {
  position: absolute;
  left: 120px;
  top: 80px;
  right: 40px;
  bottom: 80px;
  pointer-events: none;
}
.app {
  width: 560px;
  height: 420px;
  background: linear-gradient(
    180deg,
    rgba(15, 20, 30, 0.98),
    rgba(10, 15, 22, 0.98)
  );
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(2, 6, 12, 0.8);
  position: absolute;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: center;
  /* CRITICAL FOR SMOOTH DRAGGING */
  will-change: transform;
}
.app.dragging {
  transition: none !important;
  cursor: move !important;
}
.app.opening {
  transform: scale(0.95);
  opacity: 0;
}
.app.closing {
  transform: scale(0.95);
  opacity: 0;
}
.app.fullscreen {
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  border-radius: 0;
}

.titlebar {
  height: 44px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}
.titlebar .title {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.titlebar .title img {
  width: 18px;
  height: 18px;
}
.titlebar .controls {
  display: flex;
  gap: 2px;
}
.titlebar .controls button {
  width: 46px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.titlebar .controls button:hover {
  background: rgba(255, 255, 255, 0.06);
}
.titlebar .controls .close:hover {
  background: #e81123;
  color: white;
}

.content {
  padding: 20px;
  overflow: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.content::-webkit-scrollbar {
  width: 8px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Content elements */
.avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  float: left;
  margin-right: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}
h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
}
h3 {
  margin: 20px 0 12px 0;
  font-size: 16px;
  color: var(--accent);
}
h4 {
  margin: 12px 0 8px 0;
  font-size: 14px;
}
p {
  line-height: 1.6;
  margin: 8px 0;
  /* Use theme-aware text color so paragraphs switch correctly between dark/light themes */
  color: var(--text);
}

/* Ensure common content elements inside app windows follow the theme text color
   but allow more specific selectors (e.g. .project p, .project h4) to override. */
.app .content h1,
.app .content h2,
.app .content h3,
.app .content h4,
.app .content h5,
.app .content h6,
.app .content p,
.app .content label,
.app .content li,
.app .content a,
.app .content .skills,
.app .content .skill {
  color: var(--text);
}

.skills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.skill {
  background: rgba(0, 120, 215, 0.15);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid rgba(0, 120, 215, 0.3);
}

.project-filters {
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(0, 120, 215, 0.1);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.project {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}

.project-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-content {
  padding: 20px;
}

.project h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--text);
}

.project p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.project-tech {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tech-tag {
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 120, 215, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-link {
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}

.project-link:hover {
  background: #0086f0;
  transform: translateY(-1px);
}

[data-theme="light"] .project {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .project-image {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.project.hidden {
  display: none;
}

/* Form elements */
form label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}
form input,
form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}
form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}
form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn:hover {
  background: #0086f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.4);
}
.btn:active {
  transform: translateY(0);
}

/* Notification area */
.notification-center {
  position: absolute;
  right: 12px;
  bottom: 68px;
  width: 380px;
  max-height: 600px;
  background: linear-gradient(
    180deg,
    rgba(10, 15, 25, 0.95),
    rgba(5, 10, 18, 0.98)
  );
  backdrop-filter: blur(20px);
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  display: none;
}
.notification-center.show {
  display: block;
}
.notification-header {
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notification {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
}

/* Responsive */
@media (max-width: 880px) {
  #desktop {
    padding: 12px 12px 96px 12px;
  }
  .app {
    width: 90%;
    height: 70%;
  }
  #windows {
    left: 10px;
    right: 10px;
    top: 60px;
    bottom: 90px;
  }
  #start-menu {
    width: 100%;
    left: 0;
    right: 0;
    bottom: 68px;
    height: 70vh;
  }
  #search-box {
    flex: 0 0 200px;
  }
  .pinned-apps {
    grid-template-columns: repeat(4, 1fr);
  }
}
.hidden {
  display: none !important;
}
