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

body {
  background-color: #f5f5f5;
  font-family: 'Vazirmatn', 'Segoe UI', Roboto, sans-serif;
  color: #202124;
  margin: 0; padding: 0; height: 100vh; overflow: hidden;
}

/* ========== استایل های پایه ========== */
.container { max-width: 480px; margin: 0 auto; background-color: #ffffff; box-shadow: 0 0 20px rgba(0,0,0,0.05); height: 100vh; border-radius: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }

.header { display: flex; align-items: center; justify-content: center; padding: 12px 16px; background: white; border-bottom: 1px solid #e8eaed; z-index: 10; flex-shrink: 0; }
.search-section { padding: 0; width: 100%; }
.search-box { background: #f1f3f4; border-radius: 10px; display: flex; align-items: center; padding: 10px 16px; gap: 8px; color: #5f6368; font-size: 14px; border: 1px solid transparent; transition: 0.2s; width: 100%; }
.search-box input { border: none; background: transparent; outline: none; font-size: 14px; color: #202124; flex: 1; text-align: right; font-family: 'Vazirmatn', sans-serif; }
.search-box input::placeholder { color: #5f6368; }
.search-box .search-icon { width: 18px; height: 18px; flex-shrink: 0; color: #5f6368; }
.header-title-section { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-title { font-size: 18px; font-weight: 600; color: #202124; }
.header-back-only { display: flex; align-items: center; gap: 8px; width: 100%; }
.back-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; color: #5f6368; border: none; background: none; flex-shrink: 0; box-shadow: none !important; }
.back-btn:hover { background: rgba(2, 164, 211, 0.1); }
.back-btn svg { width: 22px; height: 22px; transform: scaleX(-1); }
.back-title { font-size: 17px; font-weight: 600; color: #202124; }

#page-content { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; transition: opacity 0.2s ease; padding-bottom: 80px; }
#page-content.loading { opacity: 0.5; }

/* ========== اسلایدر ========== */
.slider-section { margin: 10px 16px 14px; position: relative; overflow: hidden; border-radius: 16px; }
.slides-container { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; border-radius: 16px; direction: ltr; }
.slides-container::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; min-height: 180px; border-radius: 16px; background-size: cover; background-position: center; background-repeat: no-repeat; }

/* ========== بخش‌های اصلی ========== */
.section-header { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 6px; }
.section-header h2 { font-size: 17px; font-weight: 600; color: #202124; }
.section-header span { color: #02A4D3; font-size: 13px; font-weight: 500; cursor: pointer; }

.app-row { display: flex; gap: 8px; padding: 6px 16px 14px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.app-row::-webkit-scrollbar { display: none; }
.app-card { min-width: 90px; max-width: 90px; text-align: center; cursor: pointer; flex-shrink: 0; }
.app-icon { width: 62px; height: 62px; background: #f1f3f4; border-radius: 16px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); overflow: hidden; }
.app-icon svg { width: 30px; height: 30px; }
.app-name { font-size: 12px; font-weight: 500; color: #202124; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.category-slider-section { margin-bottom: 16px; }
.category-slider-section .section-header { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 6px; }
.category-slider-section .section-header h2 { font-size: 17px; font-weight: 600; color: #202124; }
.category-slider-section .section-header span { color: #02A4D3; font-size: 13px; font-weight: 500; cursor: pointer; }
.category-app-row { display: flex; gap: 8px; padding: 6px 16px 14px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.category-app-row::-webkit-scrollbar { display: none; }

.topcharts-slider { display: none; }

/* ========== صفحه جزئیات اپلیکیشن ========== */
.detail-page-wrapper { padding-bottom: 80px; position: relative; }
.detail-hero-new { display: flex; align-items: center; gap: 14px; padding: 16px; background: #f8f9fa; margin: 0; }
.detail-icon-new { width: 64px; height: 64px; border-radius: 16px; background: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.08); overflow: hidden; }
.detail-icon-new svg { width: 36px; height: 36px; }
.detail-info-new { flex: 1; }
.detail-name { font-size: 18px; font-weight: 700; color: #202124; margin-bottom: 2px; }
.detail-dev { font-size: 13px; color: #5f6368; margin-bottom: 6px; }
.detail-info-section { padding: 16px; }
.detail-stats-row { display: flex; gap: 10px; margin-bottom: 20px; }
.detail-stat-card { flex: 1; text-align: center; padding: 12px 6px; background: #f8f9fa; border-radius: 12px; }
.detail-stat-value { font-size: 15px; font-weight: 600; color: #202124; }
.detail-stat-label { font-size: 11px; color: #5f6368; margin-top: 3px; }
.detail-description { margin-bottom: 20px; }
.detail-description h3 { font-size: 16px; font-weight: 600; margin-bottom: 7px; color: #202124; }
.detail-description p { font-size: 13px; color: #5f6368; line-height: 1.7; }

.detail-floating-install { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; align-items: center; gap: 14px; padding: 12px 16px 20px; background: white; border-top: 1px solid #e8eaed; z-index: 30; }
.detail-bottom-info { flex: 1; }
.detail-bottom-price { font-size: 18px; font-weight: 700; color: #202124; }
.detail-bottom-note { font-size: 11px; color: #34a853; margin-top: 2px; }
.detail-install-btn { background: #02A4D3; color: white; border: none; padding: 16px 64px; border-radius: 14px; font-size: 17px; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; transition: 0.2s; white-space: nowrap; flex-shrink: 0; box-shadow: none !important; }
.detail-install-btn:hover { background: #0288b8; }

/* ========== صفحه دسته‌بندی ========== */
.category-container { padding: 0; }
.category-list { padding: 0; }
.category-list .list-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #f1f3f4; cursor: pointer; transition: 0.2s; }
.category-list .list-card:hover { background: #f8f9fa; }
.category-list .list-icon { width: 50px; height: 50px; background: #f1f3f4; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.category-list .list-icon svg { width: 26px; height: 26px; }
.category-list .list-info { flex: 1; }
.category-list .list-title { font-weight: 500; font-size: 15px; color: #202124; }
.category-list .list-dev { font-size: 12px; color: #5f6368; margin-top: 2px; }
.category-list .list-stars { color: #f9ab00; font-size: 13px; }

/* ========== صفحه چت‌ها ========== */
.chats-container { padding: 0; }
.chat-list { padding: 0; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: 0.2s; border-bottom: 1px solid #f1f3f4; }
.chat-item:hover { background: #f8f9fa; }
.chat-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.chat-avatar svg { width: 22px; height: 22px; }
.chat-avatar.blue { background: #02A4D3; } .chat-avatar.green { background: #34a853; } .chat-avatar.orange { background: #f9ab00; } .chat-avatar.purple { background: #7b1fa2; } .chat-avatar.red { background: #ea4335; }
.chat-info { flex: 1; min-width: 0; }
.chat-name { font-weight: 500; font-size: 14px; color: #202124; }
.chat-message { font-size: 12px; color: #5f6368; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { text-align: left; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-time { font-size: 11px; color: #5f6368; }
.chat-badge { display: inline-block; background: #02A4D3; color: white; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 10px; margin-top: 3px; }

/* ========== استایل نمایش فرستنده در لیست گفتگوها ========== */
.chat-sender-name-in-list {
  font-weight: 500;
  color: #02A4D3;
  font-size: 11px;
  margin-left: 4px;
}

/* ========== بج شمارنده پیام‌های جدید ========== */
.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #02A4D3;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-unread-badge.max {
  font-size: 10px;
  min-width: 24px;
  padding: 0 5px;
}

/* ========== صفحه جزئیات چت ========== */
.chat-detail-container { display: flex; flex-direction: column; height: 100%; background: #ffffff; }
.chat-detail-messages { flex: 1; overflow-y: auto; padding: 14px 14px 90px; display: flex; flex-direction: column; gap: 5px; background: #ffffff; }
.chat-msg { max-width: 80%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.6; position: relative; word-wrap: break-word; }
.chat-msg.sent { align-self: flex-end; background: #02A4D3; color: white; border-bottom-right-radius: 4px; }
.chat-msg.received { align-self: flex-start; background: #f1f3f4; color: #202124; border-bottom-left-radius: 4px; }
.chat-msg-time { font-size: 10px; opacity: 0.7; margin-top: 3px; text-align: left; font-family: 'Vazirmatn', monospace; direction: ltr; }

/* ========== استایل عکس در چت ========== */
.chat-image-wrapper {
  position: relative;
  display: inline-block;
  margin: 0;
  line-height: 0;
  background: transparent !important;
}

.chat-image-time {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: transparent;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Vazirmatn', monospace;
  z-index: 5;
  direction: ltr;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.chat-msg:has(.chat-image-wrapper) {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
  box-shadow: none !important;
}

.chat-msg:has(.chat-image-wrapper) .chat-msg-time { display: none; }

.chat-image-thumb {
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  cursor: pointer;
  object-fit: cover;
  transition: 0.2s;
  display: block;
}

/* ========== استایل پلیر صدا ========== */
.chat-msg audio {
  width: 280px;
  height: 56px;
  border-radius: 30px;
  background: transparent;
  outline: none;
}

.chat-msg audio::-webkit-media-controls-panel {
  background: linear-gradient(135deg, #02A4D3, #0288b8);
  border-radius: 30px;
}

.chat-msg audio::-webkit-media-controls-current-time-display,
.chat-msg audio::-webkit-media-controls-time-remaining-display {
  color: white;
  font-weight: 500;
  font-size: 13px;
}

.chat-msg audio::-webkit-media-controls-timeline {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  height: 4px;
}

.chat-msg audio::-webkit-media-controls-volume-slider {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.chat-msg:has(audio) {
  background: transparent !important;
  padding: 4px 0 !important;
}

.chat-msg:has(audio) .chat-msg-time { color: #5f6368; }

/* ========== استایل لینک فایل ========== */
.chat-file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(2, 164, 211, 0.15);
  border-radius: 16px;
  text-decoration: none;
  color: white !important;
  font-size: 14px;
  font-weight: 500;
  direction: rtl;
}

.chat-file-link .file-name { flex: 1; text-align: right; color: white; }
.chat-file-link .file-icon { font-size: 24px; order: 2; }

/* ========== استایل دکمه ارسال ========== */
.chat-detail-input-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; align-items: center; gap: 8px; padding: 8px 12px 16px; background: white; border-top: 1px solid #e8eaed; z-index: 25; }
.chat-input-wrapper { flex: 1; display: flex; align-items: center; background: #f1f3f4; border-radius: 24px; padding: 4px 6px; gap: 4px; }
.chat-detail-input { flex: 1; padding: 10px 8px; background: transparent; border: none; font-size: 14px; outline: none; font-family: 'Vazirmatn', sans-serif; min-width: 0; }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #c8e6e9;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.chat-send-btn svg { width: 18px; height: 18px; }

.chat-send-btn.visible {
  display: flex;
  background: #02A4D3;
  opacity: 1;
  cursor: pointer;
}

.chat-send-btn.visible:hover { background: #0288b8; transform: scale(1.02); }

.chat-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
}

.chat-mic-btn.hidden { display: none; }
.chat-mic-btn:hover { background: rgba(2, 164, 211, 0.1); }
.chat-mic-btn svg { width: 20px; height: 20px; }

/* ========== استایل دکمه سنجاق با dropdown (سمت چپ) ========== */
.chat-attach-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-attach-main {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5f6368;
  transition: 0.2s;
  box-shadow: none !important;
}

.chat-attach-main:hover {
  background: rgba(2, 164, 211, 0.1);
}

.chat-attach-main svg {
  width: 20px;
  height: 20px;
}

.chat-attach-dropdown {
  position: absolute;
  bottom: 50px;
  left: -120px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 100;
  display: none;
  overflow: hidden;
  animation: fadeInUp 0.2s ease;
}

.chat-attach-dropdown.show {
  display: block;
}

.chat-attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  color: #202124;
}

.chat-attach-item:hover {
  background: #f1f3f4;
}

.chat-attach-item svg {
  width: 20px;
  height: 20px;
}

/* ========== استایل صفحه دستیار ========== */
.assistant-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #c8e6e9;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.assistant-send-btn svg { width: 18px; height: 18px; }

.assistant-send-btn.visible {
  display: flex;
  background: #02A4D3;
  opacity: 1;
  cursor: pointer;
}

.assistant-send-btn.visible:hover {
  background: #0288b8;
  transform: scale(1.02);
}

.assistant-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
}

.assistant-mic-btn.hidden { display: none; }
.assistant-mic-btn:hover { background: rgba(2, 164, 211, 0.1); }
.assistant-mic-btn svg { width: 18px; height: 18px; }

.assistant-attach-dropdown {
  position: absolute;
  bottom: 50px;
  left: 0;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 150px;
  z-index: 100;
  display: none;
  overflow: hidden;
  animation: fadeInUp 0.2s ease;
}

.assistant-attach-dropdown.show { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== نقطه آبی اعلان ========== */
.nav-item { position: relative; }

.nav-item.has-notification::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: #02A4D3;
  border-radius: 50%;
  border: 1px solid white;
  animation: pulse-notification 1.5s infinite;
}

@keyframes pulse-notification {
  0% { transform: scale(0.8); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(0.8); opacity: 1; }
}

/* ========== مودال بزرگنمایی عکس ========== */
.image-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.active { opacity: 1; visibility: visible; }

.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.image-modal-download {
  position: absolute;
  top: -50px;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  color: white;
  z-index: 10;
}

.image-modal-download:hover { background: rgba(2, 164, 211, 0.7); transform: scale(1.05); }
.image-modal-download svg { width: 20px; height: 20px; stroke: white; stroke-width: 2; }

.image-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}

.image-modal-close:hover { background: rgba(255,255,255,0.3); }

@media (max-width: 600px) {
  .image-modal-download { top: 20px; left: 20px; }
  .image-modal-close { top: 20px; right: 20px; }
}

/* ========== استایل صفحه جستجو ========== */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e8eaed;
}

.search-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f1f3f4;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5f6368;
  transition: 0.2s;
  flex-shrink: 0;
  box-shadow: none !important;
}

.search-back-btn:hover { background: rgba(2, 164, 211, 0.1); }
.search-back-btn svg { width: 22px; height: 22px; transform: scaleX(-1); }

.search-overlay-input-wrapper { flex: 1; }
.search-overlay-input { width: 100%; padding: 12px 16px; border: none; background: #f1f3f4; border-radius: 28px; font-size: 16px; font-family: 'Vazirmatn', sans-serif; outline: none; text-align: right; }
.search-overlay-input:focus { background: #e8eaed; }

.search-results { flex: 1; overflow-y: auto; padding: 16px; }
.search-results-title { font-size: 14px; font-weight: 600; color: #5f6368; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e8eaed; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 12px;
}

.search-result-item:hover { background: #f8f9fa; }
.search-result-icon { width: 48px; height: 48px; border-radius: 12px; background: #f1f3f4; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.search-result-icon img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; }
.search-result-name { font-size: 15px; font-weight: 600; color: #202124; }
.search-result-dev { font-size: 12px; color: #5f6368; margin-top: 2px; }

.search-empty { text-align: center; padding: 40px; color: #9aa0a6; }
.search-empty svg { margin-bottom: 12px; opacity: 0.5; }
.search-loading { text-align: center; padding: 40px; }
.search-loading .chat-loading-spinner { width: 32px; height: 32px; margin: 0 auto; }

/* ========== استایل جستجوی مجله ========== */
.magazine-search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

.magazine-search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e8eaed;
}

.magazine-search-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f1f3f4;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5f6368;
  transition: 0.2s;
  flex-shrink: 0;
  box-shadow: none !important;
}

.magazine-search-back-btn:hover { background: rgba(2, 164, 211, 0.1); }
.magazine-search-back-btn svg { width: 22px; height: 22px; transform: scaleX(-1); }

.magazine-search-overlay-input-wrapper { flex: 1; }
.magazine-search-overlay-input { width: 100%; padding: 12px 16px; border: none; background: #f1f3f4; border-radius: 28px; font-size: 16px; font-family: 'Vazirmatn', sans-serif; outline: none; text-align: right; }
.magazine-search-overlay-input:focus { background: #e8eaed; }

.magazine-search-results { flex: 1; overflow-y: auto; padding: 16px; }
.magazine-search-results-title { font-size: 14px; font-weight: 600; color: #5f6368; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e8eaed; }

.magazine-search-result-item {
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f3f4;
}

.magazine-search-result-item:hover { background: #f8f9fa; }
.magazine-search-result-title { font-size: 15px; font-weight: 600; color: #202124; margin-bottom: 4px; }
.magazine-search-result-desc { font-size: 12px; color: #5f6368; line-height: 1.5; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.magazine-search-result-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #9aa0a6; }
.magazine-search-result-meta .category { color: #02A4D3; font-weight: 500; }

.magazine-search-empty { text-align: center; padding: 40px; color: #9aa0a6; }
.magazine-search-empty svg { margin-bottom: 12px; opacity: 0.5; }
.magazine-search-loading { text-align: center; padding: 40px; }

/* ========== استایل جستجوی گفتگوها ========== */
.chats-search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

.chats-search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e8eaed;
}

.chats-search-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f1f3f4;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5f6368;
  transition: 0.2s;
  flex-shrink: 0;
  box-shadow: none !important;
}

.chats-search-back-btn:hover { background: rgba(2, 164, 211, 0.1); }
.chats-search-back-btn svg { width: 22px; height: 22px; transform: scaleX(-1); }

.chats-search-overlay-input-wrapper { flex: 1; }
.chats-search-overlay-input { width: 100%; padding: 12px 16px; border: none; background: #f1f3f4; border-radius: 28px; font-size: 16px; font-family: 'Vazirmatn', sans-serif; outline: none; text-align: right; }
.chats-search-overlay-input:focus { background: #e8eaed; }

.chats-search-results { flex: 1; overflow-y: auto; padding: 16px; }
.chats-search-results-title { font-size: 14px; font-weight: 600; color: #5f6368; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e8eaed; }

.chats-search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f3f4;
}

.chats-search-result-item:hover { background: #f8f9fa; }
.chats-search-result-avatar { width: 48px; height: 48px; border-radius: 50%; background: #02A4D3; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: white; }
.chats-search-result-avatar svg { width: 24px; height: 24px; }
.chats-search-result-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chats-search-result-info { flex: 1; min-width: 0; }
.chats-search-result-name { font-size: 15px; font-weight: 600; color: #202124; }
.chats-search-result-message { font-size: 12px; color: #5f6368; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats-search-result-time { font-size: 11px; color: #9aa0a6; flex-shrink: 0; }

.chats-search-empty { text-align: center; padding: 40px; color: #9aa0a6; }
.chats-search-empty svg { margin-bottom: 12px; opacity: 0.5; }
.chats-search-loading { text-align: center; padding: 40px; }

/* Chat loading spinner */
.chat-loading-spinner { width: 32px; height: 32px; border: 3px solid #e8eaed; border-top-color: #02A4D3; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== صفحه مجله (اخبار) ========== */
.magazine-container { padding: 14px; }
.magazine-tabs { display: flex; gap: 0; margin-bottom: 14px; background: #f1f3f4; border-radius: 22px; padding: 3px; }
.magazine-tab { flex: 1; text-align: center; padding: 7px 14px; border-radius: 18px; font-size: 13px; font-weight: 500; cursor: pointer; color: #5f6368; transition: 0.2s; }
.magazine-tab.active { background: white; color: #02A4D3; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.magazine-list { display: flex; flex-direction: column; gap: 1px; }
.magazine-list-item { display: flex; align-items: flex-start; padding: 13px 10px; background: white; border-radius: 12px; cursor: pointer; transition: 0.2s; }
.magazine-list-item:hover { background: #f8f9fa; }
.magazine-list-content { flex: 1; min-width: 0; }
.magazine-list-title { font-size: 14px; font-weight: 600; color: #202124; margin-bottom: 3px; }
.magazine-list-desc { font-size: 12px; color: #5f6368; line-height: 1.5; margin-bottom: 5px; }
.magazine-list-meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9aa0a6; }
.magazine-list-meta span:first-child { color: #02A4D3; font-weight: 500; }

/* ========== صفحه جزئیات خبر ========== */
.news-detail-container { padding: 20px 16px; }
.news-detail-category { margin-bottom: 10px; }
.news-detail-category span { display: inline-block; background: #e8f0fe; color: #02A4D3; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; }
.news-detail-title { font-size: 20px; font-weight: 700; color: #202124; line-height: 1.4; margin-bottom: 10px; }
.news-detail-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9aa0a6; margin-bottom: 20px; }
.news-detail-image { width: 100%; height: 180px; background: linear-gradient(135deg, #e8f0fe, #d2e3fc); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #02A4D3; margin-bottom: 20px; overflow: hidden; }
.news-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.news-detail-body { font-size: 14px; color: #202124; line-height: 1.9; }
.news-detail-body p { margin-bottom: 14px; }

/* ========== صفحه پروفایل کاربر ========== */
.profile-page { padding: 0; }
.profile-cover { height: 120px; background: linear-gradient(135deg, #02A4D3 0%, #0288b8 100%); position: relative; }
.profile-cover-pattern { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.12; background-image: radial-gradient(circle at 20% 50%, white 2px, transparent 2px), radial-gradient(circle at 80% 20%, white 2px, transparent 2px), radial-gradient(circle at 50% 80%, white 3px, transparent 3px); background-size: 35px 35px, 45px 45px, 25px 25px; }
.profile-avatar-row { display: flex; justify-content: center; margin-top: -40px; position: relative; z-index: 2; }
.profile-avatar-new { width: 80px; height: 80px; border-radius: 50%; background: white; border: 4px solid white; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(0,0,0,0.1); }
.profile-avatar-new svg { width: 48px; height: 48px; color: #02A4D3; }
.profile-details { text-align: center; padding: 10px 16px 0; }
.profile-fullname { font-size: 18px; font-weight: 700; color: #202124; }
.profile-username { font-size: 13px; color: #5f6368; margin-top: 2px; }
.profile-metrics { display: flex; justify-content: space-around; padding: 16px 14px; margin: 14px; background: #f8f9fa; border-radius: 14px; }
.profile-metric { text-align: center; }
.profile-metric-value { font-size: 18px; font-weight: 700; color: #02A4D3; }
.profile-metric-label { font-size: 11px; color: #5f6368; margin-top: 2px; }
.profile-section-title { font-size: 15px; font-weight: 600; color: #202124; padding: 0 16px 7px; }
.profile-menu-new { padding: 0 16px; }
.profile-menu-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f8f9fa; border-radius: 12px; margin-bottom: 7px; cursor: pointer; transition: 0.2s; box-shadow: none !important; }
.profile-menu-card:hover { background: rgba(2, 164, 211, 0.05); }
.profile-menu-icon-new { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-menu-icon-new.purple { background: rgba(2, 164, 211, 0.1); color: #02A4D3; }
.profile-menu-icon-new.blue { background: #e8f0fe; color: #02A4D3; }
.profile-menu-icon-new.green { background: #e6f4ea; color: #34a853; }
.profile-menu-icon-new.orange { background: #fef7e0; color: #f9ab00; }
.profile-menu-icon-new.red { background: #fce8e6; color: #ea4335; }
.profile-menu-icon-new svg { width: 18px; height: 18px; }
.profile-menu-text { flex: 1; font-size: 14px; font-weight: 500; color: #202124; }
.profile-menu-arrow-new { color: #dadce0; }

.profile-logged-out { display: flex; align-items: center; justify-content: center; height: 60vh; }
.profile-login-prompt { text-align: center; }
.profile-login-prompt h2 { font-size: 20px; font-weight: 700; color: #202124; margin-bottom: 8px; }
.profile-login-prompt p { font-size: 14px; color: #5f6368; margin-bottom: 24px; }
.profile-login-btn { background: #02A4D3; color: white; border: none; padding: 12px 32px; border-radius: 24px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; box-shadow: none !important; }
.profile-login-btn:hover { background: #0288b8; }

/* ========== مودال‌ها ========== */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: flex-end; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: 20px 20px 0 0; padding: 24px; width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; animation: slideUp 0.3s ease; }
.modal-small { max-width: 480px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: #f1f3f4; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; box-shadow: none !important; }
.modal-close:hover { background: rgba(2, 164, 211, 0.1); }

/* ========== فرم لاگین ========== */
.login-desc { font-size: 13px; color: #5f6368; margin-bottom: 12px; text-align: center; }
.login-input { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 16px; font-family: 'Vazirmatn', sans-serif; outline: none; margin-bottom: 10px; text-align: center; direction: ltr; letter-spacing: 2px; }
.login-input:focus { border-color: #02A4D3; }
.login-error { color: #ea4335; font-size: 12px; text-align: center; margin-bottom: 8px; min-height: 18px; }
.login-timer { text-align: center; font-size: 13px; color: #5f6368; margin-bottom: 10px; min-height: 20px; direction: ltr; }
.login-submit-btn { width: 100%; padding: 12px; background: #02A4D3; color: white; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; box-shadow: none !important; }
.login-submit-btn:hover { background: #0288b8; }
.login-resend-btn { width: 100%; padding: 10px; background: transparent; color: #02A4D3; border: none; font-size: 13px; cursor: pointer; font-family: 'Vazirmatn', sans-serif; margin-top: 6px; box-shadow: none !important; }
.login-resend-btn:disabled { color: #9aa0a6; cursor: not-allowed; }

/* ========== صفحه پرداخت ========== */
.pay-container { padding: 0 0 90px; }
.pay-app-row { display: flex; align-items: center; gap: 14px; padding: 16px; }
.pay-app-icon-wrap { width: 52px; height: 52px; background: #f1f3f4; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.pay-app-details { flex: 1; }
.pay-app-name { font-size: 16px; font-weight: 600; color: #202124; }
.pay-app-dev { font-size: 13px; color: #5f6368; margin-top: 2px; }
.pay-divider { height: 1px; background: #e8eaed; margin: 0 16px; }
.pay-methods-section { padding: 16px; }
.pay-methods-label { font-size: 13px; font-weight: 600; color: #202124; margin-bottom: 10px; }
.pay-method-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #f8f9fa; border-radius: 14px; margin-bottom: 8px; cursor: pointer; transition: 0.2s; border: 2px solid transparent; }
.pay-method-row:hover { background: #f0f0f0; }
.pay-method-row.active { background: #f0f6ff; border-color: #02A4D3; }
.pay-method-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.pay-method-circle { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #dadce0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-method-row.active .pay-method-circle { border-color: #02A4D3; }
.pay-method-circle-inner { width: 10px; height: 10px; border-radius: 50%; background: transparent; transition: 0.2s; }
.pay-method-row.active .pay-method-circle-inner { background: #02A4D3; }
.pay-method-icon-wrap { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-method-icon-wrap.blue-bg { background: #02A4D3; }
.pay-method-icon-wrap.green-bg { background: #34a853; }
.pay-method-text { flex: 1; }
.pay-method-name { font-size: 14px; font-weight: 600; color: #202124; }
.pay-method-sub { font-size: 12px; color: #5f6368; margin-top: 2px; }
.pay-method-checkmark { color: #02A4D3; font-size: 16px; font-weight: 700; display: none; }
.pay-method-row.active .pay-method-checkmark { display: block; }
.pay-discount-box { background: #f8f9fa; border-radius: 14px; padding: 14px; margin-top: 4px; }
.pay-discount-header { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #202124; margin-bottom: 10px; }
.pay-discount-input-row { display: flex; gap: 8px; }
.pay-discount-input { flex: 1; padding: 10px 14px; background: white; border: 1px solid #e0e0e0; border-radius: 12px; font-size: 14px; outline: none; font-family: 'Vazirmatn', sans-serif; }
.pay-discount-input:focus { border-color: #02A4D3; }
.pay-discount-apply-btn { padding: 10px 20px; background: #02A4D3; color: white; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; white-space: nowrap; box-shadow: none !important; }
.pay-discount-apply-btn:hover { background: #0288b8; }
.pay-bottom-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; align-items: center; gap: 14px; padding: 12px 16px 20px; background: white; border-top: 1px solid #e8eaed; z-index: 30; }
.pay-bottom-info { flex: 1; }
.pay-bottom-price { font-size: 18px; font-weight: 700; color: #202124; }
.pay-bottom-note { font-size: 11px; color: #34a853; margin-top: 2px; }
.pay-bottom-btn { background: #02A4D3; color: white; border: none; padding: 16px 64px; border-radius: 14px; font-size: 17px; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; transition: 0.2s; white-space: nowrap; flex-shrink: 0; box-shadow: none !important; }
.pay-bottom-btn:hover { background: #0288b8; }

/* ========== منوی پایین ========== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; max-width: 480px; margin: 0 auto; display: flex; justify-content: space-around; align-items: center; padding: 8px 6px; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px 20px 0 0; box-shadow: 0 -2px 16px rgba(0,0,0,0.08); z-index: 50; transition: transform 0.3s ease, opacity 0.3s ease; }
.bottom-nav.hidden { transform: translateY(120px); opacity: 0; pointer-events: none; }

.nav-item { display: flex; flex-direction: column; align-items: center; color: #5f6368; font-size: 10px; gap: 3px; cursor: pointer; padding: 6px 10px; border-radius: 14px; transition: 0.2s; box-shadow: none !important; position: relative; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: #02A4D3; }

/* ========== متفرقه ========== */
.section-header{ display:none;}
hr { margin: 6px 16px; border: 0.5px solid #f1f3f4; }
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}
@media (max-width: 400px) { .app-card { min-width: 80px; } .container { max-width: 100%; } .bottom-nav { max-width: 100%; } }

/* ========== استایل صفحه دستیار ========== */
.assistant-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  position: relative;
  padding-top: 0;
  justify-content: center;
}

.assistant-chat-messages {
  flex: 0 0 auto;
  overflow-y: auto;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  transition: all 0.3s ease;
}

.assistant-chat-messages:not(:empty) {
  flex: 1;
  max-height: none;
  opacity: 1;
}

.assistant-input-section {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
}

.assistant-hint-text {
  text-align: right;
  font-size: 24px;
  font-weight: 700;
  color: #000000;
  padding: 8px 20px 12px;
  font-family: 'Vazirmatn', sans-serif;
  background: transparent;
  letter-spacing: -0.5px;
}

.assistant-chat-input-wrapper {
  position: relative;
  padding: 4px 16px 10px;
  background: white;
  border-top: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.assistant-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.assistant-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f1f3f4;
  border-radius: 24px;
  padding: 2px 4px;
  gap: 2px;
}

.assistant-chat-input {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  font-size: 15px;
  outline: none;
  font-family: 'Vazirmatn', sans-serif;
  min-width: 0;
}

.assistant-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #c8e6e9;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.assistant-send-btn svg { width: 18px; height: 18px; }

.assistant-send-btn.visible {
  display: flex;
  background: #02A4D3;
  opacity: 1;
  cursor: pointer;
}

.assistant-send-btn.visible:hover {
  background: #0288b8;
  transform: scale(1.02);
}

.assistant-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
  box-shadow: none !important;
}

.assistant-mic-btn.hidden { display: none; }
.assistant-mic-btn:hover { background: rgba(2, 164, 211, 0.1); }
.assistant-mic-btn svg { width: 18px; height: 18px; }

.assistant-attach-wrapper { position: relative; display: flex; align-items: center; }
.assistant-attach-btn { width: 38px; height: 38px; border-radius: 50%; background: transparent; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #5f6368; transition: 0.2s; box-shadow: none !important; }
.assistant-attach-btn:hover { background: rgba(2, 164, 211, 0.1); }
.assistant-attach-btn svg { width: 18px; height: 18px; }

.assistant-attach-dropdown {
  position: absolute;
  bottom: 50px;
  left: 0;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 150px;
  z-index: 100;
  display: none;
  overflow: hidden;
  animation: fadeInUp 0.2s ease;
}

.assistant-attach-dropdown.show { display: block; }

.assistant-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
  color: #202124;
}

.assistant-attach-item:hover { background: #f1f3f4; }
.assistant-attach-item svg { width: 18px; height: 18px; }

.assistant-quick-questions {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border-top: none;
}

.assistant-quick-question-item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assistant-quick-question-item:hover { opacity: 0.8; }
.assistant-quick-question-text {
  font-size: 15px;
  color: #5f6368;
  padding: 12px 8px 10px 8px;
  font-weight: 500;
  line-height: 1.5;
}

.assistant-quick-question-divider {
  height: 1px;
  background: linear-gradient(90deg, #e8eaed 0%, #e8eaed 85%, transparent 100%);
  margin: 0 8px;
}

.assistant-image-thumb {
  max-width: 180px;
  max-height: 180px;
  border-radius: 12px;
  cursor: pointer;
  object-fit: cover;
}

.assistant-file-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
}

.assistant-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
}

.assistant-msg.sent {
  align-self: flex-end;
  background: #02A4D3;
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-msg.received {
  align-self: flex-start;
  background: #f1f3f4;
  color: #202124;
  border-bottom-left-radius: 4px;
}

.assistant-msg-time {
  font-size: 9px;
  opacity: 0.7;
  margin-top: 3px;
  text-align: left;
  font-family: 'Vazirmatn', monospace;
  direction: ltr;
}

.assistant-msg audio {
  width: 200px;
  height: 38px;
  border-radius: 30px;
}

.assistant-msg video {
  max-width: 200px;
  border-radius: 12px;
}

/* ========== اصلاح ایکون دکمه بازگشت ========== */
.back-btn svg,
.search-back-btn svg,
.magazine-search-back-btn svg,
.chats-search-back-btn svg,
#back-from-detail svg,
#back-from-chat svg,
#back-from-news svg,
#back-from-category svg,
#back-from-payment svg {
  transform: scaleX(-1);
}

/* ========== استایل‌های PWA ========== */

/* انیمیشن برای بنر نصب */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* انیمیشن پالس برای دکمه میکروفن در حالت ضبط */
@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* استایل برای splash screen (اختیاری) */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #02A4D3 0%, #0288b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.splash-screen.hide {
  opacity: 0;
  pointer-events: none;
}

.splash-screen .splash-content {
  text-align: center;
  color: white;
}

.splash-screen .splash-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  animation: bounce 0.8s ease;
}

.splash-screen .splash-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.splash-screen .splash-subtitle {
  font-size: 14px;
  opacity: 0.8;
}

@keyframes bounce {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* استایل برای زمانی که برنامه به صورت standalone اجرا می‌شود */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  
  .detail-floating-install,
  .chat-detail-input-bar,
  .pay-bottom-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* استایل برای حالت آفلاین */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ea4335;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-indicator.show {
  transform: translateY(0);
}

/* بهبود اسکرول در صفحات */
* {
  -webkit-tap-highlight-color: transparent;
}

/* استایل برای toast پیام */
.toast-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #202124;
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  z-index: 1000;
  white-space: nowrap;
  animation: fadeInUp 0.3s ease;
}

@media (max-width: 500px) {
  .toast-message {
    white-space: normal;
    text-align: center;
    max-width: 90%;
  }
}