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

body {
    background-color: #f5f5f5;
    direction: rtl;
}

.container {
    display: flex;
    flex-direction: row-reverse;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.panel {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

.content-list {
    flex: 1;
    overflow-y: auto;
}

.item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.item.selected {
    background-color: #e3f2fd;
}

/* استایل برای آیتم‌ها در حالت انتخاب با کشیدن */
.item.selecting {
    background-color: #b3e5fc; /* رنگ آبی روشن‌تر برای تمایز */
    outline: 1px dashed #0288d1; /* حاشیه نقطه‌چین */
}

.item:hover {
    background-color: #f0f0f0;
}

.item input[type="checkbox"] {
    margin-left: 10px;
}

.time {
    color: #666;
    font-size: 0.85rem;
    margin-left: 10px;
}

.action-btn {
    margin-top: 20px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #2196f3;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #1976d2;
}

.action-btn:disabled {
    background-color: #b0bec5;
    cursor: not-allowed;
}

.subtitle-list {
    flex: 1;
    overflow-y: auto;
}

.subtitle-item {
    padding: 12px;
    margin-bottom: -17px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.subtitle-number {
    font-weight: bold;
    color: #2196f3;
    margin-bottom: 5px;
}

.subtitle-time {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.subtitle-text {
    line-height: 1.5;
    padding: 5px;
    cursor: text;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.subtitle-text.editable {
    background-color: #fffde7;
    border: 1px dashed #ffb300;
    outline: none;
    padding: 4px;
}

/* اضافه کردن استایل ناحیه دراپ */
.drop-zone {
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    border: 2px dashed #ccc;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border 0.3s ease;
}

.drop-zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-zone-icon {
    font-size: 3rem;
    margin-top: 10px;
    color: #2196f3;
}

.drop-zone:hover {
    border-color: #2196f3;
}

.drop-zone.drop-zone-active {
    border-color: #2196f3;
    background-color: rgba(33, 150, 243, 0.1);
}

.drop-zone-input {
    display: none;
}

/* استایل برای منوی راست کلیک */
.context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
    min-width: 150px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.context-menu li:hover {
    background-color: #f5f5f5;
    color: #2196f3;
}

/* استایل برای کانتینر دکمه اکسپورت */
.export-container {
    margin-bottom: 15px;
}

.export-btn {
    background-color: #4CAF50;
    margin-top: 0;
}

.export-btn:hover {
    background-color: #388E3C;
}

.export-btn:disabled {
    background-color: #b0bec5;
    cursor: not-allowed;
}

/* اضافه کردن استایل برای جداکننده در منو */
.context-menu .divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 5px 0;
    padding: 0;
    cursor: default;
}

.context-menu .divider:hover {
    background-color: #e0e0e0;
    color: inherit;
}

/* استایل ناوبر */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.logo i {
    margin-left: 10px;
    color: #3498db;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-link {
    padding: 10px 15px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
}

.nav-link i {
    margin-left: 8px;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 100%;
    background-color: rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
    border-radius: 8px;
}

.nav-link:hover::before {
    width: 100%;
    left: 0;
}

.nav-link:hover {
    color: #3498db;
}

.nav-link.active {
    background-color: #3498db;
    color: white;
}

.nav-link.active::before {
    display: none;
}

/* تغییر استایل container برای در نظر گرفتن ناوبر */
.container {
    margin-top: 20px;
}

/* انیمیشن برای فعال بودن لینک */
.nav-link.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* اضافه کردن استایل برای منوی راست کلیک زیرنویس */
#subtitle-context-menu li:first-child {
    color: #4CAF50;
    font-weight: bold;
}

#subtitle-context-menu li:nth-child(2),
#subtitle-context-menu li:last-child {
    color: #F44336;
}

/* استایل برای ویرایش زیرنویس */
.subtitle-edit-list {
    flex: 1;
    overflow-y: auto;
}

.srt-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.srt-item.selected {
    background-color: #e3f2fd;
}

.srt-item:hover {
    background-color: #f0f0f0;
}

.srt-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.srt-item-header input[type="checkbox"] {
    margin-left: 10px;
}

.srt-number {
    font-weight: bold;
    color: #2196f3;
    margin-right: 10px;
}

.srt-time {
    color: #666;
    font-size: 0.85rem;
}

.srt-text {
    line-height: 1.5;
    padding: 5px;
    border-radius: 4px;
}

.srt-text.editable {
    background-color: #fffde7;
    border: 1px dashed #ffb300;
    outline: none;
    padding: 8px;
}

/* استایل برای ناوبری بین صفحات */
.nav-link[href="/tools"] {
    position: relative;
    overflow: hidden;
    margin-right: 5px;
}

.nav-link[href="/tools"]::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background-color: #4CAF50;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-link[href="/tools"]:hover::after {
    transform: scaleY(1);
}

.nav-link[href="/tools"].active::after {
    transform: scaleY(1);
}

/* استایل‌های جدید برای متن راست به چپ */
.srt-text.rtl {
    direction: rtl;
    text-align: right;
    unicode-bidi: bidi-override;
}

/* رنگ‌بندی گزینه راست به چپ در منو */
#ctx-rtl {
    color: #9C27B0;
}

/* اضافه کردن نشانگر راست به چپ */
.rtl-indicator {
    display: inline-block;
    background-color: #9C27B0;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* استایل برای نشانگر حذف علایم */
.symbols-removed-indicator {
    display: inline-block;
    background-color: #FF9800;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* حالت خاص برای متنی که علایم آن حذف شده */
.srt-text.symbols-removed {
    color: #FF9800;
}

/* کانتینر نشانگرها در زیرنویس‌های منتقل شده */
.indicator-container {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

/* تطبیق استایل نشانگرها در زیرنویس‌های منتقل شده */
.subtitle-time .rtl-indicator,
.subtitle-time .symbols-removed-indicator {
    font-size: 0.65rem;
    padding: 1px 4px;
}

/* ------ شروع استایل‌های مودال ویرایش ------ */

/* استایل گزینه ویرایش در منوی راست کلیک */
#ctx-edit {
    color: #FF9800; /* رنگ نارنجی برای تمایز */
}

/* پس‌زمینه تیره پشت مودال */
.modal {
    display: none; /* در ابتدا مخفی */
    position: fixed; /* موقعیت ثابت نسبت به صفحه */
    z-index: 1002; /* بالاتر از سایر المان‌ها به جز ناوبر */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* اسکرول در صورت نیاز */
    background-color: rgba(0, 0, 0, 0.6); /* پس‌زمینه نیمه‌شفاف تیره */
    animation: fadeIn 0.3s ease;
}

/* محتوای مودال */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* وسط‌چین عمودی و افقی */
    padding: 30px;
    border: none;
    border-radius: 10px;
    width: 80%; /* عرض مودال */
    max-width: 600px; /* حداکثر عرض */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.4s ease;
}

/* دکمه بستن مودال */
.close-button {
    color: #aaa;
    position: absolute;
    left: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

/* بخش‌های داخل مودال (متن و زمان) */
.modal-section {
    margin-bottom: 25px;
}

.modal-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.modal-section textarea,
.modal-section input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical; /* فقط اجازه تغییر ارتفاع textarea */
    margin-bottom: 10px;
}

.modal-section textarea:focus,
.modal-section input[type="text"]:focus {
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
    outline: none;
}

/* دکمه‌های کپی داخل مودال */
.modal-copy-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background-color: #6c757d; /* خاکستری */
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-right: 5px; /* فاصله کوچک از سمت راست */
}

.modal-copy-btn:hover {
    background-color: #5a6268;
}

/* انیمیشن‌های ساده برای مودال */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* تنظیم z-index برای منوی راست کلیک داخل مودال */
#modal-text-context-menu {
    z-index: 1003; /* بالاتر از مودال (1002) */
}

/* استایل برای لیست‌های شماره‌دار داخل مودال */
.numbered-list {
    max-height: 150px; /* حداکثر ارتفاع با اسکرول */
    overflow-y: auto; /* فعال کردن اسکرول عمودی */
    border: 1px solid #eee; /* حاشیه ملایم */
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px; /* فاصله از المان بالا */
    margin-bottom: 15px; /* فاصله تا دکمه کپی */
    background-color: #f9f9f9; /* پس‌زمینه کمی متفاوت */
    font-size: 0.9rem; /* اندازه فونت کوچکتر */
    line-height: 1.6;
}

.numbered-list div {
    margin-bottom: 5px;
    padding-right: 5px; /* کمی فاصله از سمت راست */
    border-right: 2px solid #2196f3; /* خط نشانگر آبی */
}

.numbered-list span.item-number {
    font-weight: bold;
    color: #2196f3;
    margin-left: 8px; /* فاصله شماره از متن */
    display: inline-block;
    min-width: 20px; /* حداقل عرض برای تراز بهتر */
}

/* استایل برای حالت ویرایش آیتم‌های شماره‌دار */
.numbered-list div.editable {
    background-color: #fffde7;
    outline: 1px dashed #ffb300;
    padding: 0 3px; /* کمی پدینگ برای فاصله متن از حاشیه */
    margin-right: -3px; /* جبران پدینگ راست برای حفظ تراز */
    margin-left: -3px; /* جبران پدینگ چپ */
}

/* استایل برای آیتم‌های شماره‌دار انتخاب شده */
.numbered-list div.selected {
    background-color: #bbdefb; /* آبی خیلی روشن */
}

/* رنگ‌بندی گزینه‌های چسباندن در منوی مودال */
#ctx-modal-merge-zwnj,
#ctx-modal-merge-normal {
    color: #009688;
}

/* تنظیم z-index برای منوی راست کلیک آیتم‌های شماره‌دار */
#modal-numbered-list-context-menu {
    z-index: 1004; /* بالاتر از منوی نیم‌فاصله (1003) */
}

/* استایل هایلایت موقت برای اسکرول */
.numbered-list div.highlight {
    background-color: #c8e6c9 !important; /* پس‌زمینه سبز کم‌رنگ */
    transition: background-color 0.3s ease-out;
}

/* ------ پایان استایل‌های مودال ویرایش ------ */

/* استایل برای ویرایش زیرنویس */
.subtitle-edit-list {
    flex: 1;
    overflow-y: auto;
}

.srt-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.srt-item.selected {
    background-color: #e3f2fd;
}

.srt-item:hover {
    background-color: #f0f0f0;
}

.srt-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.srt-item-header input[type="checkbox"] {
    margin-left: 10px;
}

.srt-number {
    font-weight: bold;
    color: #2196f3;
    margin-right: 10px;
}

.srt-time {
    color: #666;
    font-size: 0.85rem;
}

.srt-text {
    line-height: 1.5;
    padding: 5px;
    border-radius: 4px;
}

.srt-text.editable {
    background-color: #fffde7;
    border: 1px dashed #ffb300;
    outline: none;
    padding: 8px;
}

/* استایل برای ناحیه آپلود بالا */
.top-section {
    max-width: 1400px; /* همان عرض کانتینر اصلی */
    margin: 20px auto 0; /* فاصله بالا و وسط‌چین افقی */
    padding: 0 20px; /* همان پدینگ افقی کانتینر */
}

.top-section .drop-zone {
    width: 100%; /* عرض کامل نسبت به والد (.top-section) */
    max-width: none; /* حذف محدودیت عرض قبلی */
    height: auto; /* ارتفاع خودکار بر اساس محتوا */
    min-height: 100px; /* حداقل ارتفاع */
    padding: 20px; /* پدینگ داخلی */
    margin-bottom: 0; /* حذف فاصله پایین قبلی */
}

/* استایل دکمه‌های اکشن در ناوبر */
.nav-action-btn {
    background-color: rgba(255, 255, 255, 0.1); /* پس‌زمینه کمی متفاوت */
    margin-right: 5px;
}

.nav-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-action-btn.delete {
    background-color: rgba(244, 67, 54, 0.2); /* پس‌زمینه قرمز کم‌رنگ */
}

.nav-action-btn.delete:hover {
    background-color: rgba(244, 67, 54, 0.4);
    color: #f44336;
}

/* استایل برای آیتمی که به عنوان نقطه ادامه علامت خورده */
.item.continue-point {
    border-right: 5px solid #ff9800; /* نوار نارنجی سمت راست */
    background-color: #fff3e0; /* پس‌زمینه نارنجی خیلی کم‌رنگ */
}

/* استایل دکمه برو به ادامه */
.scroll-btn {
    background-color: #ff9800; /* رنگ نارنجی */
    margin-right: 10px; /* فاصله از دکمه قبلی */
}

.scroll-btn:hover {
    background-color: #f57c00; /* نارنجی تیره‌تر */
}

/* رنگ‌بندی گزینه‌های چسباندن در منو */
#ctx-merge-zwnj,
#ctx-merge-normal {
    color: #009688; /* رنگ سبزآبی */
} 