/* ============================================================
   SauraXT — Windows 7 Aero Glass Window Chrome
   ============================================================ */

/* ===== BASE WINDOW ===== */
.xt-window {
  position: absolute;
  min-width: 300px; min-height: 180px;
  display: flex; flex-direction: column;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  font-size: 12px;
  
  /* Aero Glass Borders */
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: rgba(180, 210, 240, 0.35); /* Translucent glass color */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  
  /* Thick glass padding */
  padding: 0 6px 6px 6px;
  
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.4);
  animation: windowIn 0.15s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes windowIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes windowOut {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(0.95); opacity: 0; }
}

/* Active state - Aero Glow */
.xt-window.active {
  background: rgba(130, 180, 230, 0.45);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.7), 0 0 10px rgba(255,255,255,0.2);
}

.xt-window:not(.active) {
  background: rgba(220, 220, 220, 0.3);
  box-shadow: 0 5px 20px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.3);
}

.xt-window.minimized { display: none; }

.xt-window.maximized {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important;
  height: calc(100vh - var(--taskbar-h)) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  border: none !important;
  z-index: 600 !important;
}

/* ===== AERO TITLE BAR ===== */
.win-titlebar {
  height: 32px;
  display: flex; align-items: center;
  padding: 0 4px 0 6px; gap: 6px;
  cursor: move; flex-shrink: 0;
  border-radius: 8px 8px 0 0;
  position: relative;
  background: transparent;
}

/* Titlebar icon */
.win-titlebar-icon {
  font-size: 16px; flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  z-index: 1;
}

/* Titlebar title text */
.win-titlebar-title {
  flex: 1;
  color: #000;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 5px rgba(255,255,255,0.5);
  z-index: 1;
}

.xt-window:not(.active) .win-titlebar-title {
  color: #555;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* ===== WINDOW CONTROL BUTTONS (Windows 7 Style) ===== */
.win-controls {
  display: flex; align-items: flex-start; gap: 1px;
  flex-shrink: 0; z-index: 1;
  height: 22px;
  margin-top: -8px;
  margin-right: 2px;
}

.win-btn {
  width: 28px; height: 20px;
  border: 1px solid rgba(255,255,255,0.3);
  border-top: none;
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  transition: all 100ms ease;
  position: relative;
  background: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  color: #333;
}

.xt-window:not(.active) .win-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

/* Aero Minimize */
.win-btn-minimize::after { content: '─'; font-size: 10px; font-weight: bold; position: relative; top: 2px; }
.win-btn-minimize:hover {
  background: rgba(255,255,255,0.4);
  box-shadow: inset 0 0 5px rgba(255,255,255,0.6);
}
.win-btn-minimize:active { background: rgba(200,200,200,0.5); }

/* Aero Maximize */
.win-btn-maximize::after { content: '□'; font-size: 14px; font-family: Tahoma; }
.win-btn-maximize:hover {
  background: rgba(255,255,255,0.4);
  box-shadow: inset 0 0 5px rgba(255,255,255,0.6);
}
.win-btn-maximize:active { background: rgba(200,200,200,0.5); }

/* Aero Close - Red */
.win-btn-close {
  width: 44px;
  background: rgba(200, 50, 50, 0.4);
  border-color: rgba(255,100,100,0.4);
  color: white;
}
.win-btn-close::after { content: '✕'; font-size: 12px; font-family: Tahoma; }
.win-btn-close:hover {
  background: rgba(230, 40, 40, 0.8);
  box-shadow: inset 0 0 5px rgba(255,150,150,0.8), 0 0 5px rgba(230,40,40,0.5);
}
.win-btn-close:active { background: rgba(180, 20, 20, 0.9); }

/* Hide default button content */
.win-btn { overflow: hidden; }

/* ===== WIN7 MENU BAR ===== */
.win-menubar {
  display: flex; align-items: center;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  padding: 1px 4px; height: 24px;
  flex-shrink: 0; gap: 0;
  font-family: 'Segoe UI', sans-serif; font-size: 12px;
}
.menu-item {
  padding: 2px 8px; cursor: pointer;
  border-radius: 3px; color: #000;
  transition: all 100ms;
}
.menu-item:hover { background: rgba(50, 150, 255, 0.2); border: 1px solid rgba(50, 150, 255, 0.4); padding: 1px 7px; }

/* ===== WIN7 TOOLBAR ===== */
.win-toolbar {
  display: flex; align-items: center;
  background: #f5f6f7;
  border-bottom: 1px solid #d9d9d9;
  padding: 4px; height: 38px;
  flex-shrink: 0; gap: 4px;
}
.toolbar-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 12px;
  border: 1px solid transparent; border-radius: 3px;
  background: transparent;
  font-family: 'Segoe UI', sans-serif; color: #333;
  cursor: pointer; transition: all 100ms;
}
.toolbar-btn:hover {
  background: rgba(50, 150, 255, 0.1);
  border-color: rgba(50, 150, 255, 0.3);
}
.toolbar-btn:active {
  background: rgba(50, 150, 255, 0.2);
  border-color: rgba(50, 150, 255, 0.5);
}
.toolbar-btn:disabled { opacity: 0.4; cursor: default; }
.toolbar-sep { width: 1px; height: 24px; background: #d9d9d9; margin: 0 4px; }

/* ===== ADDRESS BAR (browser) ===== */
.win-addressbar {
  display: flex; align-items: center;
  background: #f5f6f7;
  border-bottom: 1px solid #d9d9d9;
  padding: 4px 6px; height: 32px;
  flex-shrink: 0; gap: 8px; font-size: 12px;
  font-family: 'Segoe UI', sans-serif;
}
.win-addressbar label { color: #333; white-space: nowrap; font-size: 12px; }
.win-addressbar input {
  flex: 1; height: 22px;
  background: #fff;
  border: 1px solid #abadb3;
  border-radius: 2px;
  font-family: 'Segoe UI', sans-serif; font-size: 12px;
  color: #000; padding: 0 6px; outline: none;
}
.win-addressbar input:focus { border-color: #3399ff; box-shadow: 0 0 3px rgba(51,153,255,0.4); }

/* ===== WINDOW CONTENT ===== */
.win-content {
  flex: 1; overflow: auto;
  background: var(--col-card);
  position: relative;
  border: 1px solid #a0a0a0;
  border-radius: 0 0 2px 2px;
}

/* ===== STATUS BAR ===== */
.win-statusbar {
  height: 22px; border-top: 1px solid #d9d9d9;
  display: flex; align-items: center;
  padding: 0 8px; font-size: 12px;
  color: #333; flex-shrink: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f0f0f0;
}

/* ===== RESIZE HANDLE ===== */
.win-resize-handle {
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px; cursor: se-resize; z-index: 5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Cpath d='M10 12 L12 12 M12 10 L12 12 M6 12 L8 12 M12 6 L12 8 M2 12 L4 12 M12 2 L12 4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-dasharray='1 2'/%3E%3C/svg%3E") no-repeat center;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .xt-window {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: calc(100vh - var(--taskbar-h)) !important;
    border-radius: 0 !important; min-width: unset;
    padding: 0; border: none;
  }
  .win-titlebar { cursor: default; border-radius: 0; }
  .win-resize-handle { display: none; }
  .win-content { border: none; border-radius: 0; }
}
