/* core.css - 0Fluff Pocket Shell */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Kills the ugly blue tap flash on mobile */
}

body {
  margin: 0;
  font-family: var(--font-main, system-ui, -apple-system, sans-serif);
  background-color: var(--bg);
  color: var(--text);
  overflow: hidden; /* Prevents the whole website from bouncing when you scroll */
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: env(safe-area-inset-top, 40px);
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 20px));
}

/* --- 1. AT-A-GLANCE (The Anchor) --- */
.at-a-glance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 12vh; /* Pushes it down into the upper-middle */
  margin-bottom: auto; /* Pushes the link ribbon to the bottom */
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Keeps text readable on bright wallpapers */
}

.clock {
  font-size: 4.5rem;
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 8px;
}

.greeting {
  font-size: 1.2rem;
  color: var(--dim);
  font-weight: 500;
}

/* --- 2. BOTTOM DOCK (The Command Center) --- */
.bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(80px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* Glassmorphism! */
  background: rgba(20, 20, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px 32px 0 0;

  display: flex;
  justify-content: space-evenly;
  align-items: center;
  z-index: 9999;
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--dim);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: color 0.2s;
}

.dock-btn.hidden {
  display: none !important;
}

/* The Search Button */
.active-fab {
  background: rgba(
    255,
    255,
    255,
    0.08
  ); /* Subtle highlight instead of a solid color */
  color: var(--text);
  width: 50px;
  height: 50px;
  border-radius: 16px; /* Gentle squarcle */
  transform: translateY(0); /* Locked firmly in the dock */
  box-shadow: none; /* Removed the floating shadow */
  transition: all 0.2s ease;
}

.active-fab:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.95);
}

/* --- 3. SEARCH POPUP --- */
.search-popup {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  left: 5%;
  width: 90%;
  z-index: 9998;
  transform: translateY(0);
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.search-popup.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 99px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  padding: 0 12px;
  outline: none;
}

.search-icon,
.engine-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
}
/* --- FIX 1: Z-INDEX OVERRIDE FOR SETTINGS --- */
/* Forces the settings menu to appear above the bottom dock */
.modal {
  z-index: 10000 !important; 
}

/* --- FIX 2: SEARCH ENGINE STYLING --- */
.engine-switcher {
  position: relative;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  padding-right: 12px;
  margin-right: 8px;
}

.engine-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-hover);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Make the dropdown menu pop UP instead of down, since we are at the bottom of the screen! */
.engine-dropdown {
  position: absolute;
  bottom: 140%; 
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  z-index: 10001;
  width: 150px;
  display: flex;
  flex-direction: column;
}

.engine-dropdown.hidden {
  display: none;
}

.engine-option {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-main);
}

.engine-option:active {
  background: var(--card-hover);
}
