/**
 * استایل‌های پلاگین Tab Navigation برای EditorJS
 * 
 * این فایل شامل استایل‌های RTL برای کامپوننت تب‌های ناوبری است
 */

.ce-tabnav {
    direction: rtl;
    text-align: right;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.ce-tabnav__tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f9fa;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ce-tabnav__tabs::-webkit-scrollbar {
    height: 6px;
}

.ce-tabnav__tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ce-tabnav__tabs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ce-tabnav__tabs::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.ce-tabnav__tab-button {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    position: relative;
    outline: none;
    min-width: 100px;
}

.ce-tabnav__tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.ce-tabnav__tab-button--active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: #fff;
    font-weight: 600;
}

.ce-tabnav__tab-button--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 3px;
    background: #1976d2;
}

.ce-tabnav__tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ce-tabnav__tab-header input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 15px;
    font-weight: inherit;
    color: inherit;
    width: 100%;
    text-align: right;
}

.ce-tabnav__tab-header input:focus {
    outline: none;
    border-bottom: 1px solid #1976d2;
}

.ce-tabnav__tab-button--active .ce-tabnav__tab-header input {
    font-weight: 600;
}

.ce-tabnav__content {
    position: relative;
    min-height: 150px;
}

.ce-tabnav__tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.ce-tabnav__tab-content--active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ce-tabnav__tab-body {
    word-break: break-word;
    line-height: 1.8;
}

.ce-tabnav__tab-body textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.ce-tabnav__tab-body textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.ce-tabnav__delete-button {
    padding: 2px 8px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.ce-tabnav__delete-button:hover {
    opacity: 1;
}

.ce-tabnav__add-button {
    width: 100%;
    padding: 10px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-top: 1px solid #e0e0e0;
}

.ce-tabnav__add-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* استایل برای محتوای HTML در حالت read-only */
.ce-tabnav__tab-body div {
    word-break: break-word;
    line-height: 1.8;
}

.ce-tabnav__tab-body div p {
    margin: 0 0 10px 0;
}

.ce-tabnav__tab-body div p:last-child {
    margin-bottom: 0;
}

.ce-tabnav__tab-body div ul,
.ce-tabnav__tab-body div ol {
    margin: 10px 0;
    padding-right: 25px;
}

.ce-tabnav__tab-body div h1,
.ce-tabnav__tab-body div h2,
.ce-tabnav__tab-body div h3,
.ce-tabnav__tab-body div h4,
.ce-tabnav__tab-body div h5,
.ce-tabnav__tab-body div h6 {
    margin: 15px 0 10px 0;
    font-weight: 600;
}

/* استایل برای موبایل */
@media (max-width: 650px) {
    .ce-tabnav__tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .ce-tabnav__tab-button {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 80px;
    }

    .ce-tabnav__tab-content {
        padding: 15px;
    }

    .ce-tabnav__tab-body textarea {
        min-height: 100px;
        font-size: 13px;
    }

    .ce-tabnav__delete-button {
        padding: 1px 6px !important;
        font-size: 16px !important;
    }
}

/* استایل برای حالت read-only */
.ce-tabnav[data-readonly="true"] .ce-tabnav__tab-content--active {
    padding: 20px;
}

