@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn");
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  direction: rtl;
  font-family: var(--font-family-base);
  background-color: var(--bg);
  color: var(--text-base);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-family-title);
  margin: 0;
  font-weight: 700;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: var(--text-base);
  background: var(--surface-2);
  border: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hidden { display: none !important; }

.text-secondary { color: var(--text-secondary); }


.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--priority-medium), var(--priority-low));
  color: white;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  max-width: calc(100% - 30px);
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.install-prompt-text {
  flex: 1;
  min-width: 0;
}

.install-prompt-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.install-prompt-desc {
  font-size: 13px;
  opacity: 0.9;
}

.install-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: Vazirmatn, sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.install-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.close-install {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.close-install:hover {
  opacity: 1;
}

/* Update Notification Styles */
.hidden {
    display: none !important;
}

.update-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  z-index: 1000;
  width: min(500px, calc(100% - 32px));
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.update-notification.hidden {
  display: block;
}

.update-content {
  background: linear-gradient(135deg, var(--accent) 0%, #9b7fff 100%);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow:
    0 12px 40px rgba(124, 92, 255, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  color: white;
}

.update-icon {
  font-size: 32px;
  flex-shrink: 0;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.update-text {
  flex: 1;
}

.update-text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.update-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.4;
}

.update-button {
  background: white;
  color: var(--accent);
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: "Vazirmatn", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.update-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.update-button:active {
  transform: scale(0.98);
}

.dismiss-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.dismiss-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .update-content {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .update-icon {
    font-size: 48px;
  }

  .update-button {
    width: 100%;
  }

  .dismiss-button {
    top: 12px;
    right: 12px;
  }
}

.update-banner {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-banner.show {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}
