/* Reset و Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
} 

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: "Noto Sans Arabic", "Noto Sans", sans-serif;
  font-size: 16px;
  margin: 0;
  background: url(https://s34.picofile.com/file/8487031518/bg_balter.png) no-repeat center center fixed;
  background-size: cover;
  padding: 20px;
  color: #333;
  line-height: 1.6;
  flex-direction: column;
  text-align: center;
  overflow-x: hidden;
}
/* تصویر بک‌گراند برای موبایل بهینه‌تر */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
    background-size: cover;
    background-position: center;
    padding: 10px;
    min-height: 100dvh; /* برای موبایل بهتر است */
  }
}

/* پنجره اصلی */
.window {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  width: min(100%, 700px);
  max-width: 700px;
  padding: 30px 20px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .window {
    padding: 20px 15px;
    margin: 10px auto;
    width: calc(100% - 20px);
    border-radius: 15px;
  }
}

/* عنوان */
h1 {
  color: #2c3e50;
  font-size: 2.2rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #ced5dc;
  width: 100%;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
}

/* Loading State */
.giscus-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 250px;
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  animation: fadeIn 0.5s ease;
}

@media (max-width: 768px) {
  .giscus-loading {
    min-height: 200px;
    margin: 20px 0;
  }
}

.loading-pulse {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db, #2ecc71);
  animation: pulse 1.5s infinite ease-in-out;
  margin-bottom: 20px;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.giscus-loading p {
  color: #555;
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 10px;
}

/* Container اصلی giscus */
.giscus {
  width: 100%;
  min-height: 300px;
  margin-top: 20px;
  position: relative;
}

/* اگر iframe مشکل height دارد */
.giscus iframe {
  width: 100% !important;
  min-height: 400px !important;
  border: none !important;
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .giscus {
    margin-top: 15px;
    min-height: 250px;
  }
  
  .giscus iframe {
    min-height: 350px !important;
  }
}

/* استایل‌های عمومی */
p {  
  color: #2c3e50;
  padding: 0 10px;
  font-size: 1rem;
  margin: 10px 0;
  font-weight: 500;
  line-height: 1.8;
}

a {
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  color: #3498db;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

::selection {
  background-color: rgba(52, 152, 219, 0.3);
  color: #2c3e50;
}


/* New */

h3 {
    text-align: right;
    color: #3498db;
    border-right: 4px solid #3498db;
    margin-bottom: 5px;
    padding: 0px 7px;
}

div#giscus-container{
  width:100%;
      margin-top: 20px;
}

.cmnthelp {
  height: 110px;
    overflow: overlay;
    border: 1px solid #3498db;
  border-radius: 5px;
  margin-top: 20px;
}

.cmnthelp::-webkit-scrollbar {
  display: none; 
}
p.cmnthelp_text {
    font-size: small;
    color: #c5c5c5;
}

/* Loading State Styles */
    .loading-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 200px;
      padding: 30px 20px;
      background: rgba(255, 255, 255, 0.9);
      border-radius: 12px;
      margin: 20px 0;
      border: 2px dashed #e0e0e0;
      transition: opacity 0.3s ease;
    }
    
    .spinner {
      width: 50px;
      height: 50px;
      border: 3px solid #f3f3f3;
      border-top: 3px solid #3498db;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 20px;
    }
    
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    .loading-text {
      color: #555;
      font-size: 16px;
      margin-bottom: 15px;
      font-weight: 500;
    }
    
    .load-btn {
      background: linear-gradient(135deg, #3498db, #2980b9);
      color: white;
      border: none;
      padding: 10px 25px;
      border-radius: 25px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
    
    .load-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    }



/* بهبود performance برای موبایل */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  .window {
    -webkit-overflow-scrolling: touch;
  }
  .loading-state {
        min-height: 150px;
        padding: 20px 15px;
        margin: 15px 0;
      }
  .spinner {
        width: 40px;
        height: 40px;
      }
      
      .loading-text {
        font-size: 14px;
      }
      
      .load-btn {
        padding: 8px 20px;
        font-size: 13px;
      }
}

/* برای تبلت */
@media (min-width: 769px) and (max-width: 1024px) {
  .window {
    width: 85%;
    max-width: 600px;
  }
  
  h1 {
    font-size: 2rem;
  }
}

/* برای موبایل عمودی */
@media (max-width: 480px) and (orientation: portrait) {
  body {
    padding: 5px;
  }
  
  .window {
    padding: 15px 10px;
    width: calc(100% - 10px);
  }
  
  .giscus iframe {
    min-height: 300px !important;
  }
  .loading-state {
        min-height: 120px;
        padding: 15px 10px;
      }
      
      .spinner {
        width: 35px;
        height: 35px;
      }
}

/* برای موبایل افقی */
@media (max-width: 900px) and (orientation: landscape) {
  body {
    padding: 10px;
  }
  
  .window {
    width: 95%;
    max-width: 800px;
  }
  
  .giscus iframe {
    min-height: 250px !important;
  }
}

/* دسکتاپ بزرگ */
@media (min-width: 1200px) {
  .window {
    max-width: 800px;
    padding: 40px 30px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  .loading-state {
        min-height: 180px;
      }
}

