/**
 * MACOS SYSTEM SIMULATION APPLICATIONS STYLESHEET
 * Contains specific visual styles for: iMessage, Safari, App Store, Siri, and System Preferences.
 */

/* ==================== 1. IMESSAGE APP ==================== */
.imessage-container {
  display: flex;
  height: 100%;
  background: transparent;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.imessage-sidebar {
  width: 200px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.imessage-search-container {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.imessage-search {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  outline: none;
  box-sizing: border-box;
}

.imessage-contacts {
  flex: 1;
  overflow-y: auto;
}

.imessage-contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.imessage-contact-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.imessage-contact-card.active {
  background: rgba(0, 127, 247, 0.75);
}

.imessage-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.imessage-contact-info {
  min-width: 0;
  flex: 1;
}

.imessage-contact-name {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imessage-contact-preview {
  font-size: 11px;
  opacity: 0.7;
  margin: 2px 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imessage-contact-card.active .imessage-contact-preview {
  color: rgba(255, 255, 255, 0.9);
}

.imessage-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.45)), url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=800') center/cover no-repeat;
}

.imessage-chat-header {
  height: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.imessage-header-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.imessage-history {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.imessage-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.imessage-bubble.sent {
  align-self: flex-end;
  background: rgba(0, 127, 247, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom-right-radius: 4px;
}

.imessage-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.imessage-input-container {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.imessage-input-wrapper {
  flex: 1;
  position: relative;
}

.imessage-input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  outline: none;
  box-sizing: border-box;
}

.imessage-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: #007ff7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* ==================== 2. SAFARI BROWSER ==================== */
.safari-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  color: #000;
  font-family: -apple-system, sans-serif;
}

.safari-toolbar {
  height: 48px;
  background: rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  user-select: none;
}

.safari-nav-buttons {
  display: flex;
  gap: 8px;
}

.safari-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.safari-nav-btn:hover {
  background: rgba(0,0,0,0.08);
}

.safari-address-bar-container {
  flex: 1;
  position: relative;
}

.safari-address-bar {
  width: 100%;
  padding: 6px 12px 6px 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
  color: #111;
  outline: none;
  box-sizing: border-box;
  text-align: center;
}

.safari-address-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #444;
}

.safari-viewport {
  flex: 1;
  overflow: auto;
  background: rgba(255, 255, 255, 0.65);
}

/* Mock Instagram Style Feed inside Safari */
.mock-insta-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
}

.mock-insta-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #dbdbdb;
  padding-bottom: 20px;
}

.mock-insta-logo {
  font-size: 22px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  color: #262626;
}

.mock-insta-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  padding: 3px;
  box-sizing: border-box;
}

.mock-insta-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

.mock-insta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 8px;
}

.mock-insta-item {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #dbdbdb;
  cursor: pointer;
  border-radius: 4px;
}

.mock-insta-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.mock-insta-item:hover img {
  transform: scale(1.05);
}

.mock-insta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 13px;
  font-weight: 600;
}

.mock-insta-item:hover .mock-insta-overlay {
  opacity: 1;
}

/* ==================== 3. APP STORE ==================== */
.appstore-container {
  display: flex;
  height: 100%;
  background: #202025;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.appstore-sidebar {
  width: 180px;
  background: #18181c;
  border-right: 1px solid #2d2d34;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.appstore-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #a0a0a5;
  transition: all 0.2s;
}

.appstore-nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.appstore-nav-item.active {
  color: #fff;
  background: #007ff7;
}

.appstore-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  box-sizing: border-box;
}

.appstore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 20px;
}

.appstore-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #2a2a30;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.05);
}

.appstore-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.appstore-card__icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.appstore-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.appstore-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appstore-card__category {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #a0a0a5;
  text-transform: uppercase;
}

.appstore-card__desc {
  margin: 4px 0 0 0;
  font-size: 11px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.appstore-card__btn {
  align-self: flex-start;
  padding: 4px 16px;
  border-radius: 12px;
  background: #007ff7;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}

.appstore-card__btn:hover {
  background: #006ce0;
}

.appstore-card__btn.installed {
  background: #3a3a40;
  color: #007ff7;
  cursor: default;
}

/* ==================== 4. SYSTEM PREFERENCES ==================== */
.settings-container {
  display: flex;
  height: 100%;
  background: #1e1e1e;
  color: #fff;
  font-family: -apple-system, sans-serif;
}

.settings-sidebar {
  width: 160px;
  background: #181818;
  border-right: 1px solid #2d2d2d;
  padding: 16px 8px;
  box-sizing: border-box;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #aaa;
  transition: all 0.2s;
}

.settings-nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.settings-nav-item.active {
  color: #fff;
  background: #007ff7;
}

.settings-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  border-bottom: 1px solid #2d2d2d;
  padding-bottom: 8px;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
}

.wallpaper-card {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  aspect-ratio: 16/10;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.2s;
  background: #333;
}

.wallpaper-card:hover {
  transform: translateY(-2px);
}

.wallpaper-card.active {
  border-color: #007ff7;
  box-shadow: 0 0 10px rgba(0, 127, 247, 0.4);
}

.wallpaper-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #252525;
  border-radius: 8px;
  margin-bottom: 10px;
}

.settings-label {
  font-size: 13px;
  font-weight: 500;
}

/* ==================== 5. SIRI WIDGET ==================== */
.siri-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 280px;
  height: 320px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.siri-header {
  height: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.siri-title {
  font-size: 12px;
  font-weight: bold;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.siri-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.siri-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.4;
}

.siri-bubble.assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.siri-bubble.user {
  align-self: flex-end;
  background: #007ff7;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.siri-orb-container {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
  gap: 10px;
  padding: 0 10px;
}

.siri-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #00d2ff 0%, #007ff7 50%, #9000ff 100%);
  filter: blur(1px);
  animation: siriPulse 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(0, 127, 247, 0.6);
}

.siri-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
}

@keyframes siriPulse {
  0% { transform: scale(0.9); opacity: 0.8; filter: hue-rotate(0deg); }
  50% { transform: scale(1.1); opacity: 1; filter: hue-rotate(180deg); }
  100% { transform: scale(0.9); opacity: 0.8; filter: hue-rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Apple Music Card hover controls */
.am-card:hover .am-card-play-hover {
  opacity: 1 !important;
}
