:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: transparent;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

#root {
  height: 100%;
  width: 100%;
}

/* ==================================
   APP LAUNCHER - CSS STYLES
   ================================== */

/* ========== GLOBAL STYLES ========== */
.app-launcher-container .hidden {
  display: none;
  isolation: isolate;
}

.app-launcher-container * {
  -webkit-tap-highlight-color: transparent;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== MAIN CONTAINER ========== */
.app-launcher-container {
  height: fit-content;
  width: fit-content;
  margin-left: auto;
  position: relative;
  overflow: visible;
  isolation: isolate;
  z-index: 999;
}

.app-launcher-container:focus-within > .app-launcher-frame,
.app-launcher-frame.open {
  pointer-events: all !important;
  opacity: 1;
}

.app-launcher-container:focus-within > .app-launcher-icon {
  background-color: #2d2d2d;
  pointer-events: none;
}

/* ========== LAUNCHER ICON ========== */
.app-launcher-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  padding: 3px;
  background-color: #2d2d2d;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: .3s background-color;
}

.app-launcher-icon:hover, .app-launcher-container:focus-within > .app-launcher-icon {
  background-color: #0072d5;
}

/* ========== PROFILE PICTURE ========== */
.app-launcher-icon > img {
  width: 45px;
  height: 45px;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgb(28, 28, 28);
  background-color: #2d2d2d;
}

/* ========== MAIN FRAME/DROPDOWN ========== */
.app-launcher-frame {
  position: absolute;
  right: -11px;
  bottom: -5px;
  transform: translateY(100%);
  pointer-events: none;
  opacity: 0;
  transition: .3s all;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: fit-content;
  max-height: 400px;
  width: clamp(250px, 500px, 700px);
  max-width: 100vw;
  overflow-y: auto;
  border: 1px solid rgb(75, 75, 75);
  background-color: #121212;
  border-radius: 10px;
  padding: 10px;
}

.app-launcher-section {
  padding: 7px;
  width: 100%;
  height: auto;
  min-height: auto;
  background-color: rgb(20, 20, 20);
}

/* ========== USER AUTHENTICATION SECTION ========== */
/* Login/Register Section */
.app-launcher-login {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.app-launcher-login button {
  background-color: var(--color, unset);
  border-radius: 5px;
  cursor: pointer;
  border: none;
  font-size: large;
  font-weight: 400;
  padding: 10px 15px;
  transition: .3s all;
}

.app-launcher-login button:hover {
  filter: brightness(1.3);
}

/* Logged in User Section */
.app-launcher-user {
  display: grid;
  grid-template-columns: 60px auto;
  column-gap: 15px;
}

.app-launcher-user img { 
  grid-area: 2 span; 
  width: 100%;
  height: auto;
  border-radius: 7px;
}

.app-launcher-user p {
  margin: 0px;
  color: white; 
  font-weight: 500; 
  letter-spacing: .3px; 
  width: 100%;
  height: 100%;
  text-align: left;
  word-wrap: break-word;
  font-size: medium;
}

/* User Action Buttons */
.app-launcher-user-actions {
  display: flex;
  gap: 7px;
}

.app-launcher-user-actions > button {
  font-size: 14px;
  height: 100%;
  text-align: center;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: white;
  font-weight: 400;
  background-color: var(--color, #2d2d2d);
  transition: .3s all;
}
.app-launcher-user-actions > button:hover {
  filter: saturate(1.3);
}

/* ========== SEARCH SECTION ========== */
.app-launcher-search {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: span 4;
}

.app-launcher-search svg {
  fill: #e8eaed;
}

.app-launcher-search-input {
  background-color: #222222;
  border: none;
  border-radius: 5px;
  padding: 5px 7px;
  color: white;
  font-size: 16px;
  width: 100%;
}

.app-launcher-search-input:focus {
  outline: none;
}

.app-launcher-search-input::placeholder {
  color: #a4a4a4;
}

/* ========== APPS SECTION ========== */
.app-launcher-section.apps-location {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, 100px);
}

.app-launcher-app {
  transition: .3s all;
  background-color: #222222;
  border: none;
  border-radius: 10px;
  padding: 10px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.app-launcher-app:hover {
  background-color: #2b2b2b;
}

.app-launcher-app:active {
  background-color: #303030;
}

.app-launcher-app svg {
  margin-bottom: 5px;
  width: 30px;
  height: 30px;
}

.app-launcher-app p {
  margin: 0;
  color: white;
  font-weight: 500;
  letter-spacing: .3px;
  text-align: center;
}

/* ========== LOADING STATE ========== */
.app-launcher-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #e8eaed;
  font-size: 14px;
}

/* ========== RESPONSIVE DESIGN ========== */
@media screen and (max-width: 600px) {
  .app-launcher-app > p {
    font-size: 12px;
  }
  
  .app-launcher-frame {
    width: clamp(200px, 90vw, 400px);
    right: -5px;
  }
  
  .app-launcher-section.apps-location {
    grid-template-columns: repeat(auto-fit, 80px);
    gap: 8px;
  }
  
  .app-launcher-user {
    grid-template-columns: 50px auto;
  }
  
  .user-action-button {
    font-size: 12px;
    padding: 4px 8px;
  }
}
