/* ================================
   ZefirkaOS - Desktop Environment
   ================================ */

/* --- Background --- */
body {
  margin: 0;
  height: 100vh;
  background: url("images/vistaBlack.jpg") no-repeat center center fixed;
  background-size: cover;
  overflow: hidden;
  font-family: "Segoe UI", "Tahoma", sans-serif;
}

/* --- Desktop Area --- */
#desktop {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* --- Icons --- */
.icon {
  position: absolute;
  text-align: center;
  cursor: pointer;
  user-select: none;
  color: #fff;
  width: 80px;
}

.icon img {
  width: 64px;
  height: 64px;
}

.icon p {
  margin-top: 4px;
  font-size: 14px;
  text-shadow: 0 1px 2px #000;
}

/* 💡 Optional glow when clicking/holding an icon */
.icon:active {
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
  transition: filter 0.2s ease;
}

/* --- Windows --- */
.window {
  position: absolute;
  backdrop-filter: blur(18px) saturate(160%);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.4),
              inset 0 0 12px rgba(255, 255, 255, 0.15);
  color: #f0f0f0;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 5;
}

.window.show {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.window.hidden {
  display: none;
}

/* --- Title Bar --- */
.title-bar {
  background: linear-gradient(to bottom, #2b6cc0, #184890);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  cursor: move;
  user-select: none;
}

/* --- Window Buttons --- */
.title-bar-buttons {
  display: flex;
  gap: 5px;
}

.btn {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(to bottom, #f0f0f0, #b0b0b0);
  border: 1px solid #777;
  color: #222;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}

.btn:hover {
  background: linear-gradient(to bottom, #ffffff, #999);
}

/* --- Content --- */
.content {
  padding: 0;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* --- Browser Toolbar (Old IE Look) --- */
.browser-toolbar {
  background: transparent !important;
  border: none !important;
}

.browser-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.ie-btn {
  background: linear-gradient(to bottom, #f5f5f5, #c0c0c0);
  border: 1px solid #7a7a7a;
  border-radius: 3px;
  width: 28px;
  height: 24px;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.ie-btn:hover {
  background: linear-gradient(to bottom, #ffffff, #aaaaaa);
}

.address-bar {
  flex: 1;
  height: 22px;
  border: 1px solid #7a7a7a;
  border-radius: 4px;
  background-color: #fff;
  padding: 0 8px;
  font-size: 13px;
  color: #333;
  font-family: "Tahoma", sans-serif;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.15);
}

/* --- Browser Frame --- */
.browser-frame {
  border: none;
  width: 100%;
  height: calc(100% - 36px);
  background: #fff;
}

/* --- Refresh spin animation (optional) --- */
.ie-btn.spin {
  animation: spin 0.6s linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* --- Fix desktop container --- */
#desktop {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none; /* allow clicks to pass through */
}

/* Icons inside desktop should still respond to mouse */
#desktop .icon {
  pointer-events: auto;
}
.icon img {
  width: 64px !important;
  height: 64px !important;
  display: block;
  margin: 0 auto;
}

.icon {
  width: 80px !important;
}
/* === Fix window default size + position === */
.window {
  position: absolute;
  top: 100px;           /* opens away from top edge */
  left: 200px;          /* opens toward centre */
  width: 800px;         /* readable width */
  height: 600px;        /* default window height */
  min-width: 400px;
  min-height: 300px;
  z-index: 10;          /* stays above icons */
  display: none;        /* hidden until opened */
}

/* When .show is added via JS */
.window.show {
  display: block !important;
  opacity: 1;
  transform: scale(1);
}

/* === Window content fill fix === */
.window .content {
  display: flex;
  flex-direction: column;
  height: calc(100% - 36px); /* subtract title bar height */
  overflow: hidden;
}

/* make iframe/browser fill space perfectly */
.browser-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
}
