:root {
  --lagoon-bg: linear-gradient(180deg, #eaf7f2 0%, #d0ebe7 100%);
  --lagoon-primary: #4a847b;
  --lagoon-light: rgba(116,196,184,0.3);
  --bubble-bg: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, var(--lagoon-light) 100%);
  --input-bg: linear-gradient(135deg, var(--lagoon-light) 0%, rgba(74,132,123,0.2) 100%);
  --phone-color: #2d4a4a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  height: 100vh;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* PHONE CONTAINER */
.phone {
  width: 375px;
  height: 812px;
  background: var(--phone-color);
  border-radius: 40px;
  padding: 8px;
  box-shadow: 0 25px 80px rgba(45,74,74,0.4);
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
  background: var(--lagoon-bg);
}

/* VIEWS */
.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.6s ease;
}

.view.hidden { opacity: 0; pointer-events: none; }
.view.slide-left { transform: translateX(-100%); }
.view.slide-right { transform: translateX(100%); }
.view.show { opacity: 1; transform: translateX(0); }

/* HOME SCREEN */
.home-screen {
  background: url('images/background.png') center/cover;
  display: flex;
  flex-direction: column;
  padding: 60px 20px 120px;
  overflow-y: auto;
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px 10px;
  margin-top: 20px;
}

.app-icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.app-icon-container:active { transform: scale(0.95); }

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 13.5px;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--lagoon-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-label {
  font-size: 11px;
  color: #333;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  font-weight: 400;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TITLE BAR */
.title-bar {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 600;
  color: var(--lagoon-primary);
  background: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  z-index: 20;
  cursor: pointer;
  transition: background 0.3s ease;
}

.title-bar:hover { background: rgba(255,255,255,0.95); }

/* FUNCTION BUBBLES */
.bubble {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bubble-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.9;
  box-shadow: 
      inset 2px -2px 8px rgba(255,255,255,0.6),
      inset -2px 2px 8px rgba(74,132,123,0.2),
      0 4px 12px rgba(74,132,123,0.15);
  z-index: 20;
}

.bubble::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 100%);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.bubble:hover { transform: translateY(-2px); opacity: 1; }

.bubble.tl { top: 52px; left: 24px; }
.bubble.tr { top: 52px; right: 24px; }
.bubble.bl { bottom: 100px; left: 24px; }
.bubble.br { bottom: 100px; right: 24px; }

.bubble-icon {
  font-size: 18px;
  color: rgba(74, 132, 123, 0.7);
  font-weight: 400;
}

/* MEDIA LAYERS */
.media-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.transition-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.transition-layer.show { opacity: 1; }

/* INPUT AREA */
.input-zone {
  position: absolute;
  bottom: 32px;
  left: 24px;
  right: 24px;
  z-index: 20;
}

.input-bubble {
  background: var(--input-bg);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 25px;
  padding: 16px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(74,132,123,0.2);
}

.input-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.2) 0%, transparent 50%),
               radial-gradient(circle at 70% 80%, var(--lagoon-light) 0%, transparent 40%);
  pointer-events: none;
}

.input-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(74,132,123,0.9);
  font-size: 18px;
  font-weight: 400;
  z-index: 2;
  position: relative;
}

.input-field::placeholder { color: rgba(74,132,123,0.6); }

/* CARDS */
.card {
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(74,132,123,0.15);
  width: 100%;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.api-setup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(74,132,123,0.2);
  z-index: 25;
  transition: opacity 0.5s ease;
}

.api-setup.hidden { opacity: 0; pointer-events: none; }

.reading-card {
  position: absolute;
  top: 140px;
  left: 24px;
  right: 24px;
  bottom: 180px;
  background: #ffffff;
  border: 3px solid var(--lagoon-primary);
  border-radius: 35px;
  padding: 30px;
  box-shadow: 
      0 25px 50px rgba(74,132,123,0.25),
      0 15px 35px rgba(74,132,123,0.15);
  z-index: 20;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  overflow-y: auto;
  min-height: fit-content;
  height: auto;
}

.reading-card.show {
  opacity: 1;
  transform: translateY(0);
}

.reading-text {
  color: #000000;
  font-size: 21px;
  line-height: 1.6;
}

.language-select {
  width: 100%;
  background: rgba(74,132,123,0.1);
  border: 1px solid rgba(74,132,123,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2d4a4a;
  font-size: 16px;
}

.language-select:hover {
  background: rgba(74,132,123,0.2);
}

.language-select:focus {
  outline: none;
  border-color: var(--lagoon-primary);
}

.reading-input {
  position: absolute;
  bottom: 32px;
  left: 24px;
  right: 24px;
  z-index: 20;
  background: rgba(116,196,184,0.2);
  border: 1px solid rgba(74,132,123,0.3);
  border-radius: 20px;
  padding: 16px 20px;
  backdrop-filter: blur(10px);
}

.reading-input input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #2d4a4a;
  font-size: 16px;
}

.reading-input input::placeholder { color: rgba(45,74,74,0.6); }

/* BUTTONS */
.btn {
  background: var(--lagoon-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.3s ease;
}

.btn:hover { background: #3d6f68; }
.btn.secondary { background: #6aa6a6; }

/* SETTINGS */
.settings-content {
  padding: 120px 24px 120px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.settings-header {
  color: var(--lagoon-primary);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

.settings-group {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(74,132,123,0.1);
}

.settings-group:last-child { border-bottom: none; }

.settings-label {
  color: #2d4a4a;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}

.setting-option {
  background: rgba(74,132,123,0.1);
  border: 1px solid rgba(74,132,123,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2d4a4a;
}

.setting-option:hover {
  background: rgba(74,132,123,0.2);
  transform: translateY(-1px);
}

.setting-option.active {
  background: var(--lagoon-primary);
  color: white;
}

/* FONT & READING OPTIONS */
.font-option, .reading-level-option {
  background: rgba(74,132,123,0.1);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.font-option:hover, .reading-level-option:hover {
  background: rgba(74,132,123,0.15);
  transform: translateY(-1px);
}

.font-option.active, .reading-level-option.active {
  border-color: var(--lagoon-primary);
  background: rgba(74,132,123,0.2);
}

/* SHARES */
.shares-content {
  padding: 120px 24px 120px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.shares-header {
  color: var(--lagoon-primary);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 32px;
  text-align: center;
}

.action-bubbles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
  max-width: 280px;
  margin: 0 auto 32px;
}

.action-bubble {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bubble-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
      inset 2px -2px 8px rgba(255,255,255,0.6),
      inset -2px 2px 8px rgba(74,132,123,0.2),
      0 4px 12px rgba(74,132,123,0.15);
  margin: 0 auto;
  position: relative;
}

.action-bubble::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 100%);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.action-bubble:hover {
  transform: translateY(-3px);
  box-shadow: 
      inset 2px -2px 8px rgba(255,255,255,0.7),
      inset -2px 2px 8px rgba(74,132,123,0.3),
      0 8px 20px rgba(74,132,123,0.2);
}

.action-icon {
  font-size: 28px;
  color: rgba(74, 132, 123, 0.7);
}

.review-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(74,132,123,0.2);
}

/* THINKING ANIMATION */
.thinking {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  background: var(--lagoon-primary);
  border-radius: 50%;
  animation: thinking 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* HOME INDICATOR */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  z-index: 30;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .phone {
      width: 100vw;
      height: 100vh;
      border-radius: 0;
      padding: 0;
  }
  .screen { border-radius: 0; }
}