/*
 * 4essex — app-specific styles
 * Builds on top of iwebkit.css
 */

/* ==================== SCREENS ==================== */
.iw-screen {
  display: none;
}

.iw-screen.iw-screen-active {
  display: block;
}

/* Sub-screen content (non-home screens scroll below the fixed topbar) */
.iw-screen-content {
  margin-top: 44px;
  min-height: calc(100vh - 44px);
  padding: 9px 9px 20px;
}

/* ==================== ICON COLOURS ==================== */
/* Coloured squares for list row icons */
.iw-icon {
  width: 29px;
  height: 29px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.iw-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.04) 100%);
  border-radius: 7px 7px 0 0;
  pointer-events: none;
}

.iw-icon-ai {
  background: linear-gradient(145deg, #1060d0 0%, #0840c0 55%, #00b8e8 100%);
}

.iw-icon-music {
  background: linear-gradient(145deg, #1db954 0%, #138a3a 55%, #0a5a28 100%);
}

.iw-icon-instagram {
  background: linear-gradient(145deg, #833ab4 0%, #c9357a 50%, #fd1d1d 80%, #fcb045 100%);
}

.iw-icon-music-sm {
  width: 29px;
  height: 29px;
  background: linear-gradient(145deg, #1db954 0%, #0a5a28 100%);
}

/* Row body (title + subtitle stacked) */
.iw-row-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.iw-row-title {
  font-size: 16px;
  color: #000;
  font-weight: 400;
}

.iw-row-subtitle {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 1px;
}

/* ==================== AI CHAT SCREEN ==================== */
#content-ai {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: calc(100vh - 44px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #c5c5c5;
}

.chat-message {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
}

.chat-message.assistant {
  background-color: #fff;
  color: #000;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background-color: #4a80cc;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Empty state */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
}

.chat-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.chat-empty-title {
  font-size: 17px;
  font-weight: bold;
  color: #4d6282;
}

.chat-empty-subtitle {
  font-size: 13px;
  color: #8e8e93;
}

/* Input bar */
.chat-input-bar {
  padding: 7px 10px 12px;
  background: #e8e8ed;
  border-top: 1px solid #c8c7cc;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-input {
  flex: 1;
  background: #fff;
  border: 1px solid #c8c7cc;
  border-radius: 18px;
  padding: 7px 12px;
  font-size: 15px;
  color: #000;
  outline: none;
  font-family: inherit;
}

.chat-input::placeholder {
  color: #8e8e93;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #6d84a2 0%, #4a6990 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn:active {
  opacity: 0.75;
}

/* ==================== STREAM MUSIC SCREEN ==================== */
.music-now-playing {
  flex-direction: column;
  gap: 12px;
  padding: 14px 10px !important;
}

.music-artwork {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1db954, #0a5a28);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.4);
  flex-shrink: 0;
}

.music-info {
  text-align: center;
  width: 100%;
}

.music-track-title {
  font-size: 17px;
  font-weight: bold;
  color: #000;
  margin-bottom: 3px;
}

.music-track-artist {
  font-size: 13px;
  color: #8e8e93;
}

.music-progress-row {
  flex-direction: column;
  gap: 5px;
  padding: 10px 14px !important;
}

.music-progress-bar-track {
  width: 100%;
  height: 4px;
  background: #c8c7cc;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.music-progress-bar-fill {
  height: 100%;
  width: 35%;
  background: #1db954;
  border-radius: 2px;
}

.music-progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8e8e93;
  width: 100%;
}

.music-controls-row {
  padding: 6px 10px !important;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.music-ctrl-btn {
  background: none;
  border: none;
  color: #4d6282;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.music-ctrl-btn:active {
  opacity: 0.5;
}

.music-play-pause {
  width: 52px;
  height: 52px;
  background: linear-gradient(180deg, #6d84a2 0%, #4a6990 100%);
  color: #fff;
  border-radius: 50%;
  border: 1px solid #2c4a6e;
}

/* ==================== INSTAGRAM DIRECT ==================== */
.ig-search-bar {
  padding: 7px 9px 10px;
}

.ig-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid #b8b8c0;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 14px;
  color: #000;
  font-family: inherit;
  outline: none;
}

.ig-search-input::placeholder {
  color: #8e8e93;
}

/* Avatar circle */
.ig-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #b0b8c8;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  position: relative;
}

.ig-avatar-story::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  z-index: -1;
}

.ig-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4a80cc;
  border: 2px solid #c5c5c5;
  position: absolute;
  bottom: 1px;
  right: 1px;
}

.ig-unread {
  color: #000 !important;
  font-weight: 500 !important;
}
