@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir Bold';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

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

@font-face {
    font-family: 'Noorehira';
    src: url('Noorehira_p30download.com.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

.taksir-modal-title {
  font-size: 19px !important;
}
@media (max-width: 576px) {
  .taksir-modal-title {
    font-size: 17px !important;
  }
}

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

:root {
    /* رنگ‌ها */
    --primary-color: #115e30;     /* سبز تیره اسلامی */
    --secondary-color: #d4af37;   /* طلایی */
    --accent-color: #174c2c;      /* سبز تیره‌تر */
    --light-color: #f1f7ed;       /* سبز بسیار روشن */
    --dark-color: #072110;        /* سبز خیلی تیره */
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f9e076 50%, #d4af37 100%);
    --green-gradient: linear-gradient(135deg, #115e30 0%, #174c2c 100%);
    
    /* اندازه‌های ریسپانسیو */

/* استایل باکس اطلاع‌رسانی فال حافظ (شبیه ستاره ازدواج) */
.info-box.marriage-info {
    background-color: #eef7ff; /* رنگ پس‌زمینه آبی بسیار روشن */
    border: 1px solid #b3d4fc; /* حاشیه آبی روشن */
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px; /* حداکثر عرض باکس */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center; /* تغییر از justify به center برای وسط‌چین کردن متن */
    font-size: 0.95rem;
    line-height: 1.7;
    color: #335b8a; /* رنگ متن آبی تیره‌تر */
}
.info-box.marriage-info p {
    margin-bottom: 10px;
}
.info-box.marriage-info p:last-child {
    margin-bottom: 0;
}
.info-box.marriage-info strong {
    color: #1a3a5c; /* رنگ متن قوی‌تر */
}
@media (max-width: 768px) {
    .info-box.marriage-info {
        margin: 15px 10px;
        padding: 15px;
        font-size: 13px; /* تغییر به 13 پیکسل برای موبایل */
        text-align: center; /* تغییر به وسط‌چین در موبایل */
    }
}

    --container-padding: clamp(10px, 3vw, 25px);
    --section-spacing: clamp(15px, 4vw, 30px);
    --card-padding: clamp(10px, 2vw, 20px);
    --border-radius: clamp(8px, 1vw, 15px);
    
    /* تایپوگرافی ریسپانسیو */
    --title-size: clamp(1.2rem, 5vw, 3rem);
    --subtitle-size: clamp(0.9rem, 3vw, 1.5rem);
    --body-size: clamp(0.8rem, 2vw, 1rem);
    --small-size: clamp(0.7rem, 1.5vw, 0.9rem);
    
    /* فاصله‌گذاری */
    --content-width: min(95%, 900px);
    --element-gap: clamp(5px, 1.5vw, 15px);
}

body {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-image: url('background.jpg');
    background-size: 300px;
    background-repeat: repeat;
    background-position: center center;
    background-attachment: fixed;
    background-color: var(--primary-color);
    padding-top: 40px; /* فاصله برای هدر طلایی */
}

.golden-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px; /* ارتفاع پیش‌فرض برای موبایل */
    background: linear-gradient(135deg, #d4af37 0%, #f9e076 50%, #d4af37 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.5);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    margin: 0 10px;
    width: calc(100% - 20px);
    padding: 0 30px;
    text-align: center;
    transition: height 0.3s ease;
}

.golden-header p {
    color: #5a4a00;
    font-weight: bold;
    margin: 0;
    font-size: 0.9rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    display: inline-block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: font-size 0.3s ease;
}

.tools-wrapper {
    position: absolute;
    left: calc(50% + 90px);
    z-index: 1001;
}

.tools-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: #5a4a00;
    padding: 5px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Vazir', Tahoma, sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: none;
    outline: none;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    height: 42px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.submit-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Marquee Bar Styling */
.moving-text-bar {
  padding: 24px 0;
  transition: padding 0.3s ease;
}

@media (max-width: 768px) {
  .moving-text-bar {
    padding: 16px 0; /* ارتفاع کمتر در موبایل */
    top: 45%; /* کمی بالاتر در موبایل */
    transform: translateY(-50%);
  }
}

/* Chat Send Button: ثابت و بدون پرش */
.chat-send-btn {
  position: absolute !important;
  left: 24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg,#f5d76e,#d4af37) !important;
  color: #5c3d0e !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(212,175,55,0.12) !important;
  font-size: 1.15rem !important;
  z-index: 2 !important;
  cursor: pointer !important;
  transition: background 0.22s, color 0.22s !important;
}
.chat-send-btn:hover,
.chat-send-btn:focus {
  position: absolute !important;
  left: 24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg,#f5d76e,#d4af37) !important;
  color: #5c3d0e !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(212,175,55,0.12) !important;
  font-size: 1.15rem !important;
  z-index: 2 !important;
  cursor: pointer !important;
  outline: none !important;
  /* هیچ تغییری در سایز، موقعیت، شادو یا ترنزیشن */
}

/* Dynamic Text Fields Styling */
#multiTextContainer {
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: var(--border-radius);
  background-color: #fcfcfc;
  margin-top: 15px;
}

.dynamic-field-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dynamic-field {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: 'Vazir', sans-serif;
  font-size: 1rem;
  background-color: white;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.dynamic-field:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  outline: none;
}

.remove-field-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 30px;
  text-align: center;
  flex-shrink: 0;
  transition: background-color 0.2s, transform 0.2s;
}

.remove-field-btn:hover {
  background-color: #c0392b;
  transform: scale(1.1);
}

/* Separator Image Styling */
.separator-image {
  height: 1em; /* Match the approximate height of the text */
  vertical-align: middle; /* Align nicely with the text */
  margin: 0 0.5em; /* Add some space around the image */
  border-radius: 3px;
}

/* Image Gallery Styling */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  background-color: #f9f9f9;
}

.gallery-image {
  width: 100px;
  height: 100px;
  object-fit: contain; /* Show the whole image without cropping */
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 5px;
  padding: 3px;
  background-color: white;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.gallery-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gallery-image.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.tools-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.tools-wrapper:hover .tools-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #5a4a00;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    gap: 8px;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: #d4af37;
}

.dropdown-item:hover {
    background-color: #f9f5e3;
    color: #3a2e00;
}

.dropdown-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.tools-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.tools-btn i {
    font-size: 0.9em;
}

.container {
    max-width: var(--content-width);
    margin: clamp(10px, 4vh, 30px) auto;
    padding: var(--container-padding);
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--secondary-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gold-gradient);
}

/* Star decorations */
.star-decoration {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0.2;
    z-index: -1;
}

.container::after {
    content: "";
    position: absolute;
    top: 50px;
    right: 30px;
    width: 150px;
    height: 150px;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Octagram.svg/1200px-Octagram.svg.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.05;
    z-index: -1;
}

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
}

header::before {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: var(--gold-gradient);
}

header h1 {
    color: var(--primary-color);
    font-family: 'Vazir Bold', Tahoma, Arial, sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
}

.nastaliq-title {
    font-family: 'IranNastaliq', 'Vazir', Tahoma, sans-serif !important;
    font-size: 3.5rem;
    line-height: 1.8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    padding-top: 15px;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
}

.title-text {
    text-align: center;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.title-icon-container {
    position: absolute;
    top: 7px;
    z-index: 2;
}

.right-icon {
    right: 10px;
}

.left-icon {
    left: 10px;
}

.title-icon {
    height: 170px;
    width: 170px;
    display: block;
    object-fit: contain;
}

header h1 i {
    color: var(--secondary-color);
    margin-right: 10px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

header p {
    color: var(--accent-color);
    font-size: 1.1rem;
    position: relative;
}

.hadith {
    padding: 10px 15px;
    margin: 10px 0;
    text-align: center;
    font-family: 'Noorehira', 'Vazir', Tahoma, sans-serif;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    color: var(--dark-color);
    font-size: 1.15rem;
}

.narrator {
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 5px;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.tab-btn {
    padding: 12px 25px;
    background-color: rgba(17, 94, 48, 0.1);
    color: var(--primary-color);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    font-size: 14px !important;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    background-color: rgba(17, 94, 48, 0.2);
    border-color: var(--secondary-color);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(17, 94, 48, 0.3);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s;
}

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

.tab-content.active {
    display: block;
}

.input-section {
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--primary-color);
}

.calculation-label {
    font-weight: bold;
    color: var(--primary-color);
    padding-left: 10px;
}

.input-section label::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.input-field {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.input-field:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.input-section textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
    background-color: white;
}

.form-group {
    margin-bottom: 15px;
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.form-group:last-child {
    flex: 0 0 auto;
    align-self: flex-end;
}

.gender-group {
    min-width: 150px;
}

.gender-options {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.gender-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 15px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.gender-option:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.gender-option input[type="radio"] {
    margin-left: 8px;
    accent-color: var(--accent-color);
}

.gender-label {
    font-weight: bold;
    color: var(--primary-color);
}

.letters-stats h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

.letters-stats h3::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
    border-radius: 2px;
}

.stats-box {
    flex: 1;
    background-color: rgba(241, 247, 237, 0.7);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    direction: rtl;
}

.charCell {
    padding: 10px 15px;
    background-color: white;
    border-radius: 6px;
    font-size: 13px !important;
    font-weight: bold !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.charCell:hover {
    background-color: rgba(17, 94, 48, 0.1);
    border-color: var(--secondary-color);
}

.background-red {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--secondary-color);
}

.highlight {
    color: var(--secondary-color);
    background-color: rgba(17, 94, 48, 0.1);
    padding: 0 3px;
    border-radius: 3px;
    font-weight: bold;
}

.info-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(241, 247, 237, 0.7);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
}

.info-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green-gradient);
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.info-section h3::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
    border-radius: 2px;
}

.info-section::after {
    content: "";
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Eight-pointed_star_with_circle.svg/1200px-Eight-pointed_star_with_circle.svg.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.07;
    z-index: -1;
}

.abjad-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.abjad-row {
    display: contents;
}

.abjad-cell {
    background-color: white;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.abjad-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

/* باکس نتیجه مدرن و زیبا */
.modern-result-box {
  box-shadow: 0 4px 24px 0 rgba(224, 183, 86, 0.28), 0 2px 12px #e0b75655 !important;
  background: #fff;

  background: var(--gold-gradient);
  color: #333;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(17, 94, 48, 0.13), 0 0 0 2px #d4af37;
  padding: 28px 22px;
  margin: 30px auto;
  max-width: 500px;
  font-size: 1.15rem;
  font-family: 'Vazir', Tahoma, Arial, sans-serif;
  text-align: center;
  position: relative;
  transition: box-shadow 0.3s, transform 0.3s;
  border: none;
}
.fancy-result-box::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  border-radius: 6px;
  background: var(--green-gradient);
  opacity: 0.7;
}
.fancy-result-box:hover {
  box-shadow: 0 12px 32px rgba(17, 94, 48, 0.18), 0 0 0 3px #d4af37;
  transform: translateY(-3px) scale(1.02);
}

/* تنظیمات موبایل */
@media (max-width: 480px) {
    .result-box, .details-box {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 8px !important;
        height: 120px !important;
    }
    .result-value, .calculation-details {
        height: 60px !important;
    }
    
    .hint {
    font-size: 14px !important;
  }
}

@media (max-width: 576px) {
    .result-box, .details-box {
        width: 100% !important;
        margin-bottom: 12px !important;
        padding: 12px !important;
        height: 130px !important;
    }
    .result-value, .calculation-details {
        height: 70px !important;
    }
}

@media (max-width: 768px) {
    .result-section {
        flex-direction: column;
    }
    .result-box, .details-box {
        width: 100%;
        margin-bottom: 15px;
        padding: 15px;
        height: 150px;
    }
    .result-value, .calculation-details {
        height: 90px;
    }
}

.abjad-cell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: var(--primary-color);
    opacity: 0.5;
}

footer {
    margin-top: 40px;
    text-align: center;
    padding: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--dark-color);
    font-size: 16px !important;
    font-family: 'Titr_Plus_Bold_Line', Tahoma, Arial, sans-serif !important;
    color: #27ae60 !important; /* سبز روشن */
}

/* دکمه شناور پیام */
.floating-message-btn {
    position: fixed;
    bottom: 30px;
    left: calc(50% - 480px);
    width: 60px;
    height: 60px;
    background-color: #185b2c;
    color: #ebce5e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-message-btn i {
    font-size: 28px;
}

.floating-message-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* تنظیمات رسپانسیو */
@media (max-width: 1000px) {
    .floating-message-btn {
        left: 30px;
    }
}

@media (max-width: 768px) {
    .floating-message-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        left: 20px;
    }
    
    .floating-message-btn i {
        font-size: 22px !important;
    }
}

@media (max-width: 480px) {
    .floating-message-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        left: 15px;
    }
    
    .floating-message-btn i {
        font-size: 20px !important;
    }
}

footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: var(--gold-gradient);
}

footer i {
    color: var(--secondary-color);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

/* استایل‌های صفحه بررسی طالع و طبع */
.nature-result {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nature-details {
    margin-top: 10px;
}

.letters-display {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin: 20px 0;
    direction: rtl;
}

.letter-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
}

.letter-space {
    width: 20px;
}

.nature-chart {
    margin: 20px 0;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.bar-label {
    width: 60px;
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
}

.bar-container {
    flex: 1;
    height: 25px;
    background-color: rgba(240, 240, 240, 0.5);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 1s ease-in-out;
}

.bar-percent {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    color: #333;
}

.dominant-nature {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dominant-nature:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    align-items: stretch;
    justify-content: flex-start;
}

.result-section:last-child {
    border-bottom: none;
}

.combined-result {
    background-color: rgba(250, 250, 250, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.abjad-calculation {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.abjad-calculation:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
    transition: background-color 0.3s ease;
}

.calculation-row:hover {
    background-color: rgba(212, 175, 55, 0.05);
}

.calculation-row:last-child {
    border-bottom: none;
}

.calculation-label {
    flex: 3;
}

.calculation-value {
    flex: 1;
    text-align: center;
    font-weight: bold;
    color: #d4af37;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 10px;
    border-radius: 4px;
    min-width: 50px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.error {
    color: #d9534f;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Responsive styles */
@media (min-width: 992px) {
  body#index-page .result-value {
    font-size: 45px !important;
  }
  body#index-page .calculation-details {
    font-size: 18px !important;
  }
}

@media (min-width: 992px) {
    /* تنظیمات هدر برای نسخه دسکتاپ */
    .golden-header {
        height: 50px;
    }
    
    .golden-header p {
        font-size: 1.1rem;
    }
    
    .tools-btn {
        font-size: 0.9rem;
        padding: 6px 18px;
        left: calc(50% + 100px);
    }
    
    .tools-btn i {
        font-size: 1em;
    }
    
    .tools-dropdown .dropdown-item img {
        width: 48px !important;
        height: 48px !important;
    }
    
    .result-value {
        font-size: 45px !important;
    }
    .calculation-details {
        font-size: 25px !important;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 15px auto;
        padding: 15px;
        max-width: 95%;
    }
    
    /* تنظیم موقعیت گیف شناور برای موبایل */
    img[src*="_babol2011_blogfa_com_5.gif"],
    img[alt="float-gif"],
    .float-gif-mobile {
        top: 13px !important;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .hadith {
        font-size: 0.9rem;
    }
    
    .hadith-text {
        font-size: 1.1rem;
    }
    
    .hadith-source {
        font-size: 0.8rem;
    }
    
    .tools-icon {
        font-size: 1.2rem;
    }
    
    .tools-dropdown {
        width: 250px;
    }
    
    .input-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group:last-child {
        align-self: center;
    }
    
    .submit-btn {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 0;
        margin-bottom: 20px;
        position: relative;
    }
    
    .title-text {
        width: 100%;
        padding: 0 40px;
    }
    
    .nastaliq-title {
        font-size: 4.8rem;
        line-height: 1.3;
        padding-top: 39px;
        padding-bottom: 5px;
    }
    
    .title-icon-container {
        position: absolute;
        top: 10px;
    }
    
    .title-icon {
        height: 120px;
        width: 120px;
    }
    
    .right-icon {
        right: 10px;
    }
    
    .left-icon {
        left: 10px;
    }
    
    .hadith {
        padding: 8px 10px;
        font-size: 0.9rem;
        margin: 0 auto;
        max-width: 90%;
    }
    
    .tabs {
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .result-section {
        flex-direction: column;
    }
    
    .result-box, .details-box {
        margin-bottom: 15px;
        padding: 15px;
        width: 100%;
    }
    
    .abjad-table {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-section {
        margin-bottom: 15px;
    }
    
    .input-section textarea {
        height: 120px;
    }
    
    .stats-container {
        padding: 15px;
    }
    
    .charCell {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .highlighted-text {
        font-size: 1rem;
        min-height: 40px;
    }
}

@media (max-width: 576px) {
    body {
        background-size: 250px;
    }
    
    .container {
        margin: 10px auto;
        border-radius: 12px;
    }
    
    .title-icon-container {
        top: 15px;
    }
    
    .title-icon {
        height: 100px;
        width: 100px;
    }
    
    .nastaliq-title {
        font-size: 4.5rem;
        padding: 24px 0 5px;
        line-height: 1.3;
    }
    
    .hadith {
        line-height: 1.7;
        font-size: 0.85rem;
    }
    
    .narrator {
        font-size: 0.8rem;
    }
    
    .input-section label {
        font-size: 0.9rem;
    }
    
    .input-section textarea {
        font-size: 0.9rem;
    }
    
    .tab-btn {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
    
    /* تنظیم فونت اعداد نتایج (مثل 379، 214، 593) */
    .calculation-value,
    .result-value,
    [class*="calculation-"] span,
    .calculation-row span,
    .abjad-calculation span,
    .abjad-cell span {
        font-size: 14px !important;
        font-weight: bold;
    }
    
    /* تنظیم فونت عنصر نتیجه (مثل "آبی") */
    .zodiac-summary-box span span,
    [style*="font-weight: bold; color:"][style*="font-size: 1.1em"],
    .result-content span[style*="color"][style*="font-weight: bold"],
    .zodiac-summary-box [style*="color"][style*="font-weight: bold"] {
        font-size: 14px !important;
    }
    
    /* تنظیم فونت دکمه به 14px */
    .submit-btn {
        font-size: 14px !important;
    }
    
    /* تنظیم اندازه فونت متون نتایج محاسبه به 12px */
    .result-section p:not(.result-content p),
    .info-section p:not(.result-content p),
    .calculation-details,
    .nature-details {
        font-size: 12px !important;
    }
    
    .dominant-nature,
    .nature-result {
        font-size: 14px !important;
    }
    
    /* عنوان نتایج و برچسب‌های نتایج به 14px */
    .zodiac-summary-box span,
    .result-value,
    .calculation-label,
    .info-section h3,
    .result-section h3,
    .nature-result h3,
    .dominant-nature h3,
    .calculation-row .calculation-label strong,
    .result-box h3, 
    .details-box h3, 
    .letters-stats h3 {
        font-size: 14px !important;
    }
    
    /* مقادیر برجسته (مثل "آبی" در "طبع عنصری شما: آبی") */
    .zodiac-summary-box span span {
        display: inline;
        font-size: 14px !important;
        font-weight: bold;
    }
    
    /* کوچک کردن متون در کادر خلاصه نتایج */
    .zodiac-summary-box {
        font-size: 12px !important;
        padding: 12px !important;
    }
    
    /* استایل‌های قبلی */
    .gender-options {
        gap: 8px;
    }
    
    .gender-option {
        padding: 4px 10px;
        border-radius: 6px;
    }
    
    .gender-label {
        font-size: 0.85rem;
    }
    
    /* تغییر چیدمان برای موبایل: نام و نام مادر کنار هم، جنسیت پایین */
    [style*="display: flex; justify-content: center; align-items: flex-start;"] {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
    }
    
    /* نام و نام مادر کنار هم در یک ردیف */
    [style*="min-width: 250px"] {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: unset !important;
    }
    
    /* جنسیت در ردیف بعدی و وسط */
    [style*="min-width: 120px"] {
        flex: 0 0 100% !important;
        min-width: unset !important;
        margin-top: 15px !important;
        text-align: center !important;
    }
    
    /* هم‌تراز کردن عناصر درون بخش جنسیت */
    [style*="min-width: 120px"] div {
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    body {
        background-size: 200px;
    }
    
    .container {
        margin: 8px auto;
        padding: 12px 10px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--secondary-color);
    }
    
    header {
        padding: 5px 0;
        margin-bottom: 12px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
        padding: 8px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .title-text {
        padding: 0 20px;
    }
    
    .title-icon-container {
        top: 10px;
    }
    
    .title-icon-container.right-icon {
        right: 5px;
    }
    
    .title-icon-container.left-icon {
        left: 5px;
    }
    
    .title-icon {
        height: 85px;
        width: 85px;
    }
    
    .nastaliq-title {
        font-size: 4.2rem;
        line-height: 1.2;
        padding: 19px 0 5px;
    }
    
    .hadith {
        font-size: 0.8rem;
        line-height: 1.6;
        padding: 5px;
        margin-top: 5px;
    }
    
    .narrator {
        font-size: 0.75rem;
        display: block;
        margin-bottom: 3px;
    }
    
    .input-section {
        margin-bottom: 12px;
    }
    
    .input-section label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .input-section textarea {
        height: 90px;
        font-size: 0.85rem;
        padding: 8px;
        border-radius: 6px;
    }
    
    .result-box h3, .details-box h3, .letters-stats h3 {
        font-size: 0.95rem;
    }
    
    .result-value {
        font-size: 1.1rem;
    }
    
    .calculation-details {
        font-size: 0.85rem;
    }
    
    .abjad-table {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .abjad-cell {
        padding: 8px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    .stats-container {
        padding: 10px;
        gap: 6px;
    }
    
    .charCell {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 5px;
    }
    
    footer {
        padding: 8px 0;
        margin-top: 15px;
        font-size: 0.75rem;
    }
}

/* اضافه کردن میانه شکست برای تلفن‌های خیلی کوچک */
@media (max-width: 360px) {
    body {
        background-size: 150px;
    }
    
    .container {
        margin: 5px auto;
        padding: 10px 8px;
    }
    
    .title-icon-container {
        top: 5px;
    }
    
    .title-icon {
        height: 70px;
        width: 70px;
    }
    
    .nastaliq-title {
        font-size: 3.9rem;
        padding: 24px 0 5px;
        line-height: 1.2;
    }
    
    .hadith {
        font-size: 0.75rem;
        line-height: 1.5;
        padding: 5px 3px;
    }
    
    .narrator {
        font-size: 0.7rem;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .input-section label {
        font-size: 0.8rem;
    }
    
    .input-section textarea {
        font-size: 0.8rem;
        padding: 6px;
        height: 80px;
    }
    
    .result-box h3, .details-box h3, .letters-stats h3 {
        font-size: 0.9rem;
    }
    
    .result-value {
        font-size: 1rem;
    }
    
    .calculation-details {
        font-size: 0.8rem;
    }
    
    .charCell {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .highlighted-text {
        font-size: 0.8rem;
        min-height: 30px;
    }
}

/* بهبودهای نهایی طراحی ریسپانسیو */

/* --- FORCE headline-img-box IMAGES TO NEVER CROP --- */
.headline-img-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff !important;
  overflow: visible !important;
  padding: 0 !important;
  border: none !important;
}
.headline-img-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
}

/* استفاده از متغیرهای CSS برای ترکیب بهتر */

/* استایل‌های ناوبری بهبودیافته */
.tabs {
    gap: var(--element-gap);
}

.tab-btn {
    font-size: var(--body-size);
    border-radius: calc(var(--border-radius) * 0.6);
    transition: all 0.3s ease;
}

/* طراحی سیال برای فرم‌ها */
.input-section {
    margin-bottom: var(--section-spacing);
}

.input-section label {
    font-size: var(--subtitle-size);
    margin-bottom: calc(var(--element-gap) * 0.8);
}

.input-section textarea {
    font-size: var(--body-size);
    padding: calc(var(--card-padding) * 0.8);
    border-radius: calc(var(--border-radius) * 0.6);
}

/* بهبود کارت‌های نتیجه */
.result-box, .details-box {
    flex: 1;
    width: calc(50% - 10px);
    background-color: rgba(241, 247, 237, 0.7);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    height: 200px;
    display: flex;
    flex-direction: column;
}

.result-box::before, .details-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green-gradient);
}

.result-box h3, .details-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.2rem;
    text-align: right;
}

.result-value {
    font-size: 20px !important;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    padding: 20px;
    margin: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
}

.calculation-details {
    font-size: 14px !important;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    padding: 20px;
    margin: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    overflow-y: auto;
    direction: rtl;
    line-height: 1.8;
}

/* بهبود آمار حروف */
.stats-container {
    gap: var(--element-gap);
    padding: var(--card-padding);
    border-radius: calc(var(--border-radius) * 0.8);
}

.charCell {
    font-size: var(--small-size);
    border-radius: calc(var(--border-radius) * 0.4);
    transition: all 0.3s ease;
}

/* بهبود نمایش حدیث */
.hadith {
    font-size: var(--body-size);
    line-height: 1.8;
    padding: calc(var(--element-gap) * 1.2);
}

.narrator {
    font-size: var(--small-size);
}

/* بهبود تایتل */
.nastaliq-title {
    font-size: var(--title-size);
    line-height: 1.8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

/* اضافه کردن انیمیشن‌های روان */
@media (prefers-reduced-motion: no-preference) {
    .charCell:hover, .tab-btn:hover, .abjad-cell:hover {
        transform: translateY(-2px);
        transition: transform 0.3s ease;
    }
    
    .container {
        animation: fadeIn 0.5s ease-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* استایل‌های پاسخگو */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1000px;
    }
}

/* طراحی چاپ - برای حالت پرینت */
@media print {
    body {
        background: none;
        color: black;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    header {
        padding: 10px 0;
    }
    
    .tab-btn {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
}

/* استایل‌های ریسپانسیو ویژه برای صفحه بررسی طالع و طبع */

/* --- Override for operations page title (match taale.html) --- */
.operations-title.nastaliq-title {
  font-size: 4.2rem !important;
  line-height: 1.5 !important;
  margin-top: -25px !important;
}
@media (max-width: 768px) {
  .operations-title.nastaliq-title {
    font-size: 3.5rem !important;
    margin-top: -20px !important;
  }
}
@media (max-width: 576px) {
  .operations-title.nastaliq-title {
    font-size: 2.8rem !important;
    margin-top: -25px !important;
  }
}
@media (max-width: 480px) {
  .operations-title.nastaliq-title {
    font-size: 2.5rem !important;
    margin-top: -22px !important;
  }
}

@media (max-width: 576px) {
    /* فقط فیلدهای ورودی در صفحه طالع و طبع ریسپانسیو شوند */
    .input-field {
        font-size: 0.85rem;
        padding: 8px 12px;
        border-radius: 6px;
    }
    
    /* کوچک کردن متون در کادر خلاصه نتایج */
    .zodiac-summary-box {
        font-size: 12px !important;
        padding: 12px !important;
    }
    
    .zodiac-summary-box span {
        display: inline-block;
        margin: 5px 0 !important;
    }
    
    .zodiac-summary-box span span {
        display: inline;
        font-size: 12px !important;
    }
    
    /* استایل‌های قبلی */
    .gender-options {
        gap: 8px;
    }
    
    .gender-option {
        padding: 4px 10px;
        border-radius: 6px;
    }
    
    .gender-label {
        font-size: 0.85rem;
    }
    
    /* تغییر چیدمان برای موبایل: نام و نام مادر کنار هم، جنسیت پایین */
    [style*="display: flex; justify-content: center; align-items: flex-start;"] {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
    }
    
    /* نام و نام مادر کنار هم در یک ردیف */
    [style*="min-width: 250px"] {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: unset !important;
    }
    
    /* جنسیت در ردیف بعدی و وسط */
    [style*="min-width: 120px"] {
        flex: 0 0 100% !important;
        min-width: unset !important;
        margin-top: 15px !important;
        text-align: center !important;
    }
    
    /* هم‌تراز کردن عناصر درون بخش جنسیت */
    [style*="min-width: 120px"] div {
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
  /* فیلدهای ورودی در نسخه موبایل کوچکتر */
  .input-field {
    font-size: 0.8rem;
    padding: 6px 10px;
    height: 36px;
    border-radius: 5px;
  }
  
  /* تنظیم اندازه کانتینر فیلدها - حفظ چیدمان افقی */
  [style*="min-width: 250px"] {
    min-width: 100px !important;
    flex-shrink: 0;
  }
  
  [style*="min-width: 120px"] {
    min-width: 100px !important;
    flex-shrink: 0;
  }
  
  /* اضافه کردن اسکرول افقی نرم برای فیلدها در موبایل */
  [style*="display: flex; justify-content: center; align-items: flex-start;"] {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 360px) {
  /* فیلدهای ورودی در نسخه موبایل خیلی کوچک */
  .input-field {
    font-size: 0.75rem;
    padding: 5px 8px;
    height: 34px;
  }
  
  /* تنظیم اندازه کانتینر فیلدها برای گوشی‌های خیلی کوچک - حفظ چیدمان افقی */
  [style*="min-width: 250px"] {
    min-width: 140px !important;
    flex-shrink: 0;
  }
  
  [style*="min-width: 120px"] {
    min-width: 80px !important;
    flex-shrink: 0;
  }
}

.element-stroke {
    font-weight: bold;
}

/* فقط در صفحه حساب ابجد (index.html) افقی شود */
body#index-page .result-section {
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
}

@media (max-width: 768px) {
  body#index-page .result-section {
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  .result-section {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
}

.result-value, .calculation-details {
  font-size: 20px !important;
}

.calculation-details {
  font-size: 14px !important;
  font-weight: bold !important;
}

.result-value#reverse-result, #reverse-result.result-value {
  font-size: 14px !important;
}

#reverse-details {
  font-weight: bold !important;
}

@media (max-width: 480px) {
  #reverse-result.result-value {
    font-size: 20px !important;
  }
}

.charCell {
  font-size: 13px !important;
  font-weight: bold !important;
}

@media (max-width: 480px) {
  footer {
    color: #115e30 !important;
  }
}

@media (min-width: 481px) {
  footer {
    font-size: 22px !important;
    font-family: 'Titr_Plus_Bold_Line', Tahoma, Arial, sans-serif !important;
    color: #115E30 !important;
  }
}

#loading-overlay {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #d4af37 0%, #115e30 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s;
}
.loading-content {
  text-align: center;
  color: #fff;
}
.loading-logo {
  width: 90px;
  height: 90px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px #fff8);
}
.loading-spinner {
  margin: 0 auto 18px auto;
  border: 6px solid #fff;
  border-top: 6px solid #d4af37;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1.1s linear infinite;
  box-shadow: 0 0 20px #fff8;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* دایره هشدار پالس‌دهنده */
.alarm-pulse-separator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff2d2d;
  box-shadow: 0 0 0 0 rgba(255,45,45, 0.7);
  animation: alarmPulse 1.4s infinite cubic-bezier(0.66, 0, 0, 1);
  display: inline-block;
  margin: 0 8px;
}
@keyframes alarmPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255,45,45, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255,45,45, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255,45,45, 0);
  }
}

.loading-title {
  font-family: 'Titr_Plus_Bold_Line', Tahoma, Arial, sans-serif;
  font-size: 1.5rem;
  margin-top: 10px;
  color: #fff;
  text-shadow: 0 2px 8px #174c2c99, 0 0 2px #d4af37;
  letter-spacing: 1px;
}
#loading-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.abjad-type-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255,255,255,0.35);
  border-radius: 18px;
  border: 1.5px solid #27ae60; /* تغییر حاشیه به سبز */
  padding: 18px 32px 14px 32px;
  margin: 0 auto 22px auto;
  max-width: 420px;
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  position: relative;
  animation: abjadFadeIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  transition: box-shadow 0.3s, border 0.3s, background 0.3s;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
  box-shadow: none !important;
}
.abjad-type-box::before {
  content: "";
  position: absolute;
  top: 8px; left: 18px; right: 18px; height: 8px;
  background: linear-gradient(90deg, #ffe082 0%, #fffbe6 100%);
  opacity: 0.25;
  border-radius: 8px;
  filter: blur(2px);
  z-index: 0;
}
.abjad-type-box label {
  color: #27ae60; /* تغییر رنگ نوشته‌ها به سبز */
  font-size: 1.13rem;
  font-weight: bold;
  margin-left: 10px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 8px #fffbe6cc, 0 0 2px #d4af37;
  display: flex;
  align-items: center;
  z-index: 1;
}
.abjad-type-box label::before {
  content: none; /* حذف آیکون ستاره */
}
.abjad-type-box select {
  font-family: inherit;
  font-size: 1.08rem;
  border-radius: 9px;
  border: 1.5px solid #d4af37;
  padding: 7px 22px 7px 18px;
  background: rgba(255,255,255,0.7);
  color: #27ae60; /* تغییر رنگ نوشته‌های سلکت به سبز */
  box-shadow: 0 2px 8px #d4af3711;
  font-weight: bold;
  transition: border 0.2s, box-shadow 0.2s;
  z-index: 1;
}
.abjad-type-box select:focus {
  border: 1.5px solid #d4af37 !important;
  box-shadow: 0 0 0 3px #ffe08299 !important;
  outline: none !important;
}

#taksir-sadr-input {
  outline: none !important;
  box-shadow: none !important;
  font-family: Vazirmatn,Vazir,IRANSans,sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}

@media (max-width: 576px) {
  #taksir-sadr-input {
    font-size: 14px !important;
  }
}


#taksir-save-name-input {
  border: 1.2px solid #bbb !important;
  border-radius: 7px;
  outline: none !important;
  box-shadow: none !important;
  transition: border 0.2s, box-shadow 0.2s;
}
#taksir-save-name-input:focus {
  border: 1.5px solid #d4af37 !important;
  box-shadow: 0 0 0 3px #ffe08299 !important;
  outline: none !important;
}

.abjad-type-box:hover {
  box-shadow: 0 12px 36px 0 #d4af3755, 0 2px 12px #fffbe6cc;
  border: 1.5px solid #d4af37;
  background: rgba(255,255,255,0.55);
}
@keyframes abjadFadeIn {
  0% { opacity: 0; transform: translateY(-18px) scale(0.95); }
  80% { opacity: 1; transform: translateY(4px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .abjad-type-box {
    max-width: 100%;
    padding: 10px 6px 8px 6px;
    font-size: 0.97rem;
    border-radius: 13px;
  }
  .abjad-type-box label {
    font-size: 1rem;
  }
  .abjad-type-box select {
    font-size: 0.97rem;
    padding: 5px 10px 5px 10px;
  }
}

/* تغییر رنگ نوشته و کادر منوی ابجد */

@media (max-width: 576px) {
  #taksir-sadr-download-btn,
#taksir-sadr-save-btn,
#taksir-sadr-manage-saves-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    font-size: 1rem !important;
    margin-top: 28px !important;
    border-radius: 6px !important;
  }
  #taksir-sadr-clear-colors {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    font-size: 1rem !important;
    border-radius: 6px !important;
  }
  #taksir-sadr-color-picker {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 6px !important;
    padding: 0 !important;
  }
  #taksir-sadr-clear-colors i,
  #taksir-sadr-download-btn i,
  #taksir-sadr-save-btn i,
  #taksir-sadr-manage-saves-btn i {
    font-size: 1rem !important;
  }

  /* رنگ سبز اعداد هدر جدول تکسیر صدر مؤخر */
.header-index {
  color: #17643a !important;
  font-weight: bold;
  font-family: inherit;
}

/* جدول تکسیر صدر مؤخر در موبایل */
  #taksir-sadr-results table {
    font-size: 13px !important;
    border-radius: 6px !important;
    min-width: 340px !important;
  }
  #taksir-sadr-results th,
  #taksir-sadr-results td {
    padding: 4px 6px !important;
    font-size: 13px !important;
    border-radius: 4px !important;
  }
  #taksir-sadr-results {
    overflow-x: auto !important;
    max-width: 100vw !important;
  }
  #taksir-sadr-results table {
    width: 100% !important;
    min-width: 340px !important;
    table-layout: auto !important;
  }
  #taksir-sadr-results tr {
    height: 28px !important;
  }
}



.abjad-type-box label,
.abjad-type-box select {
  color: #115e30 !important; /* سبز دکمه‌ها */
}
.abjad-type-box {
  border: 1.5px solid #115e30 !important; /* کادر سبز دکمه‌ها */
}
.abjad-type-box select {
  border: 1.5px solid #115e30 !important;
}
.abjad-type-box select:focus {
  border: 1.5px solid #27ae60 !important;
}

@media (max-width: 480px) {
  .abjad-type-box {
    padding: 7px 4px 6px 4px;
    border-radius: 10px;
  }
  .abjad-type-box label,
  .abjad-type-box select {
    font-size: 14px !important;
  }
}

.kabir-modal-background {
  background-image: url('background2.jpg') !important;
  background-size: 340px 340px !important;
  background-position: center !important;
  background-repeat: repeat !important;
  background-color: transparent !important;
  position: relative;
}

/* استایل برای فیلدهای ورودی در مودال معانی کبیر */
.kabir-modal-background .input-section textarea,
.kabir-modal-background .input-section input {
  box-shadow: 0 2px 8px rgba(224, 183, 86, 0.3) !important;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid #e0b756 !important;
}

.kabir-modal-background .input-section textarea:focus,
.kabir-modal-background .input-section input:focus {
  box-shadow: 0 4px 12px rgba(224, 183, 86, 0.4) !important;
  outline: none;
  border-color: #d4a945 !important;
}

/* استایل برای عنوان معانی کبیر با پس‌زمینه طلایی یکنواخت و عریض */
.kabir-modal-background .modal-header-kanz h2 {
  display: inline-block;
  background: #e0b756; /* رنگ طلایی درخواستی */
  color: #fff !important;
  padding: 10px 50px; /* افزایش پدینگ افقی برای عریض‌تر شدن باکس */
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(224, 183, 86, 0.4);
  margin: 0 auto 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
  font-size: 1.5rem !important; /* افزایش جزئی سایز فونت */
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  min-width: 200px; /* حداقل عرض برای باکس */
  text-align: center; /* متن را وسط‌چین می‌کند */
  box-sizing: border-box; /* اطمینان از محاسبه پدینگ در عرض کل */
}

/* افکت شفافیت برای حالت هاور */
.kabir-modal-background .modal-header-kanz h2:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 183, 86, 0.5);
  transition: all 0.3s ease;
}

/* تنظیمات ریسپانسیو برای عنوان */
@media (max-width: 768px) {
  .kabir-modal-background .modal-header-kanz h2 {
    font-size: 1.2rem !important;
    padding: 6px 18px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .kabir-modal-background .modal-header-kanz h2 {
    font-size: 1.1rem !important;
    padding: 5px 16px;
    margin-bottom: 10px;
  }
}
