/* استایل اصلی استوری */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #1E90FF, #6A5ACD);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  color: #333;
  padding: 10px;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  padding: 20px;
  width: 100%;
  max-width: 1200px;
}

.header {
  text-align: center;
  margin-bottom: 10px;
  width: 100%;
}

.header h1 {
  font-size: 1.8rem;
  color: #262626;
  margin-bottom: 5px;
}

.header p {
  color: #8e8e8e;
  font-size: 0.9rem;
}

.stories-container {
  display: flex;
  justify-content: center;
  padding: 10px;
  width: 100%;
}

.story-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
}

.story-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(#fdf497, #fd5949, #d6249f, #285AEB, #fdf497);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  animation: spin 8s linear infinite;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.story-ring:hover {
  transform: scale(1.05);
}

.story-ring.seen {
  background: #dbdbdb;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile-pic {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: url('/favicon.ico') center/cover;
  border: 3px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-viewer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1000;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.story-viewer.active {
  display: flex;
}

.story-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 750px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.story-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  z-index: 20;
}

.story-profile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.story-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.story-username {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.story-time {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

.story-close {
  margin-right: auto;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  user-select: none;
  padding: 5px;
}

.story-progress {
  display: flex;
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  gap: 4px;
  z-index: 21;
}

.progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: white;
  transition: width 0.1s linear;
}

.story-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  cursor: pointer;
  z-index: 15;
}

.story-nav.prev {
  left: 0;
}

.story-nav.next {
  right: 0;
}

.story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* استایل جدید برای استوری متنی */
.story-text-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background: #000000;
  color: #FFFFFF;
  text-align: center;
  font-family: 'Vazirmatn', 'Segoe UI', Roboto, Arial, sans-serif;
}

.story-quote {
  font-size: 2rem;
  line-height: 1.6;
  font-weight: 300;
  max-width: 800px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.8s ease-out;
}

.story-day-indicator {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 25;
}

.story-time-progress {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  z-index: 25;
}

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

.story-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 20;
  padding: 0 20px;
}

.control-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.comment-sticker-panel {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 15px;
  z-index: 35;
  width: 90%;
  max-width: 400px;
  display: none;
}

.comment-sticker-panel.active {
  display: flex;
}

.comment-section {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 20px;
  padding: 10px 15px;
  color: white;
  font-size: 0.9rem;
  outline: none;
}

.comment-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.send-comment-btn {
  background: #0095f6;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 600;
}

.sticker-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sticker {
  font-size: 1.8rem;
  text-align: center;
  cursor: pointer;
  padding: 5px;
  border-radius: 8px;
  transition: background 0.2s;
}

.sticker:hover {
  background: rgba(255, 255, 255, 0.1);
}

.share-link-container {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 12px 15px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90%;
  display: none;
}

.share-link-container.active {
  display: flex;
}

.share-link {
  color: white;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.copy-link-btn {
  background: #0095f6;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* تنظیمات ریسپانسیو برای متن */
@media (max-width: 768px) {
  .story-quote {
    font-size: 1.5rem;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .story-quote {
    font-size: 1.3rem;
    padding: 0 15px;
  }
  
  .story-day-indicator {
    top: 70px;
    font-size: 0.8rem;
  }
  
  .story-time-progress {
    bottom: 80px;
    font-size: 0.7rem;
  }
}

/* Responsive design improvements */
@media (max-width: 500px) {
  .story-ring {
    width: 70px;
    height: 70px;
  }
  
  .profile-pic {
    width: 64px;
    height: 64px;
  }
  
  .story-content {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .control-btn {
    width: 40px;
    height: 40px;
  }
  
  .sticker-section {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .container {
    padding: 10px;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 280px) {
  .story-ring {
    width: 60px;
    height: 60px;
  }
  
  .profile-pic {
    width: 54px;
    height: 54px;
  }
  
  .story-username {
    font-size: 0.7rem;
    max-width: 60px;
  }
  
  .header h1 {
    font-size: 1.3rem;
  }
  
  .header p {
    font-size: 0.8rem;
  }
  
  .sticker-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Animation improvements */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.story-image {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

/* استایل جدید برای نوتیفیکیشن */
.sms-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s forwards;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    max-width: 90%;
    text-align: center;
}

.sms-notification.info {
    background: rgba(33, 150, 243, 0.9);
}

.sms-notification.success {
    background: rgba(76, 175, 80, 0.9);
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* Loading indicator */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2rem;
  z-index: 10;
}

/* Direct link styling */
.direct-link-notice {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  text-align: center;
  padding: 10px;
  z-index: 1001;
  display: none;
}

.direct-link-notice.active {
  display: block;
}

/* Mobile-specific styles */
.mobile-message {
  display: none;
  text-align: center;
  padding: 15px;
  background: #ffecb3;
  border-radius: 8px;
  margin-top: 20px;
  color: #7d6608;
}

@media (max-width: 768px) {
  .mobile-message {
    display: block;
  }
}
