*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --text: #2c3e50;
    --box-bg: #ffffff;
    --box-border: #e4e4e4;
    --sidebar-settings-width: 280px;
    --sidebar-icons-width: 90px;
    --sidebar-gap: 15px;
    --sidebar-radius: 12px;
}

body.dark {
    --bg: #1f1f22;
    --text: #f1f1f1;
    --box-bg: #26272a;
    --box-border: #3a3a3c;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IRAN Yekan', 'IranYekan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    background-image: radial-gradient(circle, rgba(44, 62, 80, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
}

body.dark {
    background-image: radial-gradient(circle, rgba(241, 241, 241, 0.08) 1px, transparent 1px);
}

.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.main-wrapper {
    flex: 1;
    margin-right: calc(var(--sidebar-settings-width) + var(--sidebar-icons-width) + var(--sidebar-gap) * 3);
    padding: 0 20px;
    width: 100%;
    min-width: 0;
}

.right-sidebar-settings {
    width: var(--sidebar-settings-width);
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--sidebar-radius);
    position: fixed;
    right: calc(var(--sidebar-icons-width) + var(--sidebar-gap) * 2);
    top: var(--sidebar-gap);
    height: calc(100vh - var(--sidebar-gap) * 2);
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.settings-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--box-border);
    text-align: center;
}

.settings-header h3 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.settings-content {
    padding: 20px;
    flex: 1;
}

.setting-item {
    margin-bottom: 24px;
}

.setting-item label {
    font-size: 12px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.8;
}

.setting-item select,
.setting-item input[type="range"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--box-border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

.checkbox-side {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-side input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.sidebar-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.sidebar-download-btn:hover {
    background: #059669;
    transform: scale(1.02);
}

.sidebar-download-btn svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.right-sidebar-icons {
    width: var(--sidebar-icons-width);
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--sidebar-radius);
    position: fixed;
    right: var(--sidebar-gap);
    top: var(--sidebar-gap);
    height: calc(100vh - var(--sidebar-gap) * 2);
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-icons-header {
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid var(--box-border);
}

.sidebar-icons-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.icon-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 5px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
    font-size: 10px;
    border-right: 3px solid transparent;
}

.icon-nav-item:hover {
    background: var(--bg);
    border-right-color: #4f46e5;
}

.icon-nav-item.active {
    background: var(--bg);
    border-right-color: #4f46e5;
}

.icon-nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

header {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    padding: 15px;
    margin-top: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}

.title {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.title2 {
    font-size: 10px;
    background: #f4f5f6;
    border-radius: 15px;
    padding: 7px;
    text-align: center;
}

body.dark .title2 {
    background: #3a3a3c;
}

.header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.theme-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.theme-buttons button {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--box-border);
    background: var(--box-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.theme-buttons button:hover {
    background: #4f46e5;
    color: white;
}

.converter-card {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.converter-title {
    text-align: center;
    margin-bottom: 24px;
}

.converter-title h2 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 24px;
}

.converter-title p {
    color: var(--text);
    opacity: 0.7;
    font-size: 13px;
}

.upload-area {
    border: 2px dashed var(--box-border);
    border-radius: 12px;
    padding: 45px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg);
}

.upload-area:hover {
    border-color: #4f46e5;
    background: var(--box-bg);
}

.upload-area.drag-over {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
}

.upload-area svg {
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    margin-bottom: 6px;
}

.upload-small {
    font-size: 11px;
    opacity: 0.6;
}

.preview-area {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.preview-box {
    flex: 1;
    text-align: center;
}

.preview-box h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.preview-box img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    border: 1px solid var(--box-border);
    background: var(--bg);
}

.sidebar-reset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--box-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.sidebar-reset-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.sidebar-reset-btn svg {
    width: 15px;
    height: 15px;
}

.rotate-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--box-border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.rotate-btn:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.acc-section {
    border: 1px solid var(--box-border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    background: var(--bg);
    transition: background 0.2s;
}

.acc-header:hover { background: var(--box-border); }

.acc-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

.acc-arrow {
    transition: transform 0.2s;
    opacity: 0.5;
}

.acc-body {
    display: none;
    padding: 10px 12px;
    border-top: 1px solid var(--box-border);
}

.acc-body.open { display: block; }

.acc-header.active .acc-arrow { transform: rotate(180deg); }

.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.compact-row label {
    font-size: 11px;
    opacity: 0.75;
    white-space: nowrap;
    flex-shrink: 0;
}

.compact-row select,
.compact-row input[type="range"] {
    flex: 1;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid var(--box-border);
    background: var(--bg);
    color: var(--text);
    font-size: 11px;
    min-width: 0;
}

.compact-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 4px;
}

.compact-check input { cursor: pointer; width: 13px; height: 13px; }
.compact-check label { cursor: pointer; opacity: 0.8; }

.compact-input {
    width: 100%;
    padding: 5px 7px;
    border-radius: 5px;
    border: 1px solid var(--box-border);
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
}

.settings-content { padding: 12px; flex: 1; }

.image-info {
    margin-top: 10px;
    font-size: 11px;
    opacity: 0.7;
}

.svg-color-info {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 6px;
    font-size: 10px;
    display: inline-block;
    font-family: monospace;
}

footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--box-border);
    font-size: 12px;
}

.upload-area.hide-upload {
    display: none;
}

@media (max-width: 900px) {
    :root {
        --sidebar-settings-width: 260px;
        --sidebar-icons-width: 80px;
    }
    .main-wrapper {
        margin-right: calc(260px + 80px + var(--sidebar-gap) * 3);
    }
    .password-box {
        width:100%; !important
    }
}

@media (max-width: 768px) {
    .right-sidebar-settings,
    .right-sidebar-icons {
        display: none;
    }
    .password-box {
        width:100%; !important
    }
    .main-wrapper {
        margin-right: 0;
    }
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .title {
        font-size: 18px;
        text-align: center;
        justify-content: center;
    }
    .header-right {
        width: 100%;
        justify-content: center;
    }
    .preview-area {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .title { font-size: 16px; }
    .converter-title h2 { font-size: 20px; }
}



.menu-item {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;

    width: 100%;
    padding: 6px 20px 6px 0; /* 20px فاصله از راست */

    cursor: pointer;
    background: none;
    transition: 0.25s;
}

/* حرکت نرم هنگام هاور */
.menu-item:hover {
    transform: translateX(-4px);
}

/* رنگ هوشمند سازگار با تم */
.menu-text,
.menu-icon {
    color: #7a69ff;
    transition: 0.2s;
}

/* سایز آیکون */
.menu-icon {
    font-size: 22px;
}

/* ===== تنظیم رنگ برای تم‌ها ===== */


/* اگر سیستم کاربر دارک مود باشد */
@media (prefers-color-scheme: dark) {
    :root {
        --menu-color: #e4ecff; /* آبی روشن برای تم تیره */
    }
}

.password-box {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    padding: 15px;

    width: 100%;
    margin: 20px auto 0 auto;  /* فاصله از بالا + وسط‌چین */

    border-radius: 12px;

    display: flex;
    flex-direction: column;    /* عمودی */
    align-items: center;       /* وسط‌چین افقی */
    gap: 20px;                 /* فاصله بین آیتم‌ها */

    transition: background-color 0.3s, border-color 0.3s;
}
.box-body {
    display: flex;
    gap: 16px;
  }
  
  /* زیر هم در موبایل و تبلت */
  @media (max-width: 1024px) {
    .box-body {
      flex-direction: column;
    }
  }
.description {
    font-size: 12px;
    text-align: center;
    margin-top: -30px;
    color: #6b7280;      /* خاکستری ملایم برای متن توضیح */
    line-height: 1.6;    /* خوانایی بهتر */
    max-width: 420px;    /* خیلی کشیده نشود */
    margin-left: auto;
    margin-right: auto;
  }
.check-group {
    display: flex;
    flex-direction: column; 
    gap: 10px;
    align-items: flex-end; /* کل آیتم‌ها راست قرار بگیرند */
  }
  
  .check-group label {
    display: flex;
    flex-direction: row-reverse; /* چک‌باکس بیاد سمت راست */
    align-items: center;
    gap: 6px; /* فاصله بین چک‌باکس و متن */
  }
  .check-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
  }
  
  /* حالت هاور */
  .check-group input[type="checkbox"]:hover {
    border-color: #333;
  }
  
  /* وقتی تیک می‌خورد */
  .check-group input[type="checkbox"]:checked {
    border-color: #2563eb;
  }
  
  /* آیکون تیک */
  .check-group input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 9px;
    border: solid #2563eb;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 1px;
    left: 5px;
  }
  



  .numbercharacter {
    -webkit-appearance: none;
    width: 80%;
    height: 4px; /* نازک‌تر و ظریف‌تر */
    background: #e5e7eb; /* خاکستری خیلی روشن */
    border-radius: 2px;
    outline: none;
    transition: background 0.3s ease;
  }
  
  /* وقتی ماوس روی آن می‌رود */
  .numbercharacter:hover {
    background: #d1d5db;
  }
  
  /* استایل دایره مدرن (Thumb) */
  .numbercharacter::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff; /* سفید خالص */
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 6px rgba(37, 99, 235, 0.1); /* سایه بسیار ملایم + هاله رنگی کم‌رنگ */
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  /* حالت فعال شدن دایره */
  .numbercharacter::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(37, 99, 235, 0.2);
  }
  
  .numbercharacter:focus::-webkit-slider-thumb {
    border-color: #2563eb;
  }
  





  .btnpass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    width: 42%;              /* تمام عرض (اگر نمیخوای بگو ثابت تنظیم کنم) */
    padding: 16px 32px;       /* پدینگ بیشتر برای ظاهر قوی‌تر */
    margin-top: 10px;
  
    font: inherit;            /* ارث‌بری کامل فونت از بدنه سایت */
    font-weight: 600;
    letter-spacing: 0.3px;
  
    color: #ffffff;
    background-color: #2563eb;
    border: none;
    border-radius: 12px;      /* کمی گردتر برای حس مدرن‌تر */
  
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 
      0 6px 12px rgba(37, 99, 235, 0.25),
      0 2px 4px rgba(37, 99, 235, 0.15);
  
    outline: none;
  }
  
  /* هاور */
  .btnpass:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
  }
  
  /* حالت فشرده */
  .btnpass:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* غیرفعال */
  .btnpass:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  





  .password-output {
    display: flex;
    align-items: center;
    gap: 10px;
  
    padding: 8px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
  
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
  }
  
  .password-output:focus-within {
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(37,99,235,0.18);
  }
  
  /* input نمایش پسورد */
  .password-output input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
  
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.08em;
    direction: ltr;
  
    padding: 12px 14px;
    color: #111827;
  }
  
  /* دکمه کپی */
  .password-output button {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
  
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
  
    background: #2563eb;
    color: white;
  
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  /* hover */
  .password-output button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
  }
  
  /* active */
  .password-output button:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  }
  