/* ================= Base CSS برای همه پلتفرم‌ها ================= */
* { margin:0; padding:0; box-sizing:border-box; font-family:Tahoma,sans-serif; }

body {
  background-color:#f0f2f5;
  color:#333;
  display:flex;
  justify-content:center;
  padding:20px;
}

.container {
  width:95%;
  max-width:1000px;
  background-color:#fff;
  padding:25px 30px;
  border-radius:15px;
  box-shadow:0 5px 25px rgba(0,0,0,0.1);
}

/* Header */
header { text-align:center; margin-bottom:20px; }
header h1 { font-size:28px; color:#2c3e50; margin-bottom:5px; }
#app-info { font-size:14px; color:#555; margin-bottom:10px; }
.info-text { text-align:justify; direction:rtl; background:#f9f9f9; padding:12px 15px; border-radius:10px; margin-bottom:15px; font-size:14px; color:#333; }
#stats { font-size:14px; color:#555; margin-top:5px; }

/* Search bar */
#search-input {
  text-align: center;
  width:100%;
  padding:12px 15px;
  margin-bottom:15px;
  border:1px solid #ffffff;
  border-radius:12px;
  font-size:16px;
  outline:none;
  background-color:#e6e6e6;
  color:#333;
  transition:all 0.3s;
}
#search-input:focus {
  border-color:#357abd;
  background-color:#ffffff;
  box-shadow:0 0 8px rgba(74,144,226,0.3);
}

/* Filters */
.filters {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:space-between;
  direction:rtl;
  margin-bottom:20px;
}
.filter-box { display:flex; flex-direction:column; flex:1; min-width:120px; }
.filter-box label { font-size:12px; margin-bottom:2px; }
.filters select {
  padding:8px 12px;
  border-radius:10px;
  border:1px solid #ccc;
  outline:none;
  font-size:14px;
  transition:all 0.3s;
}
.filters select:focus { border-color:#4a90e2; box-shadow:0 0 8px rgba(74,144,226,0.3); }

/* Music Items */
#music-container { display:flex; flex-direction:column; gap:10px; }
.music-item { display:flex; justify-content:space-between; align-items:center; background:#f9f9f9; padding:10px 15px; border-radius:12px; transition:all 0.2s; min-height:60px; }
.music-item:hover { background-color:#e1f0ff; }
.music-left { text-align:left; flex:1; }
.music-name { font-weight:500; word-break:break-word; }
.music-info { font-size:12px; color:#666; text-align:left; display:flex; flex-direction:column; gap:2px; width:200px; }
.download-link { text-decoration:none; color:#fff; background-color:#4a90e2; padding:8px 15px; border-radius:8px; transition:background 0.3s; text-align:center; display:inline-block; }
.download-link:hover { background-color:#357abd; }

/* Language */
.lang-fa { color:#2e7d32; font-weight:500; }
.lang-en { color:#1565c0; font-weight:500; }
.lang-unknown { color:#777; font-style:italic; }

/* Type */
.type-book { color:#d32f2f; font-weight:500; }
.type-piece { color:#2e7d32; font-weight:500; }
.type-unknown { color:#777; font-style:italic; }

/* Suggestions / No Results */
#suggestions { margin-top:20px; font-size:14px; color:#555; min-height:30px; display:flex; flex-direction:column; gap:10px; }
.no-result {
    direction: rtl;
  text-align:center;
  padding:20px;
  background:#ffe0e0;
  color:#d32f2f;
  border-radius:12px;
  font-weight:bold;
  font-size:16px;
}

/* Responsive */
@media(max-width:768px){
  body { padding:0; }
  .container { width:100%; max-width:none; border-radius:0; box-shadow:none; }
  .filters { flex-direction:column; }
  .filter-box { min-width:auto; }
  .music-info { width:100%; }
}

.download-link img, #back-to-top img {
    padding: 2px;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  filter: brightness(0) invert(1);
}

.download-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  background-color:#4a90e2;
  padding:8px 12px;
  border-radius:8px;
  transition:background 0.3s;
}

.download-link:hover { background-color:#357abd; }

/* دکمه بالا رفتن */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width:50px;
  height:50px;
  border-radius:50%;
  border:none;
  background-color:#4a90e2;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
  display:none;
  align-items:center;
  justify-content:center;
  transition:background 0.3s, transform 0.3s;
}
#back-to-top:hover { background-color:#357abd; transform:scale(1.1); }

/* ================= iOS Specific Fixes ================= */
@supports (-webkit-touch-callout: none) {
  input, select, textarea, button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: Tahoma, sans-serif;
    font-size:16px;
    line-height:1.3;
  }

  /* body و container iOS */
  html, body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* select و input padding مخصوص iOS */
  #search-input, .filters select, button {
    padding: 10px 12px;
  }

  /* دکمه Back-to-top */
  #back-to-top {
    display:flex;
    width:60px;
    height:60px;
  }

}
/* ================== Font Face ================== */
@font-face {
  font-family: 'Kalameh';
  src: url('Kalameh-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Kalameh';
  src: url('Kalameh-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ================== Global ================== */
* { 
  margin:0; 
  padding:0; 
  box-sizing:border-box; 
  font-family:'Kalameh', Tahoma, sans-serif; 
}
