:root {
  --icon-gradient-start: #C71585;
  --icon-gradient-end: #FF1493;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
  --text-dark: #2d3436;
  --text-light: #636e72;
  --font-main: 'Outfit', sans-serif;
  
  /* UPDATED: Apple-style spring for the release animation */
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-main);
  margin: 0;
  height: 100vh;
  overflow: hidden; 
  background: #fff0f5;
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Background Mesh --- */
.background-mesh {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  background: transparent;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 10%, black 30%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 10%, black 30%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45; will-change: transform; }
.blob-1 { top: -10%; left: -10%; width: 80vw; height: 80vw; background: #ffc3a0; animation: float-1 37s infinite ease-in-out alternate; animation-delay: -5s; }
.blob-2 { bottom: -10%; right: -10%; width: 80vw; height: 80vw; background: #ffafbd; animation: float-2 41s infinite ease-in-out alternate; animation-delay: -12s; }
.blob-3 { top: 40%; left: 10%; width: 60vw; height: 60vw; background: #e0c3fc; opacity: 0.3; animation: float-3 29s infinite ease-in-out alternate; animation-delay: -8s; }

@keyframes float-1 { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(10vw, 15vh) scale(1.1); } 100% { transform: translate(-5vw, 5vh) scale(0.95); } }
@keyframes float-2 { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-15vw, -10vh) scale(1.1); } 100% { transform: translate(5vw, -20vh) scale(0.9); } }
@keyframes float-3 { 0% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(30vw, -10vh) rotate(20deg); } 100% { transform: translate(10vw, 20vh) rotate(-10deg); } }

/* --- App Container --- */
.app-container {
  width: 100%;
  max-width: 450px;
  height: 100%;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 25px;
}

/* --- Header --- */
header { margin-bottom: 10px; padding-top: 30px; z-index: 10; opacity: 0; }
.header-content { display: flex; flex-direction: column; width: 100%; }
.header-text h1 {
  font-size: 2.2rem; margin: 4px 0 0 0; font-weight: 800;
  background: -webkit-linear-gradient(45deg, #2d3436, #C71585);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px;
}
.greeting { font-size: 0.9rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }

/* --- Main Grid Wrapper --- */
.grid-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  padding-top: 20px;
  z-index: 2;
  gap: 30px; 
}

.icon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Buttons (UPDATED ANIMATIONS) --- */
.icon-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 28px;
  padding: 30px 20px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
  box-shadow: 0 10px 30px rgba(255, 182, 193, 0.25);
  
  /* Initial State */
  opacity: 0; 
  transform: scale(1);
  
  /* 
     The Release Transition:
     Slower (0.5s) with a bouncy bezier curve to feel like a physical button returning 
  */
  transition: transform 0.5s var(--ease-elastic), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.icon-wrapper {
  display: flex; justify-content: center; align-items: center; font-size: 3.8rem; 
  color: var(--icon-gradient-end); 
  filter: drop-shadow(0 6px 8px rgba(199, 21, 133, 0.2));
  transition: transform 0.3s ease;
}

.icon-wrapper i {
  background: -webkit-linear-gradient(135deg, var(--icon-gradient-start), var(--icon-gradient-end));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; --secondary-opacity: 0.3;
}
.label { font-size: 1.05rem; font-weight: 600; color: #555; }

/* Hover State */
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.8); 
  transform: translateY(-4px); /* Slight float on desktop hover */
  box-shadow: 0 15px 35px rgba(255, 20, 147, 0.2); border-color: #fff;
}

/* 
   Active / Click State 
   Overrides hover. 
*/
.icon-btn:active, .icon-btn.button-pop {
  /* 1. Scale is less dramatic (0.94 instead of 0.9) for premium feel */
  transform: scale(0.94) translateY(0) !important; 
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(255, 20, 147, 0.1);
  
  /* 2. Opacity dip mimics iOS touch feedback */
  opacity: 0.85; 

  /* 3. The Press Transition: Instant (0.1s) and snappy */
  transition: transform 0.1s cubic-bezier(0.2, 0, 0, 1), opacity 0.1s;
}

/* --- RECENT ACTIVITY SECTION --- */
.activity-section {
  width: 100%;
  margin-top: auto; 
  opacity: 0; 
}

.activity-title {
  font-size: 0.85rem;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-left: 10px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 50px; 
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.5s var(--ease-elastic); /* Also applied here for smooth entry */
}

.activity-item.show {
  opacity: 1;
  transform: translateY(0);
}

.activity-item.remove {
  opacity: 0;
  transform: scale(0.9);
  margin-top: -55px; 
  transition: all 0.4s ease-in-out;
}

.act-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.act-icon {
  font-size: 1.2rem;
  background: -webkit-linear-gradient(135deg, var(--icon-gradient-start), var(--icon-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
}

.act-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
}

.act-time {
  font-size: 0.8rem;
  color: #888;
  font-weight: 400;
}

/* --- Common Animations --- */
.animate-enter { animation: fadeSlideUp 0.8s ease-out forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.2s; }
.delay-4 { animation-delay: 0.25s; }
.delay-5 { animation-delay: 0.4s; } 

@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Login Modal (Hidden) --- */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(255,240,245,0.4); backdrop-filter: blur(15px); justify-content: center; align-items: center; }
.modal-glass { background: rgba(255, 255, 255, 0.95); width: 85%; max-width: 340px; padding: 40px 30px; border-radius: 30px; text-align: center; box-shadow: 0 20px 60px rgba(255, 105, 180, 0.2); border: 1px solid #fff; animation: popIn 0.4s ease-out; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header h2 { margin: 0 0 5px 0; color: var(--text-dark); }
.modal-header p { margin: 0 0 25px 0; color: var(--text-light); font-size: 0.9rem; }
.input-group input { width: 100%; padding: 16px; margin-bottom: 15px; border: 2px solid transparent; background: #f8f8f8; border-radius: 14px; font-size: 1rem; font-family: var(--font-main); outline: none; transition: all 0.2s; }
.input-group input:focus { border-color: var(--icon-gradient-end); background: #fff; box-shadow: 0 0 0 4px rgba(255, 20, 147, 0.1); }
.primary-btn { width: 100%; padding: 16px; background: linear-gradient(135deg, var(--icon-gradient-start), var(--icon-gradient-end)); color: white; border: none; border-radius: 14px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.2s; box-shadow: 0 10px 20px rgba(199, 21, 133, 0.3); }
.primary-btn:active { transform: scale(0.97); opacity: 0.9; }

/* --- Toast (TOP) --- */
.toast {
  position: fixed; 
  top: 30px; /* Distance from top */
  bottom: auto; /* Unset bottom */
  left: 50%; 
  transform: translateX(-50%) translateY(-150px); /* Start hidden ABOVE the screen */
  background: #fff; border: 1px solid #ffeef5; padding: 12px 24px; border-radius: 50px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 15px 40px rgba(255, 105, 180, 0.25);
  font-weight: 600; color: #333;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s;
  opacity: 0; width: max-content; z-index: 9999; font-size: 0.95rem; pointer-events: none;
}
/* When shown, slide down to position */
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-icon { display: flex; align-items: center; font-size: 1.4rem; color: var(--icon-gradient-end); }

@media (min-width: 768px) {
  .app-container {
    height: 90vh; border-radius: 40px; background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 40px 80px rgba(255, 192, 203, 0.2); backdrop-filter: blur(30px); overflow: hidden;
  }
}

@media (max-height: 850px) {
 
}

@media (max-height: 780px) {
  .grid-wrapper { gap: 30px; padding-top: 10px; }
  .icon-btn { padding: 20px 15px; }
  .icon-wrapper { font-size: 3rem; }
}

@media (max-height: 720px) {
  .activity-item:nth-child(n+4) { display: none; }
}

@media (max-height: 650px) {
  .activity-item:nth-child(n+3) { display: none; }
}

@media (max-height: 600px) {
  .activity-section { display: none; }
  .grid-wrapper { justify-content: center; padding-bottom: 40px; }
  header { margin-bottom: 5px; padding-top: 10px; }
}